|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
AttributeTypeInterface describes AttributeTypes which define properties that are common to AttributeDescriptors of that type. The Attribute type provides the following information about the AttributeDescriptor:
BaseAttributeDescriptorInterface:
In addition to defining properties, AttributeTypes constrain the data types that are acceptable values for an AttributeDescriptor. As an example, an "int" AttributeType limits values to those that can be used to create the java primitive type of int.
An AttributeType consists of three components:
Types.
Constrains values assigned to an AttributeDescriptor to be compatible with
the sql type. As an example, specifying Types.INTEGER, should limit values
to those that can be used to create a java primitive type of int.
The class, AttributeTypeFactory, contains constants and static functions
for creating common attribute types:
AttributeTypes can be created by either specifying the SQLType (as defined in java.sql.Types) or by specifying a String that corresponds to a java type.
where "String" is the name of the AttributeType
Primitive types and String attribute types are easily created using constants to specify the SQLType:
where "long" is the name of the AttributeType
AttributeTypes can be created by specifying the SQLType:
| Attribute Type | SQL Constant |
|---|---|
| String | Types.VARCHAR |
| long | Types.BIGINT |
| boolean | Types.BOOLEAN |
| double | Types.DOUBLE |
| float | Types.FLOAT |
| int | Types.INTEGER |
| java.lang.Object | Types.OBJECT |
Object types can be created by simply specifying the object's
class name:
Object-type arrays can be created by specifying the object's
class name followed by "[]":
When creating dates for a Date Attribute Type (sql type = Types.DATE), the date needs to created using the GMT timezone in order for it to be shared in a multi-timezone environment.
| Field Summary | |
static int |
ARRAY_TYPE
Constant for creating array attribute types |
static int |
BOOLEAN_TYPE
Constant for creating boolean attribute type |
static int |
BYTE_TYPE
Constant for creating byte attribute type |
static int |
CHAR_TYPE
Constant for creating char attribute type |
static int |
DOUBLE_TYPE
Constant for creating double attribute type |
static int |
FLOAT_TYPE
Constant for creating float attribute type |
static int |
INT_TYPE
Constant for creating int attribute type |
static int |
LONG_TYPE
Constant for creating long attribute type |
static int |
OBJECT_TYPE
Constant for creating java.lang.Object attribute type |
static int |
OTHER_TYPE
Constant for creating "other" types |
static int |
SHORT_TYPE
Constant for creating short attribute type |
static int |
STRING_TYPE
Constant for creating java.lang.String attribute type |
| Method Summary | |
String |
getObjectType()
Return the component type (if the AttributeType was defined as Types.ARRAY) or the classname of the object if the AttributeType was defined as Types.OBJECT. |
int |
getSQLType()
Return the SQL type. |
String |
getType()
Return the java type. |
List |
getValidators(String context)
Return the validators. |
List |
getValidatorsContexts()
Returns a list of validators contexts defined for this AttributeType. |
void |
setObjectType(String type)
Sets the component type (if the AttributeType was defined as Types.ARRAY) or the classname of the object if the AttributeType was defined as Types.OBJECT. |
void |
setSQLType(int sqlType)
Set the SQL type. |
void |
setType(String type)
Set the java type setType("java.lang.String"); //String AttributeType setType("java.util.Date"); //Date AttributeType |
void |
setValidators(String context,
List validators)
Set the validators. |
| Methods inherited from interface com.sas.entities.BaseAttributeDescriptorInterface |
getAttributeCustomizerContexts, getAttributeCustomizers, getConfigurationXML, getCustomizer, getDescription, getDescriptions, getLabel, getLabels, getLargeIconURL, getLargeIconURLs, getName, getSmallIconURL, getSmallIconURLs, setConfigurationXML, setCustomizer, setDescription, setLabel, setLargeIconURL, setName, setSmallIconURL |
| Field Detail |
public static final int STRING_TYPE
public static final int FLOAT_TYPE
public static final int LONG_TYPE
public static final int DOUBLE_TYPE
public static final int INT_TYPE
public static final int SHORT_TYPE
public static final int BOOLEAN_TYPE
public static final int BYTE_TYPE
public static final int CHAR_TYPE
public static final int OBJECT_TYPE
public static final int ARRAY_TYPE
public static final int OTHER_TYPE
| Method Detail |
public int getSQLType()
setSQLType(int sqlType),
Typespublic void setSQLType(int sqlType)
Types.sqlType - generic SQL typegetSQLType(),
Typespublic String getType()
setType(String type)public void setType(String type)
type - classnamegetType()public List getValidators(String context)
context - the context in which the validators are instantiated/used;
it is a platform specification from EntityContextInterfacesetValidators(String context, List validators)
public void setValidators(String context,
List validators)
context - the context in which the validators are instantiated/used;
it is a platform specification from EntityContextInterfacevalidators - names of the validatorsgetValidators(String context),
EntityContextInterfacepublic List getValidatorsContexts()
public String getObjectType()
setObjectType(String type)public void setObjectType(String type)
type - component typegetObjectType()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||