com.sas.entities
Interface AttributeDescriptorInterface

All Superinterfaces:
BaseAttributeDescriptorInterface, java.rmi.Remote, com.sas.RemoteObjectInterface
All Known Implementing Classes:
ActionAttributeDescriptor, AttributeDescriptor

public interface AttributeDescriptorInterface
extends BaseAttributeDescriptorInterface

AttributeDescriptorInterface describes an AttributeDescriptor for an Entity. Each AttributeDescriptor has several attributes:

  1. name
  2. label, localizable
  3. description, localizable
  4. small icon, localizable
  5. large icon, localizable
  6. type
  7. customizers
  8. editors
  9. configuration XML
  10. expert
  11. visible
  12. required
  13. modifiable
  14. property
  15. default
  16. defaultValueHasBeenSet

Supplemental Properties

Supplemental properties are user-defined properties that do not currently exist for the AttributeDescriptor. Supplemental properties allow users to expand the properties of the AttributeDescriptor to serve their needs. The following example creates two supplemental properties, "dynamic" and "command", and passes the map as a constructor argument to the Entity:

 HashMap map = new HashMap();
 map.put("dynamic", Boolean.TRUE);
 map.put("command", Boolean.FALSE);
 map.put("dynamic", Boolean.TRUE);
 Entity entity = new Entity(map);
        

The supplemental properties will be applied to all type-based (static) attributes when the Entity is constructed. Supplemental properties are applied to instance-based (dynamic) attributes whenever a setAttribute occurs.

Specifying Multiple Values For the Default Value

For attributes whose AttributeType is non-boolean (Types.BOOLEAN), users can simply pass a java.util.List as a parameter to the setDefault method. Use of a java.util.List for receiving/sending multiple values would continue to allow the sql type to be used to identify the values stored in the java.util.List (AttributeType does not have to be changed to have a sql type of Types.ARRAY).


Field Summary
static java.lang.String DEFAULTVALUESET
          Constant used to specify the isDefaultValueHasBeenSet() function.
static java.lang.String EXPERT
          Constant used to specify the isExpert() function.
static java.lang.String MODIFIABLE
          Constant used to specify the isModifiable() function.
static java.lang.String PROPERTY
          Constant used to specify the isProperty() function.
static java.lang.String REQUIRED
          Constant used to specify the isRequired() function.
static java.lang.String VISIBLE
          Constant used to specify the isVisible() function.
 
Method Summary
 java.util.List getAttributeEditorContexts()
          Returns a list of customizer contexts defined for the AttributeDescriptor.
 java.util.Map getAttributeEditors()
          Returns a mapping of all of the editors defined for the AttributeDescriptor.
 java.lang.Object getDefault()
          Return the default value.
 java.lang.String getEditor(java.lang.String context)
          Returns the editor.
 java.lang.String getStringDefault()
          Returns a string value for the default value.
 java.util.Map getSupplementalProperties()
          Returns the supplemental properties of the AttributeDescriptor.
 java.lang.Object getSupplementalProperty(java.lang.String propertyName)
          Returns the value of the supplemental property.
 AttributeTypeInterface getType()
          Return the AttributeType.
 java.util.List getValidators(java.lang.String context)
          Return the validators.
 java.util.List getValidatorsContexts()
          Returns a list of validators contexts defined for the AttributeDescriptor.
 boolean isDefaultValueHasBeenSet()
          Return true if a default value has been set (through a setDefault(Object defaultValue) call).
 boolean isExpert()
          Returns true if the AttributeDescriptor is classified as expert.
 boolean isModifiable()
          Returns true if the AttributeDescriptor is modifiable.
 boolean isProperty()
          Returns false if the AttributeDescriptor is dynamic (instance-based).
 boolean isRequired()
          Returns true if the attribute value is required.
 boolean isVisible()
          Returns true if the AttributeDescriptor is visible.
 void setDefault(java.lang.Object defaultValue)
          Set the default value.
 void setDefaultValueHasBeenSet(boolean defaultValueHasBeenSet)
          Sets whether the default value has been set.
 void setEditor(java.lang.String context, java.lang.String editor)
          Set the editor.
 void setExpert(boolean expert)
          Sets the expert state.
 void setModifiable(boolean modifiable)
          Sets whether the AttributeDescriptor is modifiable.
 void setProperty(boolean property)
          Set the AttributeDescriptor's property state.
 void setRequired(boolean required)
          Set whether the AttributeDescriptor is required.
 void setSupplementalProperties(java.util.Map map)
          Sets a group of supplemental properties of the AttributeDescriptor.
 void setSupplementalProperty(java.lang.String propertyName, java.lang.Object value)
          Sets the value of the supplemental property.
 void setType(AttributeTypeInterface attributeType)
          Sets the AttributeType.
 void setValidators(java.lang.String context, java.util.List validators)
          Set the validators.
 void setVisible(boolean visible)
          Sets whether the AttributeDescriptor should be visible.
 
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

REQUIRED

static final java.lang.String REQUIRED
Constant used to specify the isRequired() function.

See Also:
RemoteEntityInterface.getBooleanSpecifiedAttributeDescriptors(Map map), Constant Field Values

VISIBLE

static final java.lang.String VISIBLE
Constant used to specify the isVisible() function.

See Also:
RemoteEntityInterface.getBooleanSpecifiedAttributeDescriptors(Map map), Constant Field Values

EXPERT

static final java.lang.String EXPERT
Constant used to specify the isExpert() function.

See Also:
RemoteEntityInterface.getBooleanSpecifiedAttributeDescriptors(Map map), Constant Field Values

MODIFIABLE

static final java.lang.String MODIFIABLE
Constant used to specify the isModifiable() function.

See Also:
RemoteEntityInterface.getBooleanSpecifiedAttributeDescriptors(Map map), Constant Field Values

PROPERTY

static final java.lang.String PROPERTY
Constant used to specify the isProperty() function.

See Also:
RemoteEntityInterface.getBooleanSpecifiedAttributeDescriptors(Map map), Constant Field Values

DEFAULTVALUESET

static final java.lang.String DEFAULTVALUESET
Constant used to specify the isDefaultValueHasBeenSet() function.

See Also:
RemoteEntityInterface.getBooleanSpecifiedAttributeDescriptors(Map map), Constant Field Values
Method Detail

isVisible

boolean isVisible()
Returns true if the AttributeDescriptor is visible. If false, UI (UserInterface) components should not display the AttributeDescriptor.

Returns:
true if visible, false otherwise
See Also:
setVisible(boolean visible)

setVisible

void setVisible(boolean visible)
Sets whether the AttributeDescriptor should be visible.

Parameters:
visible - a boolean value. If false, the AttributeDescriptor should not be displayed in UI (User Interface) components.
See Also:
isVisible()

isProperty

boolean isProperty()
Returns false if the AttributeDescriptor is dynamic (instance-based).

Returns:
false if attribute is dynamic; true otherwise
See Also:
setProperty(boolean property)

setProperty

void setProperty(boolean property)
Set the AttributeDescriptor's property state. This method is not intended for public use.

Parameters:
property - a boolean value
See Also:
isProperty()

isModifiable

boolean isModifiable()
Returns true if the AttributeDescriptor is modifiable. If false, UI (User Interface)components can display the AttributeDescriptor but should not allow it to be modified.

Returns:
true if modifiable; false otherwise
See Also:
setModifiable(boolean modifiable)

setModifiable

void setModifiable(boolean modifiable)
Sets whether the AttributeDescriptor is modifiable.

Parameters:
modifiable - a boolean value. If false, UI (User Interface) components can display the AttributeDescriptor but should not allow it to be modified.
See Also:
isModifiable()

isExpert

boolean isExpert()
Returns true if the AttributeDescriptor is classified as expert. Under normal use, UI (User Interface) components do not display expert AttributeDescriptors, although they may provide a mechanism to enable the display and editing of expert AttributeDescriptors.

Returns:
true if expert; false otherwise
See Also:
setExpert(boolean expert)

setExpert

void setExpert(boolean expert)
Sets the expert state.

Parameters:
expert - a boolean value. If true, under normal circumstances, UI (User Interface) components will not display the AttributeDescriptor.
See Also:
isExpert()

isRequired

boolean isRequired()
Returns true if the attribute value is required. It is insufficient to represent this as a validator since UI (User Interface) components may want to mark required fields (i.e. a Web form may put a * (asterisk) on required fields).

Returns:
true if required; false otherwise
See Also:
setRequired(boolean required)

setRequired

void setRequired(boolean required)
Set whether the AttributeDescriptor is required.

Parameters:
required - a boolean value If true, UI (User Interface) components should check that a value has been assigned for the AttributeDescriptor.
See Also:
isRequired(), setDefault(Object defaultValue)

getType

AttributeTypeInterface getType()
Return the AttributeType. The type gives the abstract (SQL) data type as well as default descriptions, validation, and editors.

