commonj.connector.metadata.discovery.properties
Interface PropertyGroup

All Superinterfaces:
Cloneable, PropertyDescriptor

public interface PropertyGroup
extends PropertyDescriptor, Cloneable

An interface that represents a group of properties. Properties may be logically grouped together for usability reasons. For example, when specifying connection properties to an EIS it is logical to group the user name and password properties together.

Property groups may also contain nested property groups.

Since:
1.0

Method Summary
 String convertToString()
          Returns a String representation of this PropertyGroup instance that must be treated without processing similar to XML CDATA.
 PropertyDescriptor[] getProperties()
          Returns the contents of the group.
 PropertyDescriptor getProperty(String propertyName)
          Returns the property or property group with the given name.
 void populateFromString(String value)
          Populates the PropertyGroup instance with the String argument.
 
Methods inherited from interface commonj.connector.metadata.discovery.properties.PropertyDescriptor
addPropertyChangeListener, clone, getDescription, getDisplayName, getID, getName, isEnabled, removePropertyChangeListener
 

Method Detail

getProperties

PropertyDescriptor[] getProperties()
Returns the contents of the group. The returned array can contain single properties, or be a nested group of further properties (as PropertyGroups). Hence the contents of the list is returned as a list of the base PropertyDescriptors. The caller should check the runtime type of the array elements to determine if they are Property or PropertyGroup instances.

Returns:
A non null array of properties. A property group should typically never be empty. However in cases where one becomes empty due to property removal, this method should return an empty array instead of null.

getProperty

PropertyDescriptor getProperty(String propertyName)
Returns the property or property group with the given name. Returns null if the property is not part of the group. This method only returns the direct contents of this property group. In other words, if this property group contains nested property groups and one desires to retrieve a property within a nested group, then this method can only be called to get the nested group. Additional calls are then made on the nested group instance to get its properties.

Parameters:
propertyName - - the non null name of the property to retrieve.
Returns:
PropertyDescriptor the requested property or null if the requested property is not part of the property group.

convertToString

String convertToString()
Returns a String representation of this PropertyGroup instance that must be treated without processing similar to XML CDATA.

Returns:
String value representing the serialized form of the PropertyGroup
Since:
1.1

populateFromString

void populateFromString(String value)
                        throws MetadataException
Populates the PropertyGroup instance with the String argument. This String argument must be in the same form as that returned from convertToString().

The provider must be able to support older versions of its String representation that were returned from convertToString.

Parameters:
value - - a String value representing the serialized form of the PropertyGroup
Throws:
MetadataException - - thrown if any error occurs in the population - the property group instance is in an unusable state
Since:
1.1