com.metamatrix.common.config.api
Class ComponentTypePropDefn

java.lang.Object
  extended by com.metamatrix.common.config.api.ComponentTypePropDefn
All Implemented Interfaces:
ObjectDefinition, PropertiedObject, PropertyDefinition, java.io.Serializable, java.lang.Comparable

public class ComponentTypePropDefn
extends java.lang.Object
implements PropertyDefinition, java.io.Serializable

ComponentTypePropDefn is an unmodifiable wrapper for the PropertyDefinition. Notice that this contains an origPropertyDefinition from which it returns values. This is done so that an instance of this class can be instantiated and passed a PropertyDefinition.

See Also:
Serialized Form

Constructor Summary
ComponentTypePropDefn()
           
ComponentTypePropDefn(PropertyDefinition definition)
           
ComponentTypePropDefn(java.lang.String name, java.lang.String displayName, PropertyType type, boolean required)
           
ComponentTypePropDefn(java.lang.String name, java.lang.String displayName, PropertyType type, boolean required, java.lang.String shortDescription, java.lang.String defaultValue, java.util.List allowedValues, java.lang.String valueDelimiter, boolean isHidden, boolean isPreferred, boolean isExpert, boolean isModifiable)
           
 
Method Summary
 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.
 java.lang.String getDisplayName()
          Get the localized display name of this property.
 java.lang.String getName()
          Get the actual or programmatic name of this property.
 java.lang.String getPluralDisplayName()
          Get the localized display name of this property.
 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.
 java.lang.String getShortDescription()
          Get the short description of this property.
 java.lang.String getShortDisplayName()
          Get the localized display name of this property.
 boolean hasDefaultValue()
          Return whether there is a default value for this property.
 int hashCode()
          Returns the hash code value for this object.
 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.
 java.lang.String toString()
          Returns a string representing the current state of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentTypePropDefn

public ComponentTypePropDefn()

ComponentTypePropDefn

public ComponentTypePropDefn(PropertyDefinition definition)

ComponentTypePropDefn

public ComponentTypePropDefn(java.lang.String name,
                             java.lang.String displayName,
                             PropertyType type,
                             boolean required,
                             java.lang.String shortDescription,
                             java.lang.String defaultValue,
                             java.util.List allowedValues,
                             java.lang.String valueDelimiter,
                             boolean isHidden,
                             boolean isPreferred,
                             boolean isExpert,
                             boolean isModifiable)

ComponentTypePropDefn

public ComponentTypePropDefn(java.lang.String name,
                             java.lang.String displayName,
                             PropertyType type,
                             boolean required)
Method Detail

getName

public java.lang.String getName()
Get the actual or programmatic name of this property.

Specified by:
getName in interface ObjectDefinition
Returns:
the property's name (never null)

getDisplayName

public java.lang.String getDisplayName()
Get the localized display name of this property.

Specified by:
getDisplayName in interface ObjectDefinition
Returns:
the displayable name for this property (never null)

getShortDescription

public java.lang.String getShortDescription()
Get the short description of this property.

Specified by:
getShortDescription in interface ObjectDefinition
Returns:
the short description for this property (never null)

isRequired

public 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.

Specified by:
isRequired in interface PropertyDefinition
Returns:
true if this property requires at least one value.

getRequiresRestart

public PropertyDefinition.RestartType getRequiresRestart()
Description copied from interface: PropertyDefinition
Get whether this property requires the system to be restarted before it takes effect.

Specified by:
getRequiresRestart in interface PropertyDefinition
Returns:
true if this property requires the system to be restarted before it takes effect.
Since:
4.3
See Also:
PropertyDefinition.getRequiresRestart()

isMasked

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

Specified by:
isMasked in interface PropertyDefinition
Returns:
true if this property value is to be masked, or false otherwise.

isModifiable

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

Specified by:
isModifiable in interface PropertyDefinition
Returns:
true if this property is marked with the modifyable flag, or false otherwise.

isExpert

public 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.

Specified by:
isExpert in interface PropertyDefinition
Returns:
true if this property is to be marked with the expert flag, or false otherwise.

getPropertyType

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

Specified by:
getPropertyType in interface PropertyDefinition
Returns:
the type that best describes the values of this property.

getDefaultValue

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

Specified by:
getDefaultValue in interface PropertyDefinition
Returns:
the default value for this property, or null if there is no default value.
See Also:
hasDefaultValue()

getAllowedValues

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

Specified by:
getAllowedValues in interface PropertyDefinition
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

hasDefaultValue

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

Specified by:
hasDefaultValue in interface PropertyDefinition
Returns:
true if this property has a default value or false if there is no default value.
See Also:
getDefaultValue()

isConstrainedToAllowedValues

public boolean isConstrainedToAllowedValues()
Description copied from interface: PropertyDefinition
Return whether the value or values for this property are constrained to be only those in the AllowedValues list.

Specified by:
isConstrainedToAllowedValues in interface PropertyDefinition
Returns:
true if this property's value must be with the list of AllowedValues.
See Also:
#hasAllowedValues, PropertyDefinition.getAllowedValues()

getShortDisplayName

public java.lang.String getShortDisplayName()
Get the localized display name of this property.

Specified by:
getShortDisplayName in interface ObjectDefinition
Returns:
the displayable name for this property (never null)

getPluralDisplayName

public java.lang.String getPluralDisplayName()
Get the localized display name of this property.

Specified by:
getPluralDisplayName in interface ObjectDefinition
Returns:
the displayable name for this property (never null)

compareTo

public int compareTo(java.lang.Object obj)
Compares this object to another. If the specified object is an instance of the MetaMatrixSessionID class, then this method compares the contents; otherwise, it throws a ClassCastException (as instances are comparable only to instances of the same class).

Note: this method is consistent with equals(), meaning that (compare(x, y)==0) == (x.equals(y)).

Specified by:
compareTo in interface ObjectDefinition
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - the object that this instance is to be compared to.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object, respectively.
Throws:
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.

equals

public boolean equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this instance. Note: this method is consistent with compareTo().

Specified by:
equals in interface ObjectDefinition
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object that this instance is to be compared to.
Returns:
whether the object is equal to this object.

hashCode

public int hashCode()
Returns the hash code value for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object.

toString

public java.lang.String toString()
Returns a string representing the current state of the object.

Specified by:
toString in interface ObjectDefinition
Overrides:
toString in class java.lang.Object
Returns:
the string representation of this instance.


Copyright © 2009. All Rights Reserved.