|
||||||||||
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_MASKED
|
static boolean |
DEFAULT_IS_MODIFIABLE
|
static boolean |
DEFAULT_IS_REQUIRED
|
static PropertyDefinition.RestartType |
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,
boolean required)
Create a property definition object with the specified set of attributes. |
|
PropertyDefinitionImpl(java.lang.String name,
java.lang.String displayName,
PropertyType type,
boolean required)
Create a property definition object with the specified set of attributes. |
|
PropertyDefinitionImpl(java.lang.String name,
java.lang.String displayName,
PropertyType type,
boolean required,
java.lang.String shortDescription,
java.lang.Object defaultValue,
java.util.List allowedValues,
boolean isHidden,
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,
boolean required,
java.lang.String shortDescription,
java.lang.Object defaultValue,
java.util.List allowedValues,
boolean isHidden,
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. |
PropertyType |
getPropertyType()
Get the type for values of this property. |
PropertyDefinition.RestartType |
getRequiresRestart()
Get whether this property requires the system to be restarted before it takes effect. |
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 |
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 |
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 |
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 |
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 |
setPropertyType(PropertyType type)
Set the type for values of this property. |
void |
setRequired(boolean required)
|
void |
setRequiresRestart(PropertyDefinition.RestartType flag)
Set whether this property requires the system to be restarted before it takes effect. |
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_REQUIRED
public static final boolean DEFAULT_IS_EXPERT
public static final boolean DEFAULT_IS_MASKED
public static final boolean DEFAULT_IS_CONSTRAINED
public static final boolean DEFAULT_IS_MODIFIABLE
public static final PropertyDefinition.RestartType DEFAULT_REQUIRES_RESTART
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, boolean required)
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, boolean required)
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, boolean required, java.lang.String shortDescription, java.lang.Object defaultValue, java.util.List allowedValues, boolean isHidden, 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.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.isHidden
- true if this property definition is intended only for tool
use, and which should not be exposed to humans.isExpert
- true if this property definition is intended for expert users
an not for normal users.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, boolean required, java.lang.String shortDescription, java.lang.Object defaultValue, java.util.List allowedValues, boolean isHidden, boolean isExpert, boolean isModifiable)
public PropertyDefinitionImpl(PropertyDefinition defn)
defn
- the definition that is to be copied; may not be nullMethod Detail |
---|
public void setRequired(boolean required)
public PropertyDefinition.RestartType getRequiresRestart()
PropertyDefinition
getRequiresRestart
in interface PropertyDefinition
PropertyDefinition.getRequiresRestart()
public void setRequiresRestart(PropertyDefinition.RestartType flag)
public boolean isModifiable()
isModifiable
in interface PropertyDefinition
public void setModifiable(boolean flag)
public boolean isMasked()
isMasked
in interface PropertyDefinition
public void setMasked(boolean masked)
masked
- true if this property is to be masked,
or false otherwise.public boolean isExpert()
isExpert
in interface PropertyDefinition
public 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 PropertyDefinition
public 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 PropertyDefinition
hasDefaultValue()
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 PropertyDefinition
#hasAllowedValues
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 boolean hasDefaultValue()
hasDefaultValue
in interface PropertyDefinition
getDefaultValue()
public boolean isConstrainedToAllowedValues()
PropertyDefinition
isConstrainedToAllowedValues
in interface PropertyDefinition
#hasAllowedValues
,
PropertyDefinition.getAllowedValues()
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 PropertyDefinition
public java.lang.Object clone()
clone
in class ObjectDefinitionImpl
public 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 ObjectDefinition
compareTo
in interface java.lang.Comparable
compareTo
in class ObjectDefinitionImpl
obj
- 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 ObjectDefinition
equals
in class ObjectDefinitionImpl
obj
- the object that this instance is to be compared to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |