com.sas.entities
Interface AttributeGroupInterface

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

public interface AttributeGroupInterface
extends BaseAttributeDescriptorInterface

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.

Duplicate AttributeGroup/AttributeDescriptor Names

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.

See Also:
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

getAttributeDescriptorNames

java.lang.String[] getAttributeDescriptorNames(boolean recursive)
Return a list of AttributeDescriptor names for AttributeDescriptors organized into this AttributeGroup.

Parameters:
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.
Returns:
the list of AttributeDescriptor names in this AttributeGroup (or subgroups if recursive is true)

containsAttributeDescriptorNamed

boolean containsAttributeDescriptorNamed(java.lang.String attributeName,
                                         boolean recursive)
Determine if this AttributeGroup contains a value with the name attributeName.

Parameters:
attributeName - the name of the attribute
recursive - if true, search the subgroups of this AttributeGroup
Returns:
true if this AttributeGroup (or subgroups if recursive is true) contains the AttributeDescriptor

getAttributeDescriptors

AttributeDescriptorInterface[] getAttributeDescriptors(boolean recursive)
Returns an array of AttributeDescriptors which are in this AttributeGroup.

Parameters:
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.
Returns:
the list of AttributeDescriptors in this AttributeGroup (or subgroups if recursive is true)

addAttributeDescriptors

void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes)
                             throws java.lang.IllegalArgumentException
Add a set of AttributeDescriptors to this AttributeGroup. Each AttributeDescriptor must have a unique name within this AttributeGroup and its subgroups.

Parameters:
newAttributes - the array of AttributeDescriptors to add to this AttributeGroup
Throws:
java.lang.IllegalArgumentException

addAttributeDescriptors

void addAttributeDescriptors(AttributeDescriptorInterface[] newAttributes,
                             boolean replace)
                             throws java.lang.IllegalArgumentException
Add a set of AttributeDescriptors to this AttributeGroup. Each AttributeDescriptor must have a unique name within this AttributeGroup and its subgroups.

Parameters:
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.
Throws:
java.lang.IllegalArgumentException - if any of the AttributeDescriptors already exists and the replace parameter is false

addAttributeDescriptor

void addAttributeDescriptor(AttributeDescriptorInterface attribute,
                            int index)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.IndexOutOfBoundsException
Add an AttributeDescriptor to this AttributeGroup.

Parameters:
attribute - the AttributeDescriptor to add to the AttributeGroup
index - position to add the AttributeDescriptor (index of -1 indicates add to the end)
Throws:
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException
See Also:
addAttributeDescriptor(AttributeDescriptorInterface attribute, int index, boolean replace)

addAttributeDescriptor

void addAttributeDescriptor(AttributeDescriptorInterface attribute,
                            int index,
                            boolean replace)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.IndexOutOfBoundsException
Add an AttributeDescriptor to this AttributeGroup.

Parameters:
attribute - the AttributeDescriptor to add to the AttributeGroup
index - 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.
Throws:
java.lang.IllegalArgumentException - if the AttributeDescriptor already exists and the replace parameter is false
java.lang.IndexOutOfBoundsException - if the index is invalid

setAttributeDescriptors

void setAttributeDescriptors(AttributeDescriptorInterface[] attributes)
                             throws java.lang.IllegalArgumentException
Replace a set of AttributeDescriptors in this AttributeGroup.

Parameters:
attributes - the array of AttributeDescriptors to replace
Throws:
java.lang.IllegalArgumentException - if any of the AttributeDescriptors already exist

setAttributeDescriptor

void setAttributeDescriptor(AttributeDescriptorInterface attribute)
                            throws java.lang.IllegalArgumentException
Replace an AttributeDescriptor in this AttributeGroup.

Parameters:
attribute - the AttributeDescriptor to replace in the AttributeGroup.
Throws:
java.lang.IllegalArgumentException - if the AttributeDescriptor already exists

removeAttributeDescriptors

java.lang.String[] removeAttributeDescriptors(java.lang.String[] attributeNames,
                                              boolean recursive)
Remove all the AttributeDescriptors included in the input array, attributeNames, from this AttributeGroup. Not all AttributeDescriptors may be removed; this method only addresses instance-based attributes.

Parameters:
recursive - if true, any AttributeDescriptors listed in this set are removed from the nested subgroups
attributeNames - an array of AttributeDescriptor names to remove from the group (and its subgroups, if recursive is true)
Returns:
an array containing the names of the AttributeDescriptors which were removed from this AttributeGroup (and its subgroups, if recursive is true)

removeAttributeDescriptor

boolean removeAttributeDescriptor(java.lang.String attributeName,
                                  boolean recursive)
Remove an AttributeDescriptor from this AttributeGroup. Not all AttributeDescriptors may be removed; this method only addresses instance-based attributes.

Parameters:
attributeName - name of the AttributeDescriptor
recursive - if true, try to remove the AttributeDescriptor from any subgroups if the AttributeDescriptor is not found in this AttributeGroup
Returns:
false if the AttributeDescriptor is not found in this AttributeGroup (or its subgroups, if recursive is true)

count

int count(boolean recursive)
Return the number of AttributeDescriptors in this AttributeGroup.

Parameters:
recursive - if true, count the AttributeDescriptors from any subgroups of this AttributeGroup
Returns:
the number of AttributesDescriptors in this AttributeGroup (and its subgroups, if recursive is true)

getAttributeGroups

AttributeGroupInterface[] getAttributeGroups()
Returns an array of subgroups nested within this AttributeGroup.

Returns:
subgroups of this AttributeGroup

isVisible

boolean isVisible()
Returns true if the AttributeGroup is visible. If false, UI (User Interface) components should not display the AttributeGroup and its AttributesDescriptors.

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

setVisible

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

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

isModifiable

boolean isModifiable()
Returns true if the AttributeGroup is modifiable. If false, UI (User Interface) components can display the AttributeGroup and its AttributeDescriptors but should not allow them to be modified.

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

setModifiable

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

Parameters:
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.
See Also:
isModifiable()

isExpert

boolean isExpert()
Returns true if the AttributeGroup is classified as expert. If true, all AttributeDescriptors that are a part of the AttributeGroup will behave as though their expert state had been set to the AttributeGroup's state. Under normal use, UI (User Interface) components do not display expert attributes, although they may provide a mechanism to enable the display and editing of expert AttributeGroups and 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 this AttributeGroup and its AttributeDescriptors.
See Also:
isExpert()

getAttributeGroupNames

java.lang.String[] getAttributeGroupNames()
Returns an array of the names of the subgroups.


addAttributeGroups

void addAttributeGroups(AttributeGroupInterface[] groups)
Add subgroups to this AttributeGroup.

Parameters:
groups - an array of new AttributeGroups to add
See Also:
addAttributeGroups(AttributeGroupInterface[], boolean replace)

addAttributeGroups

void addAttributeGroups(AttributeGroupInterface[] groups,
                        boolean replace)
Add subgroups to this AttributeGroup.

Parameters:
groups - an array of new AttributeGroups to add
replace - 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.
Throws:
java.lang.IllegalArgumentException - if the group already exists and the replace parameter is false

addAttributeGroup

void addAttributeGroup(AttributeGroupInterface group,
                       int index)
                       throws java.lang.IndexOutOfBoundsException
Add a subgroup to this AttributeGroup.

Parameters:
group - a new AttributeGroup to add
index - position to add the AttributeGroup (index of -1 indicates add to the end)
Throws:
java.lang.IndexOutOfBoundsException
See Also:
addAttributeGroup(AttributeGroupInterface group, int index, boolean replace)

addAttributeGroup

void addAttributeGroup(AttributeGroupInterface group,
                       int index,
                       boolean replace)
                       throws java.lang.IndexOutOfBoundsException
Adds a subgroup to this AttributeGroup.

Parameters:
group - a new AttributeGroup to add
index - 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.
Throws:
java.lang.IndexOutOfBoundsException - if the index is invalid
java.lang.IllegalArgumentException - if the group already exists and the replace parameter is false

removeAttributeGroups

AttributeDescriptorInterface[] removeAttributeGroups(java.lang.String[] groupNames)
Remove the subgroups corresponding to the group names in the input array, groupsNames.

Parameters:
groupNames - an array of AttributeGroup names to remove from this AttributeGroup
Returns:
array of AttributeDescriptors that were removed from the AttributeGroup and its subgroups
See Also:
removeAttributeGroup(String)

removeAttributeGroup

AttributeDescriptorInterface[] removeAttributeGroup(java.lang.String groupName)
Remove the subgroup corresponding to groupName.

Parameters:
groupName - the name of the AttributeGroup to remove
Returns:
array of AttributeDescriptors that were removed from the AttributeGroup and its subgroups

getAttributeGroup

AttributeGroupInterface getAttributeGroup(java.lang.String groupName)
Return the subgroup corresponding to groupName.

Parameters:
groupName - the name of the AttributeGroup
Returns:
the subgroup with the specified name

getAttributeDescriptor

AttributeDescriptorInterface getAttributeDescriptor(java.lang.String attributeName,
                                                    boolean recursive)
Return the AttributeDescriptor corresponding to attributeName.

Parameters:
attributeName - the name of the AttributeDescriptor
recursive - If true, will search all subgroups for the AttributeDescriptor
Returns:
the AttributeDescriptor with the specified name or null if not found



Copyright © 2009 SAS Institute Inc. All Rights Reserved.