com.sas.entities
Class AttributeDescriptor

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

public class AttributeDescriptor
implements java.io.Serializable, AttributeDescriptorInterface

A base implementation of AttributeDescriptorInterface.

See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
          Key used to read resource entries for this class
protected  java.util.Map supplementalProperties
           
 
Fields inherited from interface com.sas.entities.AttributeDescriptorInterface
DEFAULTVALUESET, EXPERT, MODIFIABLE, PROPERTY, REQUIRED, VISIBLE
 
Constructor Summary
AttributeDescriptor()
          Default constructor
AttributeDescriptor(java.lang.String name)
          Constructs an instance of AttributeDescriptor with the given name.
AttributeDescriptor(java.lang.String name, java.util.Map supplementalProperties)
          Constructs an instance of AttributeDescriptor with the given name.
 
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 AttributeDescriptorInterface.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 additionalProperties)
          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 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
 

Field Detail

supplementalProperties

protected java.util.Map supplementalProperties

RB_KEY

public static final java.lang.String RB_KEY
Key used to read resource entries for this class

See Also:
Constant Field Values
Constructor Detail

AttributeDescriptor

public AttributeDescriptor()
Default constructor


AttributeDescriptor

public AttributeDescriptor(java.lang.String name)
Constructs an instance of AttributeDescriptor with the given name.

Parameters:
name - name associated with the AttributeDescriptor

AttributeDescriptor

public AttributeDescriptor(java.lang.String name,
                           java.util.Map supplementalProperties)
Constructs an instance of AttributeDescriptor with the given name.

Parameters:
name - name associated with the AttributeDescriptor
Method Detail

isVisible

public boolean isVisible()
Description copied from interface: AttributeDescriptorInterface
Returns true if the AttributeDescriptor is visible. If false, UI (UserInterface) components should not display the AttributeDescriptor.

Specified by:
isVisible in interface AttributeDescriptorInterface
Returns:
true if visible, false otherwise
See Also:
AttributeDescriptorInterface.setVisible(boolean visible)

setVisible

public void setVisible(boolean visible)
Description copied from interface: AttributeDescriptorInterface
Sets whether the AttributeDescriptor should be visible.

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

isProperty

public boolean isProperty()
Description copied from interface: AttributeDescriptorInterface
Returns false if the AttributeDescriptor is dynamic (instance-based).

Specified by:
isProperty in interface AttributeDescriptorInterface
Returns:
false if attribute is dynamic; true otherwise
See Also:
AttributeDescriptorInterface.setProperty(boolean property)

setProperty

public void setProperty(boolean property)
Description copied from interface: AttributeDescriptorInterface
Set the AttributeDescriptor's property state. This method is not intended for public use.

Specified by:
setProperty in interface AttributeDescriptorInterface
Parameters:
property - a boolean value
See Also:
AttributeDescriptorInterface.isProperty()

isModifiable

public boolean isModifiable()
Description copied from interface: AttributeDescriptorInterface
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.

Specified by:
isModifiable in interface AttributeDescriptorInterface
Returns:
true if modifiable; false otherwise
See Also:
AttributeDescriptorInterface.setModifiable(boolean modifiable)

setModifiable

public void setModifiable(boolean modifiable)
Description copied from interface: AttributeDescriptorInterface
Sets whether the AttributeDescriptor is modifiable.

Specified by:
setModifiable in interface AttributeDescriptorInterface
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:
AttributeDescriptorInterface.isModifiable()

isExpert

public boolean isExpert()
Description copied from interface: AttributeDescriptorInterface
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.

Specified by:
isExpert in interface AttributeDescriptorInterface
Returns:
true if expert; false otherwise
See Also:
AttributeDescriptorInterface.setExpert(boolean expert)

setExpert

public void setExpert(boolean expert)
Description copied from interface: AttributeDescriptorInterface
Sets the expert state.

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

isRequired

public boolean isRequired()
Description copied from interface: AttributeDescriptorInterface
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).

Specified by:
isRequired in interface AttributeDescriptorInterface
Returns:
true if required; false otherwise
See Also:
AttributeDescriptorInterface.setRequired(boolean required)

setRequired

public void setRequired(boolean required)
Description copied from interface: AttributeDescriptorInterface
Set whether the AttributeDescriptor is required.

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

getType

public AttributeTypeInterface getType()
Description copied from interface: AttributeDescriptorInterface
Return the AttributeType. The type gives the abstract (SQL) data type as well as default descriptions, validation, and editors.

Specified by:
getType in interface AttributeDescriptorInterface
Returns:
attribute type
See Also:
AttributeDescriptorInterface.setType(AttributeTypeInterface attributeType), AttributeTypeInterface

setType

public void setType(AttributeTypeInterface attributeType)
Description copied from interface: AttributeDescriptorInterface
Sets the AttributeType.

Specified by:
setType in interface AttributeDescriptorInterface
Parameters:
attributeType - The AttributeType associated with this AttributeDescriptor.
See Also:
AttributeDescriptorInterface.getType()

getStringDefault

public java.lang.String getStringDefault()
Description copied from interface: AttributeDescriptorInterface
Returns a string value for the default value.

