|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.common.object.ObjectDefinitionImpl
com.metamatrix.common.object.PropertyDefinitionImpl
public class PropertyDefinitionImpl
Prototype implementation of PropertyDefinition
| Field Summary | |
|---|---|
static java.util.List |
BOOLEAN_ALLOWED_VALUES
|
static java.lang.String |
DEFAULT_DEFAULT_VALUE
|
static java.lang.String |
DEFAULT_DELIMITER
|
static java.lang.String |
DEFAULT_DISPLAY_NAME
|
static boolean |
DEFAULT_IS_CONSTRAINED
|
static boolean |
DEFAULT_IS_EXPERT
|
static boolean |
DEFAULT_IS_HIDDEN
|
static boolean |
DEFAULT_IS_MASKED
|
static boolean |
DEFAULT_IS_MODIFIABLE
|
static boolean |
DEFAULT_IS_PREFERRED
|
static java.lang.String |
DEFAULT_MULTIPLICITY
|
static boolean |
DEFAULT_REQUIRES_RESTART
|
static java.lang.String |
DEFAULT_SHORT_DESCRIPTION
|
static PropertyType |
DEFAULT_TYPE
|
static java.lang.Object |
DEFAULT_VALUE
|
| Constructor Summary | |
|---|---|
PropertyDefinitionImpl()
Create an empty property definition object with all defaults. |
|
PropertyDefinitionImpl(PropertyDefinition defn)
Create a property definition object that is a copy of the specified property definition. |
|
PropertyDefinitionImpl(java.lang.String name,
PropertyType type,
Multiplicity multiplicity)
Create a property definition object with the specified set of attributes. |
|
PropertyDefinitionImpl(java.lang.String name,
java.lang.String displayName,
PropertyType type,
Multiplicity multiplicity)
Create a property definition object with the specified set of attributes. |
|
PropertyDefinitionImpl(java.lang.String name,
java.lang.String displayName,
PropertyType type,
Multiplicity multiplicity,
java.lang.String shortDescription,
java.lang.Object defaultValue,
java.util.List allowedValues,
java.lang.String valueDelimiter,
boolean isHidden,
boolean isPreferred,
boolean isExpert)
Create a property definition object with the fully-specified set of attributes. |
|
PropertyDefinitionImpl(java.lang.String name,
java.lang.String displayName,
PropertyType type,
Multiplicity multiplicity,
java.lang.String shortDescription,
java.lang.Object defaultValue,
java.util.List allowedValues,
java.lang.String valueDelimiter,
boolean isHidden,
boolean isPreferred,
boolean isExpert,
boolean isModifiable)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object obj)
Compares this object to another. |
boolean |
equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this instance. |
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. |
void |
setAllowedValues(java.util.List allowedValues)
Set the list of allowed values for this property. |
void |
setConstrainedToAllowedValues(boolean flag)
|
void |
setDefaultValue(java.lang.Object defaultValue)
Set the default value fo values of this property. |
void |
setExpert(boolean expert)
The "expert" flag is used to distinguish between features that are intended for expert users from those that are intended for normal users. |
void |
setHidden(boolean hidden)
The "hidden" flag is used to identify features that are intended only for tool use, and which should not be exposed to humans. |
void |
setMasked(boolean masked)
The "masked" flag is used to tell whether the value should be masked when displayed to users. |
void |
setModifiable(boolean flag)
|
void |
setMultiplicity(Multiplicity multiplicity)
Set the multiplicity specification for this property. |
void |
setPreferred(boolean preferred)
The "preferred" flag is used to identify features that are particularly important for presenting to humans. |
void |
setPropertyType(PropertyType type)
Set the type for values of this property. |
void |
setRequiresRestart(boolean flag)
Set whether this property requires the system to be restarted before it takes effect. |
void |
setValueDelimiter(java.lang.String delim)
Set the text expression that is used to delimit multiple values within a single String value. |
| Methods inherited from class com.metamatrix.common.object.ObjectDefinitionImpl |
|---|
computeDisplayName, computePluralDisplayName, getDisplayName, getName, getPluralDisplayName, getShortDescription, getShortDisplayName, hashCode, setDisplayName, setName, setPluralDisplayName, setShortDescription, setShortDisplayName, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.metamatrix.common.object.ObjectDefinition |
|---|
getDisplayName, getName, getPluralDisplayName, getShortDescription, getShortDisplayName, toString |
| Field Detail |
|---|
public static final java.util.List BOOLEAN_ALLOWED_VALUES
public static final PropertyType DEFAULT_TYPE
public static final java.lang.String DEFAULT_DELIMITER
public static final java.lang.Object DEFAULT_VALUE
public static final boolean DEFAULT_IS_EXPERT
public static final boolean DEFAULT_IS_PREFERRED
public static final boolean DEFAULT_IS_HIDDEN
public static final boolean DEFAULT_IS_MASKED
public static final boolean DEFAULT_IS_CONSTRAINED
public static final boolean DEFAULT_IS_MODIFIABLE
public static final boolean DEFAULT_REQUIRES_RESTART
public static final java.lang.String DEFAULT_MULTIPLICITY
public static final java.lang.String DEFAULT_DEFAULT_VALUE
public static final java.lang.String DEFAULT_DISPLAY_NAME
public static final java.lang.String DEFAULT_SHORT_DESCRIPTION
| Constructor Detail |
|---|
public PropertyDefinitionImpl()
public PropertyDefinitionImpl(java.lang.String name,
PropertyType type,
Multiplicity multiplicity)
name - the new property name; or null if there is no name for this
property definitiontype - the new property type; if null, the default type
(PropertyType.STRING) is used.multiplicity - the instance of Multiplicity that captures the allowable
range of the cardinality of property values; if null, the default
multiplicity of "1" is used.
public PropertyDefinitionImpl(java.lang.String name,
java.lang.String displayName,
PropertyType type,
Multiplicity multiplicity)
name - the new property name; or null if there is no name for this
property definitiondisplayName - the displayable name for this property; or null
if the display name is the same as the property name.type - the new property type; if null, the default type
(PropertyType.STRING) is used.multiplicity - the instance of Multiplicity that captures the allowable
range of the cardinality of property values; if null, the default
multiplicity of "1" is used.
public PropertyDefinitionImpl(java.lang.String name,
java.lang.String displayName,
PropertyType type,
Multiplicity multiplicity,
java.lang.String shortDescription,
java.lang.Object defaultValue,
java.util.List allowedValues,
java.lang.String valueDelimiter,
boolean isHidden,
boolean isPreferred,
boolean isExpert)
name - the new property name; or null if there is no name for this
property definitiondisplayName - the displayable name for this property; or null
if the display name is the same as the property name.type - the new property type; if null, the default type
(PropertyType.STRING) is used.multiplicity - the instance of Multiplicity that captures the allowable
range of the cardinality of property values; if null, the default
multiplicity of "1" is used.shortDescription - the short description for this property, or
null if there is no short description.defaultValue - the new default value for this property, or null
if there is to be no default value.allowedValues - the list of allowable values for this property,
or an empty set or null reference if there is no prescribed set of values.valueDelimiter - the delimiter String; may be null only if the multiplicity
has a maximum value of 1. The default delimiter expression is a
single comma.isHidden - true if this property definition is intended only for tool
use, and which should not be exposed to humans.isPreferred - true if this property definition is particularly important
for presenting to humans.isExpert - true if this property definition is intended for expert users
an not for normal users.
public PropertyDefinitionImpl(java.lang.String name,
java.lang.String displayName,
PropertyType type,
Multiplicity multiplicity,
java.lang.String shortDescription,
java.lang.Object defaultValue,
java.util.List allowedValues,
java.lang.String valueDelimiter,
boolean isHidden,
boolean isPreferred,
boolean isExpert,
boolean isModifiable)
public PropertyDefinitionImpl(PropertyDefinition defn)
defn - the definition that is to be copied; may not be null| Method Detail |
|---|
public boolean getRequiresRestart()
PropertyDefinition
getRequiresRestart in interface PropertyDefinitionPropertyDefinition.getRequiresRestart()public void setRequiresRestart(boolean flag)
public boolean isModifiable()
isModifiable in interface PropertyDefinitionpublic void setModifiable(boolean flag)
public boolean isConstrainedToAllowedValues()
isConstrainedToAllowedValues in interface PropertyDefinitionhasAllowedValues(),
getAllowedValues()public void setConstrainedToAllowedValues(boolean flag)
public boolean isHidden()
isHidden in interface PropertyDefinitionpublic void setHidden(boolean hidden)
hidden - true if this property is to be marked with the hidden flag,
or false otherwise.public boolean isPreferred()
isPreferred in interface PropertyDefinitionpublic void setPreferred(boolean preferred)
preferred - true if this property is to be marked with the preferred
flag, or false otherwise.public boolean isMasked()
isMasked in interface PropertyDefinitionpublic void setMasked(boolean masked)
masked - true if this property is to be masked,
or false otherwise.public boolean isExpert()
isExpert in interface PropertyDefinitionpublic void setExpert(boolean expert)
expert - true if this property is to be marked with the expert flag,
or false otherwise.public PropertyType getPropertyType()
getPropertyType in interface PropertyDefinitionpublic void setPropertyType(PropertyType type)
type - the new property type; if null, the default type
(PropertyType.STRING) is used.public java.lang.Object getDefaultValue()
getDefaultValue in interface PropertyDefinitionhasDefaultValue()public void setDefaultValue(java.lang.Object defaultValue)
defaultValue - the new default value for this property, or null
if there is to be no default value.public java.util.List getAllowedValues()
getAllowedValues in interface PropertyDefinitionhasAllowedValues()public void setAllowedValues(java.util.List allowedValues)
allowedValues - the new list of allowable values for this property,
or an empty set or null reference if there is no prescribed set of values.public java.lang.String getValueDelimiter()
getValueDelimiter in interface PropertyDefinitionpublic void setValueDelimiter(java.lang.String delim)
delim - the delimiter String; may be null only if the multiplicity
has a maximum value of 1. The default delimiter expression is a
single comma.public boolean hasDefaultValue()
hasDefaultValue in interface PropertyDefinitiongetDefaultValue()public boolean hasAllowedValues()
hasAllowedValues in interface PropertyDefinitiongetAllowedValues()public Multiplicity getMultiplicity()
getMultiplicity in interface PropertyDefinitionpublic void setMultiplicity(Multiplicity multiplicity)
multiplicity - the instance of Multiplicity that captures the allowable
range of the cardinality of property values; if null, the default
multiplicity of "1" is used.public boolean isRequired()
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.
isRequired in interface PropertyDefinitionpublic java.lang.Object clone()
clone in class ObjectDefinitionImplpublic int compareTo(java.lang.Object obj)
Note: this method is consistent with
equals(), meaning that
(compare(x, y)==0) == (x.equals(y)).
compareTo in interface ObjectDefinitioncompareTo in interface java.lang.ComparablecompareTo in class ObjectDefinitionImplobj - the object that this instance is to be compared to.
java.lang.IllegalArgumentException - if the specified object reference is null
java.lang.ClassCastException - if the specified object's type prevents it
from being compared to this instance.public boolean equals(java.lang.Object obj)
compareTo().
equals in interface ObjectDefinitionequals in class ObjectDefinitionImplobj - the object that this instance is to be compared to.
public java.lang.String getValuesAsString(java.lang.Object[] values)
toString method on the values.
getValuesAsString in interface PropertyDefinitionvalues - the array of values that this definition describes; may not be null
public java.lang.String getValuesAsString(java.lang.Object[] values,
java.lang.String delim)
toString method on the values.
getValuesAsString in interface PropertyDefinitionvalues - the array of values that this definition describes; may not be nulldelim - 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 ','
public java.lang.Object[] getValuesFromString(java.lang.String stringifiedValues)
getValuesFromString in interface PropertyDefinitionstringifiedValue - the stringified form of the values
public java.lang.Object[] getValuesFromString(java.lang.String stringifiedValues,
java.lang.String delim)
getValuesFromString in interface PropertyDefinitionstringifiedValue - the stringified form of the valuesdelim - 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 ','
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||