|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AttributeTypeInterface
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 | |
---|---|
java.lang.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. |
java.lang.String |
getType()
Return the java type. |
java.util.List |
getValidators(java.lang.String context)
Return the validators. |
java.util.List |
getValidatorsContexts()
Returns a list of validators contexts defined for this AttributeType. |
void |
setObjectType(java.lang.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(java.lang.String type)
Set the java type setType("java.lang.String"); //String AttributeType setType("java.util.Date"); //Date AttributeType |
void |
setValidators(java.lang.String context,
java.util.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 |
---|
static final int STRING_TYPE
static final int FLOAT_TYPE
static final int LONG_TYPE
static final int DOUBLE_TYPE
static final int INT_TYPE
static final int SHORT_TYPE
static final int BOOLEAN_TYPE
static final int BYTE_TYPE
static final int CHAR_TYPE
static final int OBJECT_TYPE
static final int ARRAY_TYPE
static final int OTHER_TYPE
Method Detail |
---|
int getSQLType()
setSQLType(int sqlType)
,
Types
void setSQLType(int sqlType)
Types
.
sqlType
- generic SQL typegetSQLType()
,
Types
java.lang.String getType()
setType(String type)
void setType(java.lang.String type)
type
- classnamegetType()
java.util.List getValidators(java.lang.String context)
context
- the context in which the validators are instantiated/used;
it is a platform specification from EntityContextInterface
setValidators(String context, List validators)
void setValidators(java.lang.String context, java.util.List validators)
context
- the context in which the validators are instantiated/used;
it is a platform specification from EntityContextInterface
validators
- names of the validatorsgetValidators(String context)
,
EntityContextInterface
java.util.List getValidatorsContexts()
java.lang.String getObjectType()
setObjectType(String type)
void setObjectType(java.lang.String type)
type
- component typegetObjectType()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |