|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AttributeGroupInterface
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(java.lang.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(java.lang.String attributeName,
boolean recursive)
Return the AttributeDescriptor corresponding to attributeName. |
java.lang.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(java.lang.String groupName)
Return the subgroup corresponding to groupName. |
java.lang.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(java.lang.String attributeName,
boolean recursive)
Remove an AttributeDescriptor from this AttributeGroup. |
java.lang.String[] |
removeAttributeDescriptors(java.lang.String[] attributeNames,
boolean recursive)
Remove all the AttributeDescriptors included in the input array, attributeNames, from this AttributeGroup. |
AttributeDescriptorInterface[] |
removeAttributeGroup(java.lang.String groupName)
Remove the subgroup corresponding to groupName. |
AttributeDescriptorInterface[] |
removeAttributeGroups(java.lang.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 |
---|
java.lang.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.
boolean containsAttributeDescriptorNamed(java.lang.String attributeName, boolean recursive)
attributeName
- the name of the attributerecursive
- if true, search
the subgroups of this AttributeGroup
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.
void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes) throws java.lang.IllegalArgumentException
newAttributes
- the array of AttributeDescriptors to add to this AttributeGroup
java.lang.IllegalArgumentException
void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes, boolean replace) throws java.lang.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.
java.lang.IllegalArgumentException
- if any of the AttributeDescriptors already exists and the replace
parameter is falsevoid addAttributeDescriptor(AttributeDescriptorInterface attribute, int index) throws java.lang.IllegalArgumentException, java.lang.IndexOutOfBoundsException
attribute
- the AttributeDescriptor to add to the AttributeGroupindex
- position to add the AttributeDescriptor (index of -1 indicates add to the end)
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException
addAttributeDescriptor(AttributeDescriptorInterface attribute, int index, boolean replace)
void addAttributeDescriptor(AttributeDescriptorInterface attribute, int index, boolean replace) throws java.lang.IllegalArgumentException, java.lang.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.
java.lang.IllegalArgumentException
- if the AttributeDescriptor already exists and the replace
parameter is false
java.lang.IndexOutOfBoundsException
- if the index is invalidvoid setAttributeDescriptors(AttributeDescriptorInterface[] attributes) throws java.lang.IllegalArgumentException
attributes
- the array of AttributeDescriptors to replace
java.lang.IllegalArgumentException
- if any of the AttributeDescriptors already existvoid setAttributeDescriptor(AttributeDescriptorInterface attribute) throws java.lang.IllegalArgumentException
attribute
- the AttributeDescriptor to replace in the AttributeGroup.
java.lang.IllegalArgumentException
- if the AttributeDescriptor already existsjava.lang.String[] removeAttributeDescriptors(java.lang.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)
boolean removeAttributeDescriptor(java.lang.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 AttributeGroup
int count(boolean recursive)
recursive
- if true, count the
AttributeDescriptors from any subgroups of this AttributeGroup
AttributeGroupInterface[] getAttributeGroups()
boolean isVisible()
setVisible(boolean visible)
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()
boolean isModifiable()
setModifiable(boolean modifiable)
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()
boolean isExpert()
setExpert(boolean expert)
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()
java.lang.String[] getAttributeGroupNames()
void addAttributeGroups(AttributeGroupInterface[] groups)
groups
- an array of new AttributeGroups to addaddAttributeGroups(AttributeGroupInterface[], boolean replace)
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.
java.lang.IllegalArgumentException
- if the group already exists and the replace
parameter is falsevoid addAttributeGroup(AttributeGroupInterface group, int index) throws java.lang.IndexOutOfBoundsException
group
- a new AttributeGroup to addindex
- position to add the AttributeGroup (index of -1 indicates add to the end)
java.lang.IndexOutOfBoundsException
addAttributeGroup(AttributeGroupInterface group, int index, boolean replace)
void addAttributeGroup(AttributeGroupInterface group, int index, boolean replace) throws java.lang.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.
java.lang.IndexOutOfBoundsException
- if the index is invalid
java.lang.IllegalArgumentException
- if the group already exists and the replace
parameter is falseAttributeDescriptorInterface[] removeAttributeGroups(java.lang.String[] groupNames)
groupNames
- an array of AttributeGroup names to remove from this AttributeGroup
removeAttributeGroup(String)
AttributeDescriptorInterface[] removeAttributeGroup(java.lang.String groupName)
groupName
- the name of the AttributeGroup to remove
AttributeGroupInterface getAttributeGroup(java.lang.String groupName)
groupName
- the name of the AttributeGroup
AttributeDescriptorInterface getAttributeDescriptor(java.lang.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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |