com.metamatrix.common.object
Interface PropertyDefinition

All Superinterfaces:
java.lang.Comparable, ObjectDefinition, PropertiedObject
All Known Implementing Classes:
ComponentTypePropDefn, PropertyDefinitionImpl

public interface PropertyDefinition
extends ObjectDefinition

Defines the type of property that will be placed in a detail panel or table


Method Summary
 java.util.List getAllowedValues()
          Get the allowed values for this property.
 java.lang.Object getDefaultValue()
          Get the default value for values of this property, or an empty String if there is no default value.
 Multiplicity getMultiplicity()
          Get the multiplicity specification for this property.
 PropertyType getPropertyType()
          Get the type for values of this property.
 boolean getRequiresRestart()
          Get whether this property requires the system to be restarted before it takes effect.
 java.lang.String getValueDelimiter()
          Return the text expression that is used to delimit multiple values within a single String value.
 java.lang.String getValuesAsString(java.lang.Object[] values)
          Convert the specified values to a stringified form.
 java.lang.String getValuesAsString(java.lang.Object[] values, java.lang.String delim)
          Convert the specified values to a stringified form.
 java.lang.Object[] getValuesFromString(java.lang.String stringifiedValues)
          Convert the stringified form to an array of String values.
 java.lang.Object[] getValuesFromString(java.lang.String stringifiedValues, java.lang.String delim)
          Convert the stringified form to an array of String values.
 boolean hasAllowedValues()
          Return whether there is a prescribed set of values that all property values should be selected from.
 boolean hasDefaultValue()
          Return whether there is a default value for this property.
 boolean isConstrainedToAllowedValues()
          Return whether the value or values for this property are constrained to be only those in the AllowedValues list.
 boolean isExpert()
          The "expert" flag is used to distinguish between features that are intended for expert users from those that are intended for normal users.
 boolean isHidden()
          The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.
 boolean isMasked()
          The "masked" flag is used to tell whether the value should be masked when displayed to users.
 boolean isModifiable()
          The modifiable flag is used to identify features that may not be changed once they are set.
 boolean isPreferred()
          The "preferred" flag is used to identify features that are particularly important for presenting to humans.
 boolean isRequired()
          The "required" flag is used to identify features that require at least one value (possibly a default value) by the consumer of the property.
 
Methods inherited from interface com.metamatrix.common.object.ObjectDefinition
compareTo, equals, getDisplayName, getName, getPluralDisplayName, getShortDescription, getShortDisplayName, toString
 

Method Detail

getPropertyType

PropertyType getPropertyType()
Get the type for values of this property.

Returns:
the type that best describes the values of this property.

getDefaultValue

java.lang.Object getDefaultValue()
Get the default value for values of this property, or an empty String if there is no default value.

Returns:
the default value for this property, or an empty String if there is no default value.
See Also:
hasDefaultValue()

getAllowedValues

java.util.List getAllowedValues()
Get the allowed values for this property.

Returns:
the unmodifiable list of allowed values for this property, or an empty set if the values do not have to conform to a fixed set.
See Also:
hasAllowedValues()

getRequiresRestart

boolean getRequiresRestart()
Get whether this property requires the system to be restarted before it takes effect.

Returns:
true if this property requires the system to be restarted before it takes effect.

isModifiable

boolean isModifiable()
The modifiable flag is used to identify features that may not be changed once they are set.

Returns:
true if this property is marked with the modifyable flag, or false otherwise.

isConstrainedToAllowedValues

boolean isConstrainedToAllowedValues()
Return whether the value or values for this property are constrained to be only those in the AllowedValues list.

Returns:
true if this property's value must be with the list of AllowedValues.
See Also:
hasAllowedValues(), getAllowedValues()

hasDefaultValue

boolean hasDefaultValue()
Return whether there is a default value for this property.

Returns:
true if this property has a default value or false if there is no default value.
See Also:
getDefaultValue()

hasAllowedValues

boolean hasAllowedValues()
Return whether there is a prescribed set of values that all property values should be selected from.

Returns:
true if this property has a set from which all values must be selected, or false if the property values may be any value.
See Also:
getAllowedValues()

getValueDelimiter

java.lang.String getValueDelimiter()
Return the text expression that is used to delimit multiple values within a single String value.

Returns:
the delimiter String; may be null only if the multiplicity has a maximum value of 1.

isExpert

boolean isExpert()
The "expert" flag is used to distinguish between features that are intended for expert users from those that are intended for normal users.

Returns:
true if this property is to be marked with the expert flag, or false otherwise.

isPreferred

boolean isPreferred()
The "preferred" flag is used to identify features that are particularly important for presenting to humans.

Returns:
true if this property is marked with the preferred flag, or false otherwise.

isHidden

boolean isHidden()
The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans.

Returns:
true if this property is marked with the hidden flag, or false otherwise.

isRequired

boolean isRequired()
The "required" flag is used to identify features that require at least one value (possibly a default value) by the consumer of the property. Whether a property definition is required or not can be determined entirely from the multiplicity: if the multiplicity includes '0', then the property is not required.

Whether a property is required by the consumer is unrelated to whether there is a default value, which only simplifies the task of the property provider. A property may be required, meaning it must have at least one value, but that same property definition may or may not have a default. The combination of required and whether it has a default will determine whether the user must supply a value.

Returns:
true if this property requires at least one value.

isMasked

boolean isMasked()
The "masked" flag is used to tell whether the value should be masked when displayed to users.

Returns:
true if this property value is to be masked, or false otherwise.

getMultiplicity

Multiplicity getMultiplicity()
Get the multiplicity specification for this property.

Returns:
the instance of Multiplicity that captures the allowable range of the cardinality of property values; never null

getValuesAsString

java.lang.String getValuesAsString(java.lang.Object[] values)
Convert the specified values to a stringified form. This method uses the toString method on the values.

Parameters:
values - the array of values that this definition describes; may not be null
Returns:
the stringified form of the values; never null

getValuesAsString

java.lang.String getValuesAsString(java.lang.Object[] values,
                                   java.lang.String delim)
Convert the specified values to a stringified form. This method uses the toString method on the values.

Parameters:
values - the array of values that this definition describes; may not be null
delim - the delimiter to use, overriding the property definition's set of values; if null, the property definition's delimiter will be used, or if there is no delimiter defined for the property definition, the default delimiter of ','
Returns:
the stringified form of the values; never null

getValuesFromString

java.lang.Object[] getValuesFromString(java.lang.String stringifiedValues)
Convert the stringified form to an array of String values.

Parameters:
stringifiedValue - the stringified form of the values
Returns:
the array of String values; never null, but may by empty

getValuesFromString

java.lang.Object[] getValuesFromString(java.lang.String stringifiedValues,
                                       java.lang.String delim)
Convert the stringified form to an array of String values.

Parameters:
stringifiedValue - the stringified form of the values
delim - the delimiter to use, overriding the property definition's set of values; if null, the property definition's delimiter will be used, or if there is no delimiter defined for the property definition, the default delimiter of ','
Returns:
the array of String values; never null, but may by empty


Copyright © 2009. All Rights Reserved.