Specified by:
getStringDefault in interface AttributeDescriptorInterface
Returns:
string value for the default value

getDefault

public java.lang.Object getDefault()
Description copied from interface: AttributeDescriptorInterface
Return the default value.

Specified by:
getDefault in interface AttributeDescriptorInterface
Returns:
default value
See Also:
AttributeDescriptorInterface.setDefault(Object defaultValue)

setDefault

public void setDefault(java.lang.Object defaultValue)
Description copied from interface: AttributeDescriptorInterface
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.

Specified by:
setDefault in interface AttributeDescriptorInterface
Parameters:
defaultValue - default value for the attribute
See Also:
AttributeTypeInterface, AttributeDescriptorInterface.getDefault(), setType

getEditor

public java.lang.String getEditor(java.lang.String context)
Description copied from interface: AttributeDescriptorInterface
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).

Specified by:
getEditor in interface AttributeDescriptorInterface
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:
AttributeDescriptorInterface.setEditor(String context, String editor), EntityContextInterface

setEditor

public void setEditor(java.lang.String context,
                      java.lang.String editor)
Description copied from interface: AttributeDescriptorInterface
Set the editor.

Specified by:
setEditor in interface AttributeDescriptorInterface
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:
AttributeDescriptorInterface.getEditor(String context)

getAttributeEditors

public java.util.Map getAttributeEditors()
Description copied from interface: AttributeDescriptorInterface
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.

Specified by:
getAttributeEditors in interface AttributeDescriptorInterface
Returns:
editor map

getAttributeEditorContexts

public java.util.List getAttributeEditorContexts()
Description copied from interface: AttributeDescriptorInterface
Returns a list of customizer contexts defined for the AttributeDescriptor.

Specified by:
getAttributeEditorContexts in interface AttributeDescriptorInterface
Returns:
list of contexts
See Also:
EntityContextInterface

getValidators

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

Specified by:
getValidators in interface AttributeDescriptorInterface
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:
AttributeDescriptorInterface.setValidators(String context, List validators)

getValidatorsContexts

public java.util.List getValidatorsContexts()
Description copied from interface: AttributeDescriptorInterface
Returns a list of validators contexts defined for the AttributeDescriptor.

Specified by:
getValidatorsContexts in interface AttributeDescriptorInterface
Returns:
list of contexts
See Also:
EntityContextInterface

setValidators

public void setValidators(java.lang.String context,
                          java.util.List validators)
Description copied from interface: AttributeDescriptorInterface
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 AttributeDescriptorInterface
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, AttributeDescriptorInterface.getValidators(String context)

isDefaultValueHasBeenSet

public boolean isDefaultValueHasBeenSet()
Description copied from interface: AttributeDescriptorInterface
Return true if a default value has been set (through a AttributeDescriptorInterface.setDefault(Object defaultValue) call).

Specified by:
isDefaultValueHasBeenSet in interface AttributeDescriptorInterface
Returns:
true if default value set; false otherwise
See Also:
AttributeDescriptorInterface.setDefaultValueHasBeenSet(boolean defaultValueHasBeenSet)

setDefaultValueHasBeenSet

public void setDefaultValueHasBeenSet(boolean defaultValueHasBeenSet)
Description copied from interface: AttributeDescriptorInterface
Sets whether the default value has been set.

Specified by:
setDefaultValueHasBeenSet in interface AttributeDescriptorInterface
Parameters:
defaultValueHasBeenSet - indicates whether the default value has been set
See Also:
AttributeDescriptorInterface.isDefaultValueHasBeenSet()

getSupplementalProperty

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

Specified by:
getSupplementalProperty in interface AttributeDescriptorInterface
Parameters:
propertyName - name of the supplemental property
Returns:
property value
See Also:
AttributeDescriptorInterface.setSupplementalProperty(String propertyName, Object value)

setSupplementalProperty

public void setSupplementalProperty(java.lang.String propertyName,
                                    java.lang.Object value)
Description copied from interface: AttributeDescriptorInterface
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");

Specified by:
setSupplementalProperty in interface AttributeDescriptorInterface
Parameters:
propertyName - name of the supplemental property
value - property value
See Also:
AttributeDescriptorInterface.getSupplementalProperty(String propertyName)

getSupplementalProperties

public java.util.Map getSupplementalProperties()
Description copied from interface: AttributeDescriptorInterface
Returns the supplemental properties of the AttributeDescriptor.

Specified by:
getSupplementalProperties in interface AttributeDescriptorInterface
Returns:
map of supplemental properties defined for the AttributeDescriptor
See Also:
AttributeDescriptorInterface.setSupplementalProperties(Map map)

setSupplementalProperties

public void setSupplementalProperties(java.util.Map additionalProperties)
Description copied from interface: AttributeDescriptorInterface
Sets a group of supplemental properties of the AttributeDescriptor.

Specified by:
setSupplementalProperties in interface AttributeDescriptorInterface
Parameters:
additionalProperties - name/value pairs (property name/property value)
See Also:
AttributeDescriptorInterface.getSupplementalProperties()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.