com.sas.entities
Class AttributeType

com.sas.entities.AttributeType
All Implemented Interfaces:
AttributeTypeInterface, BaseAttributeDescriptorInterface, com.sas.RemoteObjectInterface, java.io.Serializable, java.rmi.Remote

public class AttributeType
implements AttributeTypeInterface

A simple implementation of AttributeTypeInterface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.sas.entities.AttributeTypeInterface
ARRAY_TYPE, BOOLEAN_TYPE, BYTE_TYPE, CHAR_TYPE, DOUBLE_TYPE, FLOAT_TYPE, INT_TYPE, LONG_TYPE, OBJECT_TYPE, OTHER_TYPE, SHORT_TYPE, STRING_TYPE
 
Constructor Summary
AttributeType()
          Default constructor.
AttributeType(java.lang.String name, int sqlType)
          Constructs an instance of AttributeType with the given name and sql type.
AttributeType(java.lang.String name, int sqlType, java.lang.String objectType)
          Constructs an instance of AttributeType with the given name, sql type, and object type.
AttributeType(java.lang.String name, java.lang.String type)
          Constructs an instance of AttributeType with the given name and 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 objectType)
          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 class com.sas.entities.BaseAttributeDescriptor
getAttributeCustomizerContexts, getAttributeCustomizers, getConfigurationXML, getCustomizer, getDescription, getDescriptions, getLabel, getLabels, getLargeIconURL, getLargeIconURLs, getName, getSmallIconURL, getSmallIconURLs, setConfigurationXML, setCustomizer, setDescription, setLabel, setLargeIconURL, setName, setSmallIconURL
 
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
 

Constructor Detail

AttributeType

public AttributeType()
Default constructor.


AttributeType

public AttributeType(java.lang.String name,
                     java.lang.String type)
Constructs an instance of AttributeType with the given name and type. The type is used to derive the sql type.

Parameters:
name - name associated with the AttributeType
type - String parameter used to derive the sql type

AttributeType

public AttributeType(java.lang.String name,
                     int sqlType)
Constructs an instance of AttributeType with the given name and sql type.

Parameters:
name - name associated with the AttributeType
sqlType - sql type

AttributeType

public AttributeType(java.lang.String name,
                     int sqlType,
                     java.lang.String objectType)
Constructs an instance of AttributeType with the given name, sql type, and object type. The object type is a fully qualified class name. It is only meaningful if the sql type is Types.JAVA_OBJECT or Types.OTHER.

Parameters:
name - name associated with the AttributeType
sqlType - sql type
objectType - fully qualified class name
Method Detail

getSQLType

public int getSQLType()
Description copied from interface: AttributeTypeInterface
Return the SQL type.

Specified by:
getSQLType in interface AttributeTypeInterface
Returns:
the SQL type
See Also:
AttributeTypeInterface.setSQLType(int sqlType), Types

setSQLType

public void setSQLType(int sqlType)
Description copied from interface: AttributeTypeInterface
Set the SQL type. Valid SQL types are defined in Types.

Specified by:
setSQLType in interface AttributeTypeInterface
Parameters:
sqlType - generic SQL type
See Also:
AttributeTypeInterface.getSQLType(), Types

getType

public java.lang.String getType()
Description copied from interface: AttributeTypeInterface
Return the java type. If the type is an array, it is returned in the form of "classname[]" (.ie int[], java.lang.String[])

Specified by:
getType in interface AttributeTypeInterface
Returns:
java type
See Also:
AttributeTypeInterface.setType(String type)

setType

public void setType(java.lang.String type)
Description copied from interface: AttributeTypeInterface
Set the java type

Specified by:
setType in interface AttributeTypeInterface
Parameters:
type - classname
See Also:
AttributeTypeInterface.getType()

getValidators

public java.util.List getValidators(java.lang.String context)
Description copied from interface: AttributeTypeInterface
Return the validators.

Specified by:
getValidators in interface AttributeTypeInterface
Parameters:
context - the context in which the validators are instantiated/used; it is a platform specification from EntityContextInterface
Returns:
list of validators for the specified context
See Also:
AttributeTypeInterface.setValidators(String context, List validators)

getValidatorsContexts

public java.util.List getValidatorsContexts()
Description copied from interface: AttributeTypeInterface
Returns a list of validators contexts defined for this AttributeType.

Specified by:
getValidatorsContexts in interface AttributeTypeInterface
Returns:
list of contexts

setValidators

public void setValidators(java.lang.String context,
                          java.util.List validators)
Description copied from interface: AttributeTypeInterface
Set the validators. Validators are used to validate input, normalize input, and return error information when the input is invalid.

Specified by:
setValidators in interface AttributeTypeInterface
Parameters:
context - the context in which the validators are instantiated/used; it is a platform specification from EntityContextInterface
validators - names of the validators
See Also:
AttributeTypeInterface.getValidators(String context), EntityContextInterface

getObjectType

public java.lang.String getObjectType()
Description copied from interface: AttributeTypeInterface
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. This method is used for persisting AttributeTypes and is usually invoked from other methods.

Specified by:
getObjectType in interface AttributeTypeInterface
Returns:
component type
See Also:
AttributeTypeInterface.setObjectType(String type)

setObjectType

public void setObjectType(java.lang.String objectType)
Description copied from interface: AttributeTypeInterface
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. This method is used for persisting AttributeTypes and will be invoked from other methods.

Specified by:
setObjectType in interface AttributeTypeInterface
Parameters:
objectType - component type
See Also:
AttributeTypeInterface.getObjectType()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.