org.norther.tammi.core.rt
Class VariableAttributeInfo

java.lang.Object
  extended by javax.management.MBeanFeatureInfo
      extended by javax.management.MBeanAttributeInfo
          extended by org.norther.tammi.core.rt.VariableAttributeInfo
All Implemented Interfaces:
Serializable, Cloneable

public class VariableAttributeInfo
extends MBeanAttributeInfo

A meta-data description of a variable attribute.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.management.MBeanFeatureInfo
description, name
 
Constructor Summary
VariableAttributeInfo(Object value, MBeanAttributeInfo info, MBeanReference owner)
          Constructs an attribute description from MBeanAttributeInfo for the specified MBean.
VariableAttributeInfo(Object value, MBeanConstructorInfo info, MBeanReference owner)
          Constructs an attribute description from MBeanConstructorInfo for the specified MBean.
VariableAttributeInfo(Object value, MBeanFeatureInfo info, MBeanReference owner)
          Constructs an attribute description from MBeanFeatureInfo for the specified MBean.
VariableAttributeInfo(Object value, MBeanOperationInfo info, MBeanReference owner)
          Constructs an attribute description from MBeanOperationInfo for the specified MBean.
VariableAttributeInfo(Object value, MBeanParameterInfo info, MBeanReference owner)
          Constructs an attribute description from MBeanParameterInfo for the specified MBean.
VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized)
          Constructs an attribute description.
VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized, List list)
          Constructs an attribute description with a limited set of allowed values.
VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized, Object minValue, Object maxValue)
          Constructs an attribute description with a value range.
VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized, String pattern)
          Constructs an attribute description with a pattern.
VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized, String pattern, List list)
          Constructs an attribute description with a limited set of allowed values and a conversion pattern.
VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized, String pattern, Object minValue, Object maxValue)
          Constructs an attribute description with a pattern and value range.
VariableAttributeInfo(String attr, String type, String descr)
          Constructs a non-initialized attribute description.
VariableAttributeInfo(String attr, String type, String descr, MBeanReference owner)
          Constructs a non-initialized attribute description for the specified MBean.
 
