|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.MBeanFeatureInfo javax.management.MBeanAttributeInfo org.norther.tammi.core.rt.VariableAttributeInfo
public class VariableAttributeInfo
A meta-data description of a variable attribute.
Note that attribute names are capitalized according to JMX naming rules.
Nested Class Summary | |
---|---|
static class |
VariableAttributeInfo.Trait
Attribute traits. |
Field Summary | |
---|---|
static String |
ATTRIBUTE_PACKAGE
The default attribute package. |
static String |
COMPARATOR_FIELD
The comparator field. |
static String |
DESCRIPTION_SUFFIX
The description suffix. |
static String |
DETAIL_FIELD
The detail field. |
static String |
DETAIL_SUFFIX
The detail suffix. |
static String |
ENUM_SUFFIX
The enum suffix. |
static String |
ENUMERATION_FIELD
The enumeration field. |
static String |
GROUP_FIELD
The group field. |
static String |
GROUP_SUFFIX
The group suffix. |
static String |
MAX_SIZE_FIELD
The max size field. |
static String |
MAX_VALUE_FIELD
The max value field. |
static String |
MIN_SIZE_FIELD
The min size field. |
static String |
MIN_VALUE_FIELD
The min value field. |
static String |
PATTERN_FIELD
The pattern field. |
static String |
QUALIFIER_FIELD
The qualifier field. |
static String |
SHADOW_FIELD
The shadow field. |
static String |
TRAITS_FIELD
The traits field. |
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,
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(String attr,
String type,
String descr)
Constructs a non-initialized attribute description. |
|
VariableAttributeInfo(String attr,
String type,
String descr,
Descriptor dtor)
Constructs a non-initialized attribute description with a descriptor. |
|
VariableAttributeInfo(String attr,
String type,
String descr,
Descriptor dtor,
MBeanReference<?> owner)
Constructs a non-initialized attribute description for the specified MBean with a descriptor. |
|
VariableAttributeInfo(String attr,
String type,
String descr,
MBeanReference<?> owner)
Constructs a non-initialized attribute description for the specified MBean. |
Method Summary | ||
---|---|---|
void |
clearLocalizedEnumerations()
Clears all localized enumerations of allowed attribute values. |
|
Object |
clone()
Clones this object. |
|
Object |
convertValue(Object value,
Object... localization)
Converts an attribute value from an external type to the internal one by applying applicable attribute traits. |
|
boolean |
equals(Object obj)
Checks equality of this object. |
|
|
getComparator()
Gets the comparator of this attribute. |
|
Class<?> |
getComponentClass()
Gets the component object class of this attribute. |
|
|
getConstant(Class<E> clazz)
Gets the specified constant. |
|
Object |
getDefaultValue()
Gets the default attribute value. |
|
Descriptor |
getDescriptor()
Gets the descriptor of this attribute. |
|
String |
getDetail()
Gets the detail of this attribute. |
|
EnumeratedList |
getEnumeration()
Gets the enumeration of allowed attribute values. |
|
String |
getGroup()
Gets the group of this attribute. |
|
|
getListeners(Class<L> clazz)
Gets the specified listeners. |
|
EnumeratedList |
getLocalizedEnumeration(Locale locale)
Gets a localized enumeration of allowed attribute values. |
|
int |
getMaxSize()
Gets the maximum size of this attribute. |
|
Object |
getMaxValue()
Gets the maximum value of this attribute. |
|
int |
getMinSize()
Gets the minimum size of this attribute. |
|
Object |
getMinValue()
Gets the minimum value of this attribute. |
|
ObjectName |
getOwnerName()
Gets the name of the owner of this attribute. |
|
String |
getPattern()
Gets the value pattern of this attribute. |
|
String |
getQualifier()
Gets the qualifier of this attribute. |
|
String |
getShadow()
Gets the shadow pattern of this attribute. |
|
int |
getTraits()
Gets permanent traits of this attribute. |
|
int |
hashCode()
|
|
boolean |
isArray()
Checks whether this attribute is of array type. |
|
boolean |
isBoolean()
Checks whether this attribute is of boolean type. |
|
boolean |
isCloneable()
Gets the cloneable flag of this attribute. |
|
boolean |
isDefined()
Checks whether this attribute is defined. |
|
boolean |
isElement()
Checks whether this attribute is of element type. |
|
boolean |
isEnum()
Checks whether this attribute is of enum type. |
|
boolean |
isEnumerated()
Checks whether this attribute is enumerated. |
|
boolean |
isImmutable()
Checks whether this attribute is immutable. |
|
boolean |
isInteractive()
Gets the interactive flag of this attribute. |
|
boolean |
isMandatory()
Gets the mandatory flag of this attribute. |
|
boolean |
isNumeric()
Checks whether this attribute is of numeric type. |
|
boolean |
isObjectName()
Checks whether this attribute is of object name type. |
|
boolean |
isPrimitive()
Checks whether this attribute is of primitive type. |
|
boolean |
isReadable()
Gets the readable flag of this attribute. |
|
boolean |
isSerialized()
Gets the serialized flag of this attribute. |
|
boolean |
isTrait(VariableAttributeInfo.Trait trait)
Gets the specified trait of this attribute. |
|
boolean |
isTransient()
Gets the transient flag of this attribute. |
|
boolean |
isValidValue(Object value,
Object... localization)
Checks whether an attribute value is valid. |
|
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 |
setCloneable(boolean flag)
Sets the cloneable flag of this attribute. |
|
|
setComparator(Comparator<T> comparator)
Sets the comparator of this attribute. |
|
|
setConstant(Class<E> clazz,
E constant)
Sets the specified constant. |
|
void |
setDefaultValue(Object value)
Sets the default attribute value after validation. |
|
void |
setDescription(String descr)
Sets the description of this attribute. |
|
void |
setDetail(String detail)
Sets the detail of this attribute. |
|
void |
setEnumeration(List<?> list)
Sets the enumeration of allowed attribute values. |
|
void |
setGroup(String group)
Sets the group of this attribute. |
|
void |
setImmutable(boolean flag)
Sets whether this attribute is immutable. |
|
void |
setInteractive(boolean flag)
Sets the interactive flag of this attribute. |
|
|
setListeners(Class<L> clazz,
L[] listeners)
Sets the specified listeners. |
|
void |
setLocalizedEnumeration(Locale locale,
EnumeratedList enums)
Sets the localized enumeration of allowed attribute values. |
|
void |
setMandatory(boolean flag)
Sets the mandatory flag of this attribute. |
|
void |
setMaxSize(int max)
Sets the maximum size of this attribute. |
|
void |
setMaxValue(Object max)
Sets the maximum value of this attribute. |
|
void |
setMinSize(int min)
Sets the minimum size of this attribute. |
|
void |
setMinValue(Object min)
Sets the minimum value of this attribute. |
|
void |
setPattern(String pattern)
Sets the value pattern of this attribute. |
|
void |
setQualifier(String qualifier)
Sets the qualifier of this attribute. |
|
void |
setReadable(boolean flag)
Sets the readable 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 |
setTrait(VariableAttributeInfo.Trait trait,
boolean flag)
Sets the specified trait of this attribute. |
|
void |
setTraits(int traits)
Sets permanent traits of this attribute. |
|
void |
setTransient(boolean flag)
Sets the transient flag of this attribute. |
|
void |
setWritable(boolean flag)
Sets the writable flag of this attribute. |
|
static String |
toLocalizedDescription(String type,
String name)
Generates a localized description key. |
|
static String |
toLocalizedDetail(String type,
String name)
Generates a localized detail key. |
|
static String |
toLocalizedGroup(String type,
String name)
Generates a localized group key. |
|
String |
toSerializable(Object value,
Object... localization)
Converts the specified attribute value to a serializable string. |
|
String[] |
toSerializables(Object values,
Object... localization)
Converts the specified attribute values to a serializable string array. |
|
String |
toShadow()
Converts this attribute to a shadow. |
|
String[] |
toShadows()
Converts the this attribute to a shadows. |
|
String |
toString(Object value,
Object... localization)
Converts the specified attribute value to a string. |
|
String[] |
toStrings(Object value,
Object... localization)
Converts the specified attribute value to a string array. |
|
Object |
validateValue(Object value,
Object... localization)
Validates an attribute value. |
Methods inherited from class javax.management.MBeanAttributeInfo |
---|
getType, isIs, toString |
Methods inherited from class javax.management.MBeanFeatureInfo |
---|
getDescription, getName |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ATTRIBUTE_PACKAGE
public static final String TRAITS_FIELD
public static final String GROUP_FIELD
public static final String DETAIL_FIELD
public static final String QUALIFIER_FIELD
public static final String MIN_VALUE_FIELD
public static final String MAX_VALUE_FIELD
public static final String MIN_SIZE_FIELD
public static final String MAX_SIZE_FIELD
public static final String PATTERN_FIELD
public static final String SHADOW_FIELD
public static final String COMPARATOR_FIELD
public static final String ENUMERATION_FIELD
public static final String DESCRIPTION_SUFFIX
public static final String DETAIL_SUFFIX
public static final String GROUP_SUFFIX
public static final String ENUM_SUFFIX
Constructor Detail |
---|
public VariableAttributeInfo(String attr, String type, String descr)
attr
- the name of the attribute.type
- the type or class name of the attribute.descr
- a human readable description of the attribute.public VariableAttributeInfo(String attr, String type, String descr, MBeanReference<?> owner)
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.public VariableAttributeInfo(String attr, String type, String descr, Descriptor dtor)
attr
- the name of the attribute.type
- the type or class name of the attribute.descr
- a human readable description of the attribute.dtor
- the attribute descriptor.public VariableAttributeInfo(String attr, String type, String descr, Descriptor dtor, MBeanReference<?> owner)
attr
- the name of the attribute.type
- the type or class name of the attribute.descr
- a human readable description of the attribute.dtor
- the attribute descriptor.owner
- the optional owner of the attribute.public VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized)
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.public VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized, String pattern)
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.public VariableAttributeInfo(Object value, String attr, String type, String descr, String grp, String spec, boolean readable, boolean writable, boolean mandatory, boolean localized, List<?> list)
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.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)
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.public VariableAttributeInfo(Object value, MBeanAttributeInfo info, MBeanReference<?> owner)
value
- the initial value of the attribute.info
- the feature info to apply.owner
- the optional owner of the attribute.public VariableAttributeInfo(Object value, MBeanOperationInfo info, MBeanReference<?> owner)
value
- the initial value of the attribute.info
- the feature info to apply.owner
- the optional owner of the attribute.
NullPointerException
- for missing arguments.public VariableAttributeInfo(Object value, MBeanConstructorInfo info, MBeanReference<?> owner)
value
- the initial value of the attribute.info
- the feature info to apply.owner
- the optional owner of the attribute.
NullPointerException
- for missing arguments.public VariableAttributeInfo(Object value, MBeanParameterInfo info, MBeanReference<?> owner)
value
- the initial value of the attribute.info
- the feature info to apply.owner
- the optional owner of the attribute.
NullPointerException
- for missing arguments.public VariableAttributeInfo(Object value, MBeanFeatureInfo info, MBeanReference<?> owner)
value
- the initial value of the attribute.info
- the feature info to apply.owner
- the optional owner of the attribute.
NullPointerException
- for missing arguments.Method Detail |
---|
public static String toLocalizedDescription(String type, String name)
type
- the variable type.name
- the attribute name.
public static String toLocalizedDetail(String type, String name)
type
- the variable type.name
- the attribute name.
public static String toLocalizedGroup(String type, String name)
type
- the variable type.name
- the attribute name.
public Object clone()
clone
in class MBeanAttributeInfo
public boolean equals(Object obj)
equals
in class MBeanAttributeInfo
obj
- the object with which to compare.
public int hashCode()
hashCode
in class MBeanAttributeInfo
public Class<?> getComponentClass()
public boolean isImmutable()
public void setImmutable(boolean flag)
flag
- true if immutable, false otherwise.public boolean isDefined()
public int getTraits()
public void setTraits(int traits)
traits
- the permanent trait mask.public boolean isTrait(VariableAttributeInfo.Trait trait)
trait
- the trait to get.
public void setTrait(VariableAttributeInfo.Trait trait, boolean flag)
trait
- the trait to set.flag
- true to set a trait, false to clear.public boolean isArray()
public boolean isPrimitive()
Primitive attributes may not accept null values.
public boolean isNumeric()
public boolean isBoolean()
public boolean isEnum()
Enum attributes are automatically enumerated.
public boolean isElement()
Element attributes represent references to array elements.
public boolean isObjectName()
Object name attributes may have customized enumerations.
public boolean isReadable()
isReadable
in class MBeanAttributeInfo
public void setReadable(boolean flag)
flag
- true for a readable attribute, otherwise false.public boolean isWritable()
isWritable
in class MBeanAttributeInfo
public void setWritable(boolean flag)
flag
- true for a writable attribute, otherwise false.public boolean isCloneable()
public void setCloneable(boolean flag)
flag
- true for a cloneable attribute, otherwise false.public boolean isMandatory()
public void setMandatory(boolean flag)
flag
- true for a mandatory attribute, otherwise false.public boolean isTransient()
public void setTransient(boolean flag)
Changes to values of transient attributes should not be saved by the applied persistence mechanisms.
flag
- true for a transient attribute, otherwise false.public boolean isSerialized()
public void setSerialized(boolean flag)
Values of serialized attributes should be saved as strings by the applied persistence mechanisms.
flag
- true for a serialized attribute, otherwise false.public boolean isInteractive()
public void setInteractive(boolean flag)
Changes to values of interactive attributes should redisplay any interactive views related to the attribute.
flag
- true for an interactive attribute, otherwise false.public void resetCloneAccess()
public void resetReadAccess()
public void resetWriteAccess()
public Object getDefaultValue()
Note that the value is cloned unless the cloneable flag is set to false.
public void setDefaultValue(Object value)
value
- the default attribute value.
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 indices are exceeded.
NullPointerException
- if the conversion detects nulls.public void setDescription(String descr)
descr
- the attribute description.public String getGroup()
public void setGroup(String group)
group
- the attribute group.public String getDetail()
public void setDetail(String detail)
detail
- the attribute detail.public String getQualifier()
public void setQualifier(String qualifier)
qualifier
- the attribute qualifier.public Object getMinValue()
public void setMinValue(Object min)
min
- the minimum or null if not defined.
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.public Object getMaxValue()
public void setMaxValue(Object max)
max
- the maximum or null if not defined.
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.public int getMinSize()
public void setMinSize(int min)
min
- the minimum size.public int getMaxSize()
public void setMaxSize(int max)
max
- the maximum size.public String getPattern()
public void setPattern(String pattern)
pattern
- the pattern or null if not defined.public String getShadow()
public void setShadow(String pattern)
pattern
- the pattern or null if not defined.public <T> Comparator<T> getComparator()
T
- the comparator type.
public <T> void setComparator(Comparator<T> comparator)
T
- the comparator type.comparator
- the comparator.public <L extends EventListener> L[] getListeners(Class<L> clazz)
L
- the listener type.clazz
- the listener class.
public <L extends EventListener> void setListeners(Class<L> clazz, L[] listeners)
L
- the listener type.clazz
- the listener class.listeners
- the listener instances.public <E extends Enum<?>> E getConstant(Class<E> clazz)
E
- the constant type.clazz
- the constant class.
public <E extends Enum<?>> void setConstant(Class<E> clazz, E constant)
E
- the constant type.clazz
- the constant class.constant
- the constant instance.public boolean isEnumerated()
public EnumeratedList getEnumeration()
EnumAttribute
instances.
public void setEnumeration(List<?> list)
EnumAttribute
instances.
list
- the enumeration as a list.
NumberFormatException
- if any value is an invalid number.
ClassCastException
- if the value is of incorrect type.
UnsupportedOperationException
- if an immutable atribute.
IllegalArgumentException
- if the value is out of bounds.public EnumeratedList getLocalizedEnumeration(Locale locale)
EnumAttribute
instances.
locale
- the locale of the enumeration.
public void setLocalizedEnumeration(Locale locale, EnumeratedList enums)
locale
- the locale of the enumeration.enums
- the enumeration as a list.
IllegalStateException
- if not an enumerated attribute.public void clearLocalizedEnumerations()
public Descriptor getDescriptor()
getDescriptor
in interface DescriptorRead
getDescriptor
in class MBeanFeatureInfo
public boolean isValidValue(Object value, Object... localization)
Note that validation does *NOT* check access restrictions, like writable and mandatory, but only the validity of the value itself.
value
- the value to validate.localization
- optional base name, resource bundle and locale.
public Object validateValue(Object value, Object... localization)
Note that validation does *NOT* check access restrictions, like writable and mandatory, but only the validity of the value itself.
value
- the value to validate.localization
- optional base name, resource bundle and locale.
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 indices are exceeded.
ValueOutOfBoundsException
- if value limits are exceeded.
NullPointerException
- if the conversion detects nulls.public Object convertValue(Object value, Object... localization)
value
- the value to convert.localization
- optional base name, resource bundle and locale.
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 indices are exceeded.
NullPointerException
- if the conversion detects nulls.public String toSerializable(Object value, Object... localization)
value
- the value to convert.localization
- optional base name, resource bundle and locale.
public String[] toSerializables(Object values, Object... localization)
values
- the values to convert.localization
- optional base name, resource bundle and locale.
public String toString(Object value, Object... localization)
Note that a non-readable value is presented as a shadow.
value
- the value to convert.localization
- optional base name, resource bundle and locale.
public String[] toStrings(Object value, Object... localization)
Note that a non-readable values are presented as shadows.
value
- the value to convert.localization
- optional base name, resource bundle and locale.
public String toShadow()
public String[] toShadows()
public ObjectName getOwnerName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |