|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
AttributeGroupInterface is a collection of attributes of an Entity, including both type-based and instance-based attributes. The set of attributes returned in a property sheet or other GUI (Graphical User Interface) such as a customizer or web form can be used for configuring or editing an Entity. The AttributeGroup also can be used to validate possible input to an Entity. AttributeGroupInterface provides logical grouping or organization of related attributes into groups. Attribute names should be unique across groups, since the groups are not used when referencing the attributes.
Each group has a name, description, the set of attributes it contains, and the set of additional AttributeGroups it contains.
Since an Entity references attributes through name only, care should be taken to avoid duplicate AttributeDescriptor and AttributeGroup names within an AttributeGroup. The methods used for adding AttributeDescriptors and AttributeGroups will attempt to detect a duplicate entry. However, there are limitations to what the code can detect. Assuming a tree structure, an AttributeGroup can detect duplicates within its subgroups but cannot detect duplicates in AttributeGroups "above" it in a tree structure.
When a duplicate is detected, the duplicate will be replaced if it is being replaced "at the same level" (assuming a tree structure, both the duplicate and the current entry have the same parent). Otherwise, an exception will be thrown.
As mentioned above, a duplicate can be replaced if it is being replaced at the same level as the current entry. This behavior can be changed by setting the replace parameter to false. If the replace parameter is set to false, an exception will be thrown when attempting to add a duplicate AttributeDescriptor/AtrributeGroup name even if the duplicate and current entry are at the same level.
addAttributeDescriptor(AttributeDescriptorInterface attribute, int index, boolean replace),
addAttributeGroup((AttributeGroupInterface group, int index, boolean replace))| Method Summary | |
void |
addAttributeDescriptor(AttributeDescriptorInterface attribute,
int index)
Add an AttributeDescriptor to this AttributeGroup. |
void |
addAttributeDescriptor(AttributeDescriptorInterface attribute,
int index,
boolean replace)
Add an AttributeDescriptor to this AttributeGroup. |
void |
addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes)
Add a set of AttributeDescriptors to this AttributeGroup. |
void |
addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes,
boolean replace)
Add a set of AttributeDescriptors to this AttributeGroup. |
void |
addAttributeGroup(AttributeGroupInterface group,
int index)
Add a subgroup to this AttributeGroup. |
void |
addAttributeGroup(AttributeGroupInterface group,
int index,
boolean replace)
Adds a subgroup to this AttributeGroup. |
void |
addAttributeGroups(AttributeGroupInterface[] groups)
Add subgroups to this AttributeGroup. |
void |
addAttributeGroups(AttributeGroupInterface[] groups,
boolean replace)
Add subgroups to this AttributeGroup. |
boolean |
containsAttributeDescriptorNamed(String attributeName,
boolean recursive)
Determine if this AttributeGroup contains a value with the name attributeName. |
int |
count(boolean recursive)
Return the number of AttributeDescriptors in this AttributeGroup. |
AttributeDescriptorInterface |
getAttributeDescriptor(String attributeName,
boolean recursive)
Return the AttributeDescriptor corresponding to attributeName. |
String[] |
getAttributeDescriptorNames(boolean recursive)
Return a list of AttributeDescriptor names for AttributeDescriptors organized into this AttributeGroup. |
AttributeDescriptorInterface[] |
getAttributeDescriptors(boolean recursive)
Returns an array of AttributeDescriptors which are in this AttributeGroup. |
AttributeGroupInterface |
getAttributeGroup(String groupName)
Return the subgroup corresponding to groupName. |
String[] |
getAttributeGroupNames()
Returns an array of the names of the subgroups. |
AttributeGroupInterface[] |
getAttributeGroups()
Returns an array of subgroups nested within this AttributeGroup. |
boolean |
isExpert()
Returns true if the AttributeGroup is classified as expert. |
boolean |
isModifiable()
Returns true if the AttributeGroup is modifiable. |
boolean |
isVisible()
Returns true if the AttributeGroup is visible. |
boolean |
removeAttributeDescriptor(String attributeName,
boolean recursive)
Remove an AttributeDescriptor from this AttributeGroup. |
String[] |
removeAttributeDescriptors(String[] attributeNames,
boolean recursive)
Remove all the AttributeDescriptors included in the input array, attributeNames, from this AttributeGroup. |
AttributeDescriptorInterface[] |
removeAttributeGroup(String groupName)
Remove the subgroup corresponding to groupName. |
AttributeDescriptorInterface[] |
removeAttributeGroups(String[] groupNames)
Remove the subgroups corresponding to the group names in the input array, groupsNames. |
void |
setAttributeDescriptor(AttributeDescriptorInterface attribute)
Replace an AttributeDescriptor in this AttributeGroup. |
void |
setAttributeDescriptors(AttributeDescriptorInterface[] attributes)
Replace a set of AttributeDescriptors in this AttributeGroup. |
void |
setExpert(boolean expert)
Sets the expert state. |
void |
setModifiable(boolean modifiable)
Sets whether the AttributeGroup is modifiable. |
void |
setVisible(boolean visible)
Sets whether the AttributeGroup 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 |
| Method Detail |
public String[] getAttributeDescriptorNames(boolean recursive)
recursive - if true, return AttributeDescriptor names from
this AttributeGroup and its subgroups.
If false, this method only returns the AttributeDescriptor names that are
in this AttributeGroup.
public boolean containsAttributeDescriptorNamed(String attributeName,
boolean recursive)
attributeName - the name of the attributerecursive - if true, search
the subgroups of this AttributeGrouppublic AttributeDescriptorInterface[] getAttributeDescriptors(boolean recursive)
recursive - if true, return AttributeDescriptors in
this AttributeGroup and its subgroups.
If false, this method only returns the AttributeDescriptor names that are in this
AttributeGroup.
public void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes)
throws IllegalArgumentException
newAttributes - the array of AttributeDescriptors to add to this AttributeGroup
public void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes,
boolean replace)
throws IllegalArgumentException
newAttributes - the array of AttributeDescriptors to add to the AttributeGroup.replace - indicates whether to replace an AttributeDescriptor if a duplicate name is
detected. If set to false, this method throws an
IllegalArgumentException if a duplicate name is detected.IllegalArgumentException - if any of the AttributeDescriptors already exists and the replace
parameter is false
public void addAttributeDescriptor(AttributeDescriptorInterface attribute,
int index)
throws IllegalArgumentException,
IndexOutOfBoundsException
attribute - the AttributeDescriptor to add to the AttributeGroupindex - position to add the AttributeDescriptor (index of -1 indicates add to the end)addAttributeDescriptor(AttributeDescriptorInterface attribute, int index, boolean replace)
public void addAttributeDescriptor(AttributeDescriptorInterface attribute,
int index,
boolean replace)
throws IllegalArgumentException,
IndexOutOfBoundsException
attribute - the AttributeDescriptor to add to the AttributeGroupindex - position to add the AttributeDescriptor (index of -1 indicates add to the end)replace - indicates whether to replace an AttributeDescriptor if a duplicate name is
detected. If set to false, this method throws an
IllegalArgumentException if a duplicate name is detected.IllegalArgumentException - if the AttributeDescriptor already exists and the replace
parameter is falseIndexOutOfBoundsException - if the index is invalid
public void setAttributeDescriptors(AttributeDescriptorInterface[] attributes)
throws IllegalArgumentException
attributes - the array of AttributeDescriptors to replaceIllegalArgumentException - if any of the AttributeDescriptors already exist
public void setAttributeDescriptor(AttributeDescriptorInterface attribute)
throws IllegalArgumentException
attribute - the AttributeDescriptor to replace in the AttributeGroup.IllegalArgumentException - if the AttributeDescriptor already exists
public String[] removeAttributeDescriptors(String[] attributeNames,
boolean recursive)
recursive - if true, any AttributeDescriptors listed in
this set are removed from the nested subgroupsattributeNames - an array of AttributeDescriptor names to remove from the
group (and its subgroups, if recursive is true)
public boolean removeAttributeDescriptor(String attributeName,
boolean recursive)
attributeName - name of the AttributeDescriptorrecursive - if true, try to remove the AttributeDescriptor
from any subgroups if the AttributeDescriptor is not found in
this AttributeGrouppublic int count(boolean recursive)
recursive - if true, count the
AttributeDescriptors from any subgroups of this AttributeGrouppublic AttributeGroupInterface[] getAttributeGroups()
public boolean isVisible()
setVisible(boolean visible)public void setVisible(boolean visible)
visible - a boolean value.
If false, the AttributeGroup and its AttributeDescriptors
should not be displayed in UI (User Interface) components.isVisible()public boolean isModifiable()
setModifiable(boolean modifiable)public void setModifiable(boolean modifiable)
modifiable - a boolean value.
If false, UI (User Interface) components can display the AttributeGroup
and its AttributeDescriptors
but should not allow them to be modified.isModifiable()public boolean isExpert()
setExpert(boolean expert)public void setExpert(boolean expert)
expert - a boolean value
If true, under normal circumstances, UI (User Interface) components will not display
this AttributeGroup and its AttributeDescriptors.isExpert()public String[] getAttributeGroupNames()
public void addAttributeGroups(AttributeGroupInterface[] groups)
groups - an array of new AttributeGroups to addaddAttributeGroups(AttributeGroupInterface[], boolean replace)
public void addAttributeGroups(AttributeGroupInterface[] groups,
boolean replace)
groups - an array of new AttributeGroups to addreplace - indicates whether to replace a subgroup if a duplicate name is
detected. If set to false, this method throws an
IllegalArgumentException if a duplicate name is detected.IllegalArgumentException - if the group already exists and the replace
parameter is false
public void addAttributeGroup(AttributeGroupInterface group,
int index)
throws IndexOutOfBoundsException
group - a new AttributeGroup to addindex - position to add the AttributeGroup (index of -1 indicates add to the end)addAttributeGroup(AttributeGroupInterface group, int index, boolean replace)
public void addAttributeGroup(AttributeGroupInterface group,
int index,
boolean replace)
throws IndexOutOfBoundsException
group - a new AttributeGroup to addindex - position to add the attribute (index of -1 indicates add to the end)replace - indicates whether to replace a subgroup if a duplicate name is
detected. The default value is true. If set to false, this method throws an
IllegalArgumentException if a duplicate name is detected.IndexOutOfBoundsException - if the index is invalidIllegalArgumentException - if the group already exists and the replace
parameter is falsepublic AttributeDescriptorInterface[] removeAttributeGroups(String[] groupNames)
groupNames - an array of AttributeGroup names to remove from this AttributeGroupremoveAttributeGroup(String)public AttributeDescriptorInterface[] removeAttributeGroup(String groupName)
groupName - the name of the AttributeGroup to removepublic AttributeGroupInterface getAttributeGroup(String groupName)
groupName - the name of the AttributeGroup
public AttributeDescriptorInterface getAttributeDescriptor(String attributeName,
boolean recursive)
attributeName - the name of the AttributeDescriptorrecursive - If true, will search all
subgroups for the AttributeDescriptor
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||