Method Summary
 Object clone()
          Clones this object.
 boolean equals(Object obj)
          Checks equality of this object.
 Comparator getComparator()
          Gets the comparator of this attribute.
 String getDetail()
          Gets the detail of this attribute.
 EnumeratedList getEnumeration()
          Gets an enumeration of allowed attribute values.
 String getGroup()
          Gets the group of this attribute.
 Object getInitialValue()
          Gets the initial value of this attribute.
 Object getMaxValue()
          Gets the maximum value of this attribute.
 Object getMinValue()
          Gets the minimum value of this attribute.
 int getOptions()
          Gets permanent options of this attribute.
 ObjectName getOwnerName()
          Gets the name of the owner of this attribute.
 String getPattern()
          Gets the value pattern of this attribute.
 String getShadow()
          Gets the shadow pattern of this attribute.
 int hashCode()
           
 boolean isArray()
          Checks whether this attribute is an array.
 boolean isBlankAccepted()
          Gets the blank accepted flag of this attribute.
 boolean isCloneable()
          Gets the cloneable flag of this attribute.
 boolean isCollection()
          Gets the collection flag of this attribute.
 boolean isCorrelative()
          Gets the correlative flag of this attribute.
 boolean isDisabled()
          Gets the disabled flag of this attribute.
 boolean isEmptyAccepted()
          Gets the empty accepted flag of this attribute.
 boolean isEnumerated()
          Checks whether this attribute is enumerated.
 boolean isInitialized()
          Checks whether this attribute is initialized.
 boolean isInteractive()
          Gets the interactive flag of this attribute.
 boolean isLocal()
          Gets the local flag of this attribute.
 boolean isLocalized()
          Gets the localized flag of this attribute.
 boolean isLocked()
          Gets the locked flag of this attribute.
 boolean isMandatory()
          Gets the mandatory flag of this attribute.
 boolean isOrdered()
          Gets the ordered flag of this attribute.
 boolean isPrimary()
          Gets the primary flag of this attribute.
 boolean isPrimitive()
          Checks whether this attribute is primitive.
 boolean isReadable()
          Gets the readable flag of this attribute.
 boolean isReference()
          Gets the reference flag of this attribute.
 boolean isSerialized()
          Gets the serialized flag of this attribute.
 boolean isSorted()
          Gets the sorted flag of this attribute.
 boolean isTraceable()
          Gets the traceable flag of this attribute.
 boolean isTransient()
          Gets the transient flag of this attribute.
 boolean isTrimmed()
          Gets the trimmed flag of this attribute.
 boolean isVisible()
          Gets the visible flag of this attribute.
 boolean isWritable()
          Gets the writable flag of this attribute.
 void resetCloneAccess()
          Resets all temporary masks to their original values.
 void resetReadAccess()
          Resets readable and serializable masks to their original values.
 void resetWriteAccess()
          Resets writable, mandatory and transient masks to their original values.
 void setBlankAccepted(boolean flag)
          Sets the blank accepted flag of this attribute.
 void setCloneable(boolean flag)
          Sets the cloneable flag of this attribute.
 void setCollection(boolean flag)
          Sets the collection flag of this attribute.
 void setComparator(Comparator comp)
          Sets the comparator of this attribute.
 void setCorrelative(boolean flag)
          Sets the correlative flag of this attribute.
 void setDescription(String descr)
          Sets the description of this attribute.
 void setDetail(String spec)
          Sets the detail of this attribute.
 void setDisabled(boolean flag)
          Sets the disabled flag of this attribute.
 void setEmptyAccepted(boolean flag)
          Sets the empty accepted flag of this attribute.
 void setEnumeration(List list)
          Sets the enumeration of allowed attribute values.
 void setGroup(String grp)
          Sets the group of this attribute.
 void setInitialValue(Object value)
          Sets the initial attribute value after validation.
 void setInteractive(boolean flag)
          Sets the interactive flag of this attribute.
 void setLocal(boolean flag)
          Sets the local flag of this attribute.
 void setLocalized(boolean flag)
          Sets the localized flag of this attribute.
 void setLocked(boolean flag)
          Sets the locked flag of this attribute.
 void setMandatory(boolean flag)
          Sets the mandatory flag of this attribute.
 void setMaxValue(Object max)
          Sets the maximum value of this attribute.
 void setMinValue(Object min)
          Sets the minimum value of this attribute.
 void setOptions(int mask)
          Sets permanent options of this attribute.
 void setOrdered(boolean flag)
          Sets the ordered flag of this attribute.
 void setPattern(String pattern)
          Sets the value pattern of this attribute.
 void setPrimary(boolean flag)
          Sets the primary flag of this attribute.
 void setReadable(boolean flag)
          Sets the readable flag of this attribute.
 void setReference(boolean flag)
          Sets the reference flag of this attribute.
 void setSerialized(boolean flag)
          Sets the serialized flag of this attribute.
 void setShadow(String pattern)
          Sets the shadow pattern of this attribute.
 void setSorted(boolean flag)
          Sets the sorted flag of this attribute.
 void setTraceable(boolean flag)
          Sets the traceable flag of this attribute.
 void setTransient(boolean flag)
          Sets the transient flag of this attribute.
 void setTrimmed(boolean flag)
          Sets the trimmed flag of this attribute.
 void setVisible(boolean flag)
          Sets the visible flag of this attribute.
 void setWritable(boolean flag)
          Sets the writable flag of this attribute.
 String toShadow()
          Converts this attribute to a shadow.
 String[] toShadows()
          Converts the this attribute to a shadows.
 String toString()
          Converts the initial attribute value to a string.
 String toString(Object value)
          Converts the specified attribute value to a string.
 String[] toStrings(Object value)
          Converts the specified attribute value to a string array.
 Object validateValue(Object value)
          Validates an attribute value.
 
Methods inherited from class javax.management.MBeanAttributeInfo
getType, isIs
 
Methods inherited from class javax.management.MBeanFeatureInfo
getDescription, getName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableAttributeInfo

public VariableAttributeInfo(String attr,
                             String type,
                             String descr)
Constructs a non-initialized attribute description.

Parameters:
attr - the name of the attribute.
type - the type or class name of the attribute.
descr - a human readable description of the attribute.

VariableAttributeInfo

public VariableAttributeInfo(String attr,
                             String type,
                             String descr,
                             MBeanReference owner)
Constructs a non-initialized attribute description for the specified MBean.

Parameters:
attr - the name of the attribute.
type - the type or class name of the attribute.
descr - a human readable description of the attribute.
owner - the optional owner of the attribute.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             String attr,
                             String type,
                             String descr,
                             String grp,
                             String spec,
                             boolean readable,
                             boolean writable,
                             boolean mandatory,
                             boolean localized)
Constructs an attribute description.

Parameters:
value - the initial value of the attribute as an object.
attr - the name of the attribute.
type - the type or class name of the attribute.
descr - a human readable description of the attribute.
grp - an optional group of the attribute.
spec - an optional detail of the attribute.
readable - true if the attribute has a getter method, false otherwise.
writable - true if the attribute has a setter method, false otherwise.
mandatory - true if the attribute is mandatory, false otherwise.
localized - true if the attribute value can be localized, false otherwise.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             String attr,
                             String type,
                             String descr,
                             String grp,
                             String spec,
                             boolean readable,
                             boolean writable,
                             boolean mandatory,
                             boolean localized,
                             String pattern)
Constructs an attribute description with a pattern.

Parameters:
value - the initial value of the attribute.
attr - the name of the attribute.
type - the type or class name of the attribute.
descr - a human readable description of the attribute.
grp - an optional group of the attribute.
spec - an optional detail of the attribute.
readable - true if the attribute has a getter method, false otherwise.
writable - true if the attribute has a setter method, false otherwise.
mandatory - true if the attribute is mandatory, false otherwise.
localized - true if the attribute value can be localized, false otherwise.
pattern - an optional conversion pattern.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             String attr,
                             String type,
                             String descr,
                             String grp,
                             String spec,
                             boolean readable,
                             boolean writable,
                             boolean mandatory,
                             boolean localized,
                             Object minValue,
                             Object maxValue)
Constructs an attribute description with a value range.

Parameters:
value - the initial value of the attribute.
attr - the name of the attribute.
type - the type or class name of the attribute.
descr - a human readable description of the attribute.
grp - an optional group of the attribute.
spec - an optional detail of the attribute.
readable - true if the attribute has a getter method, false otherwise.
writable - true if the attribute has a setter method, false otherwise.
mandatory - true if the attribute is mandatory, false otherwise.
localized - true if the attribute value can be localized, false otherwise.
minValue - an optional minimum value or length of the attribute.
maxValue - an optional maximum value or length of the attribute.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             String attr,
                             String type,
                             String descr,
                             String grp,
                             String spec,
                             boolean readable,
                             boolean writable,
                             boolean mandatory,
                             boolean localized,
                             String pattern,
                             Object minValue,
                             Object maxValue)
Constructs an attribute description with a pattern and value range.

Parameters:
value - the initial value of the attribute.
attr - the name of the attribute.
type - the type or class name of the attribute.
descr - a human readable description of the attribute.
grp - an optional group of the attribute.
spec - an optional detail of the attribute.
readable - true if the attribute has a getter method, false otherwise.
writable - true if the attribute has a setter method, false otherwise.
mandatory - true if the attribute is mandatory, false otherwise.
localized - true if the attribute value can be localized, false otherwise.
pattern - an optional conversion pattern.
minValue - an optional minimum value or length of the attribute.
maxValue - an optional maximum value or length of the attribute.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             String attr,
                             String type,
                             String descr,
                             String grp,
                             String spec,
                             boolean readable,
                             boolean writable,
                             boolean mandatory,
                             boolean localized,
                             List list)
Constructs an attribute description with a limited set of allowed values.

Parameters:
value - the initial value of the attribute.
attr - the name of the attribute.
type - the type or class name of the attribute.
descr - a human readable description of the attribute.
grp - an optional group of the attribute.
spec - an optional detail of the attribute.
readable - true if the attribute has a getter method, false otherwise.
writable - true if the attribute has a setter method, false otherwise.
mandatory - true if this attribute is mandatory, false otherwise.
localized - true if the attribute value can be localized, false otherwise.
list - a list of allowed values of the attribute.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             String attr,
                             String type,
                             String descr,
                             String grp,
                             String spec,
                             boolean readable,
                             boolean writable,
                             boolean mandatory,
                             boolean localized,
                             String pattern,
                             List list)
Constructs an attribute description with a limited set of allowed values and a conversion pattern.

Parameters:
value - the initial value of the attribute.
attr - the name of the attribute.
type - the type or class name of the attribute.
descr - a human readable description of the attribute.
grp - an optional group of the attribute.
spec - an optional detail of the attribute.
readable - true if the attribute has a getter method, false otherwise.
writable - true if the attribute has a setter method, false otherwise.
mandatory - true if this attribute is mandatory, false otherwise.
localized - true if the attribute value can be localized, false otherwise.
pattern - an optional conversion pattern.
list - a list of allowed values of the attribute.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             MBeanAttributeInfo info,
                             MBeanReference owner)
Constructs an attribute description from MBeanAttributeInfo for the specified MBean.

Parameters:
value - the initial value of the attribute.
info - the feature info to apply.
owner - the optional owner of the attribute.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             MBeanOperationInfo info,
                             MBeanReference owner)
Constructs an attribute description from MBeanOperationInfo for the specified MBean.

Parameters:
value - the initial value of the attribute.
info - the feature info to apply.
owner - the optional owner of the attribute.
Throws:
NullPointerException - for missing arguments.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             MBeanConstructorInfo info,
                             MBeanReference owner)
Constructs an attribute description from MBeanConstructorInfo for the specified MBean.

Parameters:
value - the initial value of the attribute.
info - the feature info to apply.
owner - the optional owner of the attribute.
Throws:
NullPointerException - for missing arguments.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             MBeanParameterInfo info,
                             MBeanReference owner)
Constructs an attribute description from MBeanParameterInfo for the specified MBean.

Parameters:
value - the initial value of the attribute.
info - the feature info to apply.
owner - the optional owner of the attribute.
Throws:
NullPointerException - for missing arguments.

VariableAttributeInfo

public VariableAttributeInfo(Object value,
                             MBeanFeatureInfo info,
                             MBeanReference owner)
Constructs an attribute description from MBeanFeatureInfo for the specified MBean.

Parameters:
value - the initial value of the attribute.
info - the feature info to apply.
owner - the optional owner of the attribute.
Throws:
NullPointerException - for missing arguments.
Method Detail

clone

public Object clone()
Clones this object.

Overrides:
clone in class MBeanAttributeInfo
Returns:
the cloned object.

equals

public boolean equals(Object obj)
Checks equality of this object. Note that the attribute owner is not included in the comparison.

Overrides:
equals in class MBeanAttributeInfo
Parameters:
obj - the object with which to compare.
Returns:
true for the same object, otherwise false.

hashCode

public int hashCode()
Overrides:
hashCode in class MBeanAttributeInfo

isLocked

public boolean isLocked()
Gets the locked flag of this attribute.

Returns:
true for a locked attribute.

setLocked

public void setLocked(boolean flag)
Sets the locked flag of this attribute.

Note that a locked attribute can only be unlocked by cloning.

Parameters:
flag - true for a locked attribute.

isVisible

public boolean isVisible()
Gets the visible flag of this attribute.

Returns:
true for a visible attribute.

setVisible

public void setVisible(boolean flag)
Sets the visible flag of this attribute.

Parameters:
flag - true for a visible attribute, otherwise false.

isReadable

public boolean isReadable()
Gets the readable flag of this attribute.

Overrides:
isReadable in class MBeanAttributeInfo
Returns:
true for a readable attribute, otherwise false.

setReadable

public void setReadable(boolean flag)
Sets the readable flag of this attribute. Once set to false, the true flag is valid only until the next read operation.

Parameters:
flag - true for a readable attribute, otherwise false.

isWritable

public boolean isWritable()
Gets the writable flag of this attribute.

Overrides:
isWritable in class MBeanAttributeInfo
Returns:
true for a writable attribute, otherwise false.

setWritable

public void setWritable(boolean flag)
Sets the writable flag of this attribute. Once set to false, the true flag is valid only until the next write operation.

Parameters:
flag - true for a writable attribute, otherwise false.

isCloneable

public boolean isCloneable()
Gets the cloneable flag of this attribute.

Returns:
true for a blank nulled attribute.

setCloneable

public void setCloneable(boolean flag)
Sets the cloneable flag of this attribute. Once set to false, the true flag is valid only until the next clone operation.