Returns:
attribute type
See Also:
setType(AttributeTypeInterface attributeType), AttributeTypeInterface

setType

void setType(AttributeTypeInterface attributeType)
Sets the AttributeType.

Parameters:
attributeType - The AttributeType associated with this AttributeDescriptor.
See Also:
getType()

getStringDefault

java.lang.String getStringDefault()
Returns a string value for the default value.

Returns:
string value for the default value

getDefault

java.lang.Object getDefault()
Return the default value.

Returns:
default value
See Also:
setDefault(Object defaultValue)

setDefault

void setDefault(java.lang.Object defaultValue)
Set the default value.

NOTE: To minimize the potential for internationalization errors, it is recommended that applications convert string values entered for numeric AttributeTypes to the appropriate numeric before setting the default value.

NOTE: 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.

Parameters:
defaultValue - default value for the attribute
See Also:
AttributeTypeInterface, getDefault(), setType

getEditor

java.lang.String getEditor(java.lang.String context)
Returns the editor. The editor is a component that can be placed inside a UI (User Interface) container, such as a property sheet, which edits the value. The context indicates how you would like the editor expressed (in the same form as the validator context).

Parameters:
context - the context in which the editor is instantiated/used; it is a platform specification from EntityContextInterface
Returns:
component to be used for editing the value
See Also:
setEditor(String context, String editor), EntityContextInterface

setEditor

void setEditor(java.lang.String context,
               java.lang.String editor)
Set the editor.

Parameters:
context - the context in which the editor is instantiated/used; it is a platform specification from EntityContextInterface
editor - the class name of the editor
See Also:
getEditor(String context)

getAttributeEditors

java.util.Map getAttributeEditors()
Returns a mapping of all of the editors defined for the AttributeDescriptor. The first item of each entry is the context and the second item is the class name of the editor.

Returns:
editor map

getAttributeEditorContexts

java.util.List getAttributeEditorContexts()
Returns a list of customizer contexts defined for the AttributeDescriptor.

Returns:
list of contexts
See Also:
EntityContextInterface

getValidators

java.util.List getValidators(java.lang.String context)
Return the validators.

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:
setValidators(String context, List validators)

getValidatorsContexts

java.util.List getValidatorsContexts()
Returns a list of validators contexts defined for the AttributeDescriptor.

Returns:
list of contexts
See Also:
EntityContextInterface

setValidators

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

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

isDefaultValueHasBeenSet

boolean isDefaultValueHasBeenSet()
Return true if a default value has been set (through a setDefault(Object defaultValue) call).

Returns:
true if default value set; false otherwise
See Also:
setDefaultValueHasBeenSet(boolean defaultValueHasBeenSet)

setDefaultValueHasBeenSet

void setDefaultValueHasBeenSet(boolean defaultValueHasBeenSet)
Sets whether the default value has been set.

Parameters:
defaultValueHasBeenSet - indicates whether the default value has been set
See Also:
isDefaultValueHasBeenSet()

getSupplementalProperty

java.lang.Object getSupplementalProperty(java.lang.String propertyName)
Returns the value of the supplemental property. A supplemental property is a user-defined property that does not currently exist for the AttributeDescriptor.

Parameters:
propertyName - name of the supplemental property
Returns:
property value
See Also:
setSupplementalProperty(String propertyName, Object value)

setSupplementalProperty

void setSupplementalProperty(java.lang.String propertyName,
                             java.lang.Object value)
Sets the value of the supplemental property. A supplemental property is a user-defined property that does not currently exist for the AttributeDescriptor. Supplemental properties allow users to expand the properties of the AttributeDescriptor to serve their needs. The following example defines two supplemental properties, "dynamic" and "command":
 
  1. setSupplementalProperty("dynamic", Boolean.TRUE);
  2. setSupplementalProperty("command", "some value");

Parameters:
propertyName - name of the supplemental property
value - property value
Throws:
java.lang.IllegalArgumentException - if propertyName is null
See Also:
getSupplementalProperty(String propertyName)

getSupplementalProperties

java.util.Map getSupplementalProperties()
Returns the supplemental properties of the AttributeDescriptor.

Returns:
map of supplemental properties defined for the AttributeDescriptor
See Also:
setSupplementalProperties(Map map)

setSupplementalProperties

void setSupplementalProperties(java.util.Map map)
Sets a group of supplemental properties of the AttributeDescriptor.

Parameters:
map - name/value pairs (property name/property value)
See Also:
getSupplementalProperties()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.