Parameters:
flag - true for a cloneable attribute, otherwise false.

isMandatory

public boolean isMandatory()
Gets the mandatory flag of this attribute.

Returns:
true if the attribute is mandatory, otherwise false.

setMandatory

public void setMandatory(boolean flag)
Sets the mandatory flag of this attribute. Once set to true, the false flag is valid only until the next write operation.

Parameters:
flag - true for a mandatory attribute, otherwise false.

isTransient

public boolean isTransient()
Gets the transient flag of this attribute.

Returns:
true if the attribute is transient, otherwise false.

setTransient

public void setTransient(boolean flag)
Sets the transient flag of this attribute. Once set to true, the false flag is valid only until the next write operation.

Changes to values of transient attributes should not be saved by the applied persistence mechanisms.

Parameters:
flag - true for a transient attribute, otherwise false.

isSerialized

public boolean isSerialized()
Gets the serialized flag of this attribute.

Returns:
true if the attribute is serialized, otherwise false.

setSerialized

public void setSerialized(boolean flag)
Sets the serialized flag of this attribute. Once set to true, the false flag is valid only until the next read operation.

Values of serialized attributes should be saved as strings by the applied persistence mechanisms.

Parameters:
flag - true for a serialized attribute, otherwise false.

isCorrelative

public boolean isCorrelative()
Gets the correlative flag of this attribute.

Returns:
true for a correlative attribute, otherwise false.

setCorrelative

public void setCorrelative(boolean flag)
Sets the correlative flag of this attribute. Once set to true, the false flag is valid only until the next write operation.

Changes to values of correlative attributes should refresh values of all other attributes of the variable.

Parameters:
flag - true for a correlative attribute, otherwise false.

isInteractive

public boolean isInteractive()
Gets the interactive flag of this attribute.

Returns:
true for an interactive attribute, otherwise false.

setInteractive

public void setInteractive(boolean flag)
Sets the interactive flag of this attribute. Once set to true, the false flag is valid only until the next write operation.

Changes to values of interactive attributes should redisplay any interactive views related to the attribute.

Parameters:
flag - true for an interactive attribute, otherwise false.

isReference

public boolean isReference()
Gets the reference flag of this attribute.

Returns:
true for a reference attribute.

setReference

public void setReference(boolean flag)
Sets the reference flag of this attribute.

Values of reference attributes should be registered and unregistered together with their owner variable.

Parameters:
flag - true for a reference attribute, otherwise false.

isCollection

public boolean isCollection()
Gets the collection flag of this attribute.

Returns:
true for a collection attribute.

setCollection

public void setCollection(boolean flag)
Sets the collection flag of this attribute. once set to true, it can't be cleared.

Values of collection attributes may require specific treatment when persisted.

Parameters:
flag - true for a collection attribute, otherwise false.

isPrimary

public boolean isPrimary()
Gets the primary flag of this attribute.

Returns:
true for a primary attribute.

setPrimary

public void setPrimary(boolean flag)
Sets the primary flag of this attribute. Once set to true, it can't be cleared.

Values of primary attributes should uniquely identify the corresponding variable.

Parameters:
flag - true for a primary attribute, otherwise false.

isLocalized

public boolean isLocalized()
Gets the localized flag of this attribute.

Returns:
true for a localized attribute.

setLocalized

public void setLocalized(boolean flag)
Sets the localized flag of this attribute.

Values of localized attributes should be translated before displaying.

Parameters:
flag - true for a localized attribute, otherwise false.

isOrdered

public boolean isOrdered()
Gets the ordered flag of this attribute.

Returns:
true for an ordered attribute.

setOrdered

public void setOrdered(boolean flag)
Sets the ordered flag of this attribute.

Values of ordered array attributes and enumerations should be sorted before assignment. The associated comparator must be applied, if any.

Parameters:
flag - true for an ordered attribute, otherwise false.

isSorted

public boolean isSorted()
Gets the sorted flag of this attribute.

Returns:
true for a sorted attribute.

setSorted

public void setSorted(boolean flag)
Sets the sorted flag of this attribute.

String values of sorted array attributes and enumerations of sorted attributes should be sorted after localization. The associated comparator must be applied, if any.

Parameters:
flag - true for a sorted attribute, otherwise false.

isTraceable

public boolean isTraceable()
Gets the traceable flag of this attribute.

Returns:
true for a traceable attribute.

setTraceable

public void setTraceable(boolean flag)
Sets the traceable flag of this attribute.

Traceable attributes should maintain a timestamp of their last modification accessed through the methods of the Traceable interface.

Parameters:
flag - true for a traceable attribute, otherwise false.

isDisabled

public boolean isDisabled()
Gets the disabled flag of this attribute.

Returns:
true for a disabled attribute.

setDisabled

public void setDisabled(boolean flag)
Sets the disabled flag of this attribute.

Disabled attributes are temporarily non-writable.

Parameters:
flag - true for a disabled attribute, otherwise false.

isTrimmed

public boolean isTrimmed()
Gets the trimmed flag of this attribute.

Returns:
true for a trimmed attribute.

setTrimmed

public void setTrimmed(boolean flag)
Sets the trimmed flag of this attribute.

String representations of trimmed attributes are trimmed before assignments and conversions.

Parameters:
flag - true for a trimmed attribute, otherwise false.

isBlankAccepted

public boolean isBlankAccepted()
Gets the blank accepted flag of this attribute.

Returns:
true for a blank accepted attribute.

setBlankAccepted

public void setBlankAccepted(boolean flag)
Sets the blank accepted flag of this attribute.

Note that this option is applied to values given as string arrays. This hack tries to solve the null problem when assigning HTML form based values.

Parameters:
flag - true for a blank nulled attribute, otherwise false.

isEmptyAccepted

public boolean isEmptyAccepted()
Gets the empty accepted flag of this attribute.

Returns:
true for an empty accepted attribute.

setEmptyAccepted

public void setEmptyAccepted(boolean flag)
Sets the empty accepted flag of this attribute.

Note that this option is applied to mandatory array attributes. If true, arrays of zero length are accepted as non-null values.

Parameters:
flag - true for an empty accepted attribute, otherwise false.

isLocal

public boolean isLocal()
Gets the local flag of this attribute.

Returns:
true for a local attribute.

setLocal

public void setLocal(boolean flag)
Sets the local flag of this attribute.

Local attributes are not imported or exported.

Parameters:
flag - true for a local attribute, otherwise false.

getOptions

public int getOptions()
Gets permanent options of this attribute.

Returns:
the permanent option mask.

setOptions

public void setOptions(int mask)
Sets permanent options of this attribute.

Parameters:
mask - the permanent option mask.

resetCloneAccess

public void resetCloneAccess()
Resets all temporary masks to their original values.


resetReadAccess

public void resetReadAccess()
Resets readable and serializable masks to their original values.


resetWriteAccess

public void resetWriteAccess()
Resets writable, mandatory and transient masks to their original values.


getComparator

public Comparator getComparator()
Gets the comparator of this attribute.

Returns:
the comparator or null.

setComparator

public void setComparator(Comparator comp)
Sets the comparator of this attribute.

Parameters:
comp - the comparator.

setDescription

public void setDescription(String descr)
Sets the description of this attribute.

Parameters:
descr - the attribute description.

getGroup

public String getGroup()
Gets the group of this attribute. The group may be applied to collect related attributes into groups.

Returns:
the attribute group.

setGroup

public void setGroup(String grp)
Sets the group of this attribute.

Parameters:
grp - the attribute group.

getDetail

public String getDetail()
Gets the detail of this attribute. The detail may be applied to specify the attribute in more detail than with the description.

Returns:
the attribute detail.

setDetail

public void setDetail(String spec)
Sets the detail of this attribute.

Parameters:
spec - the attribute detail.

getMinValue

public Object getMinValue()
Gets the minimum value of this attribute.

Returns:
the minimum or null if not defined.

setMinValue

public void setMinValue(Object min)
Sets the minimum value of this attribute.

Parameters:
min - the minimum or null if not defined.
Throws:
NumberFormatException - if any value is an invalid number.
ClassCastException - if the value is of incorrect type.
UnsupportedOperationException - if the value cannot be converted.
IllegalArgumentException - if the value is out of bounds.

getMaxValue

public Object getMaxValue()
Gets the maximum value of this attribute.

Returns:
the maximum or null if not defined.

setMaxValue

public void setMaxValue(Object max)
Sets the maximum value of this attribute.

Parameters:
max - the maximum or null if not defined.
Throws:
NumberFormatException - if any value is an invalid number.
ClassCastException - if the value is of incorrect type.
UnsupportedOperationException - if the value cannot be converted.
IllegalArgumentException - if the value is out of bounds.

getPattern

public String getPattern()
Gets the value pattern of this attribute.

Returns:
the pattern or null if not defined.

setPattern

public void setPattern(String pattern)
Sets the value pattern of this attribute.

Parameters:
pattern - the pattern or null if not defined.

getShadow

public String getShadow()
Gets the shadow pattern of this attribute.

Returns:
the pattern or null if not defined.

setShadow

public void setShadow(String pattern)
Sets the shadow pattern of this attribute.

Parameters:
pattern - the pattern or null if not defined.

getEnumeration

public EnumeratedList getEnumeration()
Gets an enumeration of allowed attribute values. The enumeration is returned as a list of EnumAttribute instances.

Note that the iterator of the enumeration is unmodifiable.

Returns:
the enumeration as a list or null if not an enumerated attribute.

setEnumeration

public void setEnumeration(List list)
Sets the enumeration of allowed attribute values. Values can be public string representations, internal object values or explicit EnumAttribute instances.

Parameters:
list - the enumeration as a list.
Throws:
NullPointerException - if the enumeration is a null value.
NumberFormatException - if any value is an invalid number.
ClassCastException - if the value is of incorrect type.
UnsupportedOperationException - if the value cannot be converted.
IllegalArgumentException - if the value is out of bounds.

getInitialValue

public Object getInitialValue()
Gets the initial value of this attribute.

Note that the value is cloned unless the cloneable flag is set to false.

Returns:
the initial attribute value.

setInitialValue

public void setInitialValue(Object value)
Sets the initial attribute value after validation.

Parameters:
value - the attribute value.
Throws:
RuntimeConversionException - if the conversion fails.
NumberFormatException - if the value is an invalid number.
ClassCastException - if the value is of incorrect type.
UnsupportedOperationException - if the value cannot be converted.
IllegalArgumentException - if the value is invalid.
IndexOutOfBoundsException - if array indeces are exceeded.
NullPointerException - if the conversion detects nulls.

isInitialized

public boolean isInitialized()
Checks whether this attribute is initialized.

Returns:
true for an initialized attribute.

isEnumerated

public boolean isEnumerated()
Checks whether this attribute is enumerated.

Returns:
true if this attribute is enumerated, otherwise false.

isPrimitive

public boolean isPrimitive()
Checks whether this attribute is primitive.

Returns:
true if this attribute is primitive, otherwise false.

isArray

public boolean isArray()
Checks whether this attribute is an array.

Returns:
true if this attribute is an array, otherwise false.

validateValue

public Object validateValue(Object value)
Validates an attribute value.

Note that validation does *NOT* check access restrictions, like writable and mandatory, but only the validity of the value itself.

Parameters:
value - the value to validate.
Returns:
the validated attribute value.
Throws:
RuntimeConversionException - if the conversion fails.
NumberFormatException - if the value is an invalid number.
ClassCastException - if the value is of incorrect type.
UnsupportedOperationException - if the value cannot be converted.
IllegalArgumentException - if the value is invalid.
IndexOutOfBoundsException - if array indeces are exceeded.
NullPointerException - if the conversion detects nulls.

toString

public String toString()
Converts the initial attribute value to a string.

Overrides:
toString in class Object
Returns:
the value as a string.

toString

public String toString(Object value)
Converts the specified attribute value to a string.

Parameters:
value - the value to convert.
Returns:
the value as a string.

toStrings

public String[] toStrings(Object value)
Converts the specified attribute value to a string array.

Parameters:
value - the value to convert.
Returns:
the value as a string array.

toShadow

public String toShadow()
Converts this attribute to a shadow.

Returns:
the shadow string.

toShadows

public String[] toShadows()
Converts the this attribute to a shadows.

Returns:
the shadow string array.

getOwnerName

public ObjectName getOwnerName()
Gets the name of the owner of this attribute.

Returns:
the name of the owner MBean or null.