org.norther.tammi.core.rt
Interface Variable

All Superinterfaces:
Cloneable, DynamicMBean, ReferableMBean<Variable>
All Known Subinterfaces:
Aggregate, Element
All Known Implementing Classes:
AbstractSelectionList, AbstractSelectionTree, InteractiveSelectionTree, MultiSelectionList, MultiSelectionTree, SearchBox, SingleSelectionList, SingleSelectionTree, SortedMultiSelectionList, SortedSingleSelectionList, TableSelectionList, VariableX, VariableY, VariableZ

public interface Variable
extends ReferableMBean<Variable>, DynamicMBean, Cloneable

An interface to variables supporting dynamic attributes, operations and notifications exposed through the DynamicMBean interface.

Note that internal attributes of implemented interfaces have higher precedence than dynamic attributes in operations of the DynamicMBean interface, but typically they are not available in operations of the Variable interface.

Version:
$Id: Variable.java,v 1.46 2010-06-29 18:29:33 cvsimp Exp $
Author:
Ilkka Priha

Field Summary
static String ADD_ATTRIBUTE_ELEMENT
          Add attribute element method.
static String ADD_ATTRIBUTE_INFO
          Add attribute info method.
static String ADD_VALIDATED_ELEMENT
          Add validated element method.
static char ATTRIBUTE_ELEMENT_SEPARATOR
          The attribute element separator char.
static String ATTRIBUTE_INFO
          Attribute info method.
static String ATTRIBUTE_LENGTH
          Attribute length method.
static String ATTRIBUTE_LIST
          Attribute list method.
static String ATTRIBUTE_POSITION
          Attribute position method.
static String ATTRIBUTE_VALUES
          Attribute values attribute.
static String CLEAR_ATTRIBUTE_INFO
          Clear attribute info method.
static String CLEAR_ATTRIBUTE_VALUES
          Clear attribute values method.
static String CONTAINS_ATTRIBUTE
          Contains attribute method.
static String CONTAINS_TRAIT
          Contains trait method.
static String EXPORT_ATTRIBUTES
          Export attributes method.
static String GET_ATTRIBUTE_ELEMENT
          Get attribute element method.
static String GET_ATTRIBUTE_VALUE
          Get attribute value method.
static String GET_RECURSIVE_ELEMENT
          Get recursive element method.
static String GET_RECURSIVE_VALUE
          Get recursive value method.
static String GET_VALIDATED_ELEMENT
          Get validated element method.
static String GET_VALIDATED_VALUE
          Get validated value method.
static String ID
          Id attribute.
static String ID_ATTRIBUTE_LIST
          Id attribute list method.
static String IMPORT_ATTRIBUTES
          Import attributes method.
static String REMOVE_ATTRIBUTE_ELEMENT
          Remove attribute element method.
static String REMOVE_VALIDATED_ELEMENT
          Remove validated element method.
static String REPLACE_ATTRIBUTE_INFO
          Replace attribute info method.
static String RESET_VALIDATED_VALUES
          Reset validated values method.
static String SET_ATTRIBUTE_ELEMENT
          Set attribute element method.
static String SET_ATTRIBUTE_VALUE
          Set attribute value method.
static String SET_ATTRIBUTE_VALUES
          Set attribute values method.
static String SET_VALIDATED_ELEMENT
          Set validated element method.
static String SET_VALIDATED_VALUE
          Set validated value method.
static String TYPE
          Type attribute.
static String VALIDATE_ATTRIBUTE_VALUES
          Validate attribute values method.
static String VALIDATED_VALUES
          Validated values method.
static String VARIABLE_INFO
          Variable info method.
 
Fields inherited from interface org.norther.tammi.core.base.ReferableMBean
MBEAN, NS
 
Method Summary
 void addAttributeElement(String name, int index, Object value)
          Adds an indexed element to an array attribute without validation.
 void addAttributeElement(String name, Object value)
          Adds an element to an array attribute without validation.
 boolean addAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs, int... position)
          Adds attribute info of new attributes to this variable if they're not already present.
 void addValidatedElement(String name, int index, Object value, Object... localization)
          Adds an indexed element to a dynamic array attribute with validation.
 void addValidatedElement(String name, Object... localizedValue)
          Adds an element to a dynamic array attribute with validation.
 Collection<VariableAttributeInfo> attributeInfo()
          Returns attribute info of dynamic attributes of this variable.
 VariableAttributeInfo attributeInfo(String name, boolean... modifiable)
          Returns optionally modifiable or recursive attribute info of a named attribute.
 int attributeLength(String name)
          Returns the length of an array attribute.
 List<VariableAttributeInfo> attributeList(boolean... modifiable)
          Returns optionally modifiable attribute info of all attributes in the definition order without internal attributes.
 int attributePosition(String name)
          Returns the position of the named attribute.
 void clearAttributeInfo()
          Clears attribute info of dynamic attributes of this variable.
 void clearAttributeValues()
          Clears attribute values of the current attributes.
 Object clone()
          Clones this variable.
 boolean containsAttribute(String name)
          Checks whether the named attribute exists.
 boolean containsTrait(VariableAttributeInfo.Trait trait)
          Checks whether the specified trait is permanently on in any of the attributes.
 AttributeList exportAttributes(Object target, AttributeFilter... filter)
          Exports filtered attribute values to another object.
 Object getAttribute(String name)
          Gets the value of the named internal or dynamic attribute without access checks and any variable specific validation.
 Object getAttributeElement(String name, int index)
          Gets the indexed element of an array attribute without validation.
 AttributeList getAttributes(String[] names)
          Gets the values of the named internal or dynamic attributes without access checks and any variable specific validation.
 Object getAttributeValue(String name)
          Gets the value of the named dynamic attribute without access checks and any variable specific validation.
 Map<String,Object> getAttributeValues()
          Gets attribute values as a map of name value bindings without validation.
 Object getId()
          Gets the id of this variable corresponding to its primary attributes.
 Object getRecursiveElement(String name, int index, String... pattern)
          Gets the first non-recursive indexed element of an recursive dynamic array attribute with validation.
 Object getRecursiveValue(String name, String... pattern)
          Gets the first non-recursive value of a named recursive dynamic attribute with validation.
 String getType()
          Gets the type of this variable.
 Object getValidatedElement(String name, int index)
          Gets the indexed element of a dynamic array attribute with validation.
 Object getValidatedValue(String name)
          Gets the value of a named dynamic attribute with validation.
 List<VariableAttributeInfo> idAttributeList()
          Returns attribute info of id attributes in the definition order.
 AttributeList importAttributes(Object source, AttributeFilter... filter)
          Imports filtered attribute values from another object.
 Object removeAttributeElement(String name, int index)
          Removes the indexed element from an array attribute without validation.
 boolean removeAttributeElement(String name, Object value)
          Removes an element from an array attribute without validation.
 Object removeValidatedElement(String name, int index, Object... localization)
          Removes the indexed element from a dynamic array attribute with validation.
 boolean removeValidatedElement(String name, Object... localizedValue)
          Removes an element from a dynamic array attribute with validation.
 void replaceAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs)
          Replaces attribute info of dynamic attributes of this variable.
 SortedMap<String,Exception> resetValidatedValues(Map<?,?> attributes, Object... localization)
          Resets attribute values in a map of name value bindings with validation.
 void setAttribute(Attribute attr)
          Sets the value of the given internal or dynamic attribute without access checks and any variable specific validation.
 void setAttributeElement(String name, int index, Object value)
          Sets the indexed element of an array attribute without validation.
 AttributeList setAttributes(AttributeList attrs)
          Sets the values of the listed internal or dynamic attributes without access checks and any variable specific validation.
 void setAttributeValue(String name, Object value)
          Sets the value of the named dynamic attribute without access checks and any variable specific validation.
 void setAttributeValues(Map<?,?> attributes)
          Sets attribute values in a map of name value bindings without validation.
 void setAttributeValues(Map<?,?> attributes, Object... localization)
          Sets attribute values in a map of name value bindings without validation.
 void setId(Object id)
          Sets the id of this variable corresponding to its primary attributes.
 void setValidatedElement(String name, int index, Object value, Object... localization)
          Sets the indexed element of a dynamic array attribute with validation.
 void setValidatedValue(String name, Object value, Object... localization)
          Sets the value of an attribute as a name value pair with validation.
 SortedMap<String,Exception> validateAttributeValues()
          Validates attribute values of the current attributes.
 SortedMap<String,Exception> validateAttributeValues(Map<?,?> attributes, Object... localization)
          Validates attribute values in a map of name value bindings.
 Map<String,Object> validatedValues(AttributeFilter... filter)
          Returns validated attribute values as a map of name value bindings.
 VariableInfo variableInfo(boolean... modifiable)
          Returns optionally modifiable variable info of this variable.
 
Methods inherited from interface org.norther.tammi.core.base.ReferableMBean
getMBean
 
Methods inherited from interface javax.management.DynamicMBean
getMBeanInfo, invoke
 

Field Detail

ID

static final String ID
Id attribute.

See Also:
Constant Field Values

TYPE

static final String TYPE
Type attribute.

See Also:
Constant Field Values

ATTRIBUTE_VALUES

static final String ATTRIBUTE_VALUES
Attribute values attribute.

See Also:
Constant Field Values

SET_ATTRIBUTE_VALUES

static final String SET_ATTRIBUTE_VALUES
Set attribute values method.

See Also:
Constant Field Values

GET_ATTRIBUTE_VALUE

static final String GET_ATTRIBUTE_VALUE
Get attribute value method.

See Also:
Constant Field Values

SET_ATTRIBUTE_VALUE

static final String SET_ATTRIBUTE_VALUE
Set attribute value method.

See Also:
Constant Field Values

GET_ATTRIBUTE_ELEMENT

static final String GET_ATTRIBUTE_ELEMENT
Get attribute element method.

See Also:
Constant Field Values

SET_ATTRIBUTE_ELEMENT

static final String SET_ATTRIBUTE_ELEMENT
Set attribute element method.

See Also:
Constant Field Values

ADD_ATTRIBUTE_ELEMENT

static final String ADD_ATTRIBUTE_ELEMENT
Add attribute element method.

See Also:
Constant Field Values

REMOVE_ATTRIBUTE_ELEMENT

static final String REMOVE_ATTRIBUTE_ELEMENT
Remove attribute element method.

See Also:
Constant Field Values

VALIDATED_VALUES

static final String VALIDATED_VALUES
Validated values method.

See Also:
Constant Field Values

RESET_VALIDATED_VALUES

static final String RESET_VALIDATED_VALUES
Reset validated values method.

See Also:
Constant Field Values

VALIDATE_ATTRIBUTE_VALUES

static final String VALIDATE_ATTRIBUTE_VALUES
Validate attribute values method.

See Also:
Constant Field Values

CLEAR_ATTRIBUTE_VALUES

static final String CLEAR_ATTRIBUTE_VALUES
Clear attribute values method.

See Also:
Constant Field Values

GET_VALIDATED_VALUE

static final String GET_VALIDATED_VALUE
Get validated value method.

See Also:
Constant Field Values

SET_VALIDATED_VALUE

static final String SET_VALIDATED_VALUE
Set validated value method.

See Also:
Constant Field Values

GET_VALIDATED_ELEMENT

static final String GET_VALIDATED_ELEMENT
Get validated element method.

See Also:
Constant Field Values

SET_VALIDATED_ELEMENT

static final String SET_VALIDATED_ELEMENT
Set validated element method.

See Also:
Constant Field Values

ADD_VALIDATED_ELEMENT

static final String ADD_VALIDATED_ELEMENT
Add validated element method.

See Also:
Constant Field Values

REMOVE_VALIDATED_ELEMENT

static final String REMOVE_VALIDATED_ELEMENT
Remove validated element method.

See Also:
Constant Field Values

GET_RECURSIVE_VALUE

static final String GET_RECURSIVE_VALUE
Get recursive value method.

See Also:
Constant Field Values

GET_RECURSIVE_ELEMENT

static final String GET_RECURSIVE_ELEMENT
Get recursive element method.

See Also:
Constant Field Values

ATTRIBUTE_LENGTH

static final String ATTRIBUTE_LENGTH
Attribute length method.

See Also:
Constant Field Values

VARIABLE_INFO

static final String VARIABLE_INFO
Variable info method.

See Also:
Constant Field Values

ATTRIBUTE_INFO

static final String ATTRIBUTE_INFO
Attribute info method.

See Also:
Constant Field Values

ADD_ATTRIBUTE_INFO

static final String ADD_ATTRIBUTE_INFO
Add attribute info method.

See Also:
Constant Field Values

REPLACE_ATTRIBUTE_INFO

static final String REPLACE_ATTRIBUTE_INFO
Replace attribute info method.

See Also:
Constant Field Values

CLEAR_ATTRIBUTE_INFO

static final String CLEAR_ATTRIBUTE_INFO
Clear attribute info method.

See Also:
Constant Field Values

ATTRIBUTE_LIST

static final String ATTRIBUTE_LIST
Attribute list method.

See Also:
Constant Field Values

CONTAINS_ATTRIBUTE

static final String CONTAINS_ATTRIBUTE
Contains attribute method.

See Also:
Constant Field Values

CONTAINS_TRAIT

static final String CONTAINS_TRAIT
Contains trait method.

See Also:
Constant Field Values

ID_ATTRIBUTE_LIST

static final String ID_ATTRIBUTE_LIST
Id attribute list method.

See Also:
Constant Field Values

ATTRIBUTE_POSITION

static final String ATTRIBUTE_POSITION
Attribute position method.

See Also:
Constant Field Values

IMPORT_ATTRIBUTES

static final String IMPORT_ATTRIBUTES
Import attributes method.

See Also:
Constant Field Values

EXPORT_ATTRIBUTES

static final String EXPORT_ATTRIBUTES
Export attributes method.

See Also:
Constant Field Values

ATTRIBUTE_ELEMENT_SEPARATOR

static final char ATTRIBUTE_ELEMENT_SEPARATOR
The attribute element separator char.

See Also:
Constant Field Values
Method Detail

clone

Object clone()
Clones this variable. The new variable contains the same attributes as the original one. The attribute values themselves are not cloned.

Returns:
a clone of this variable.

getAttribute

Object getAttribute(String name)
                    throws AttributeNotFoundException,
                           ReflectionException,
                           MBeanException
Gets the value of the named internal or dynamic attribute without access checks and any variable specific validation.

Specified by:
getAttribute in interface DynamicMBean
Parameters:
name - the attribute name.
Returns:
the attribute value.
Throws:
AttributeNotFoundException - if the name is unknown.
ReflectionException - if a getter is not found.
MBeanException - if getting of the value fails.

setAttribute

void setAttribute(Attribute attr)
                  throws AttributeNotFoundException,
                         InvalidAttributeValueException,
                         ReflectionException,
                         MBeanException
Sets the value of the given internal or dynamic attribute without access checks and any variable specific validation.

Specified by:
setAttribute in interface DynamicMBean
Parameters:
attr - the attribute to set.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.
ReflectionException - if a getter is not found.
MBeanException - if getting of the value fails.

getAttributes

AttributeList getAttributes(String[] names)
Gets the values of the named internal or dynamic attributes without access checks and any variable specific validation.

Specified by:
getAttributes in interface DynamicMBean
Parameters:
names - an array of attribute names.
Returns:
a list of name-value pairs.

setAttributes

AttributeList setAttributes(AttributeList attrs)
Sets the values of the listed internal or dynamic attributes without access checks and any variable specific validation.

Specified by:
setAttributes in interface DynamicMBean
Parameters:
attrs - the attributes to set.
Returns:
a list of set name-value pairs.

getAttributeValues

Map<String,Object> getAttributeValues()
Gets attribute values as a map of name value bindings without validation. Only dynamic attributes are included in the map.

Returns:
a map of attribute values.

setAttributeValues

void setAttributeValues(Map<?,?> attributes)
                        throws InvalidAttributeValueException
Sets attribute values in a map of name value bindings without validation. Only known dynamic attributes are set, others skipped. Indexed attribute elements may be defined by appending the index to the attribute name separated by a hyphen.

This method provides compatibility with bean accessors.

Parameters:
attributes - the attributes map.
Throws:
InvalidAttributeValueException - if values are invalid.

setAttributeValues

void setAttributeValues(Map<?,?> attributes,
                        Object... localization)
                        throws InvalidAttributeValueException
Sets attribute values in a map of name value bindings without validation. Only known dynamic attributes are set, others skipped. Indexed attribute elements may be defined by appending the index to the attribute name separated by a hyphen.

Parameters:
attributes - the attributes map.
localization - optional base name, resource bundle and locale.
Throws:
InvalidAttributeValueException - if values are invalid.

getAttributeValue

Object getAttributeValue(String name)
                         throws AttributeNotFoundException
Gets the value of the named dynamic attribute without access checks and any variable specific validation.

Parameters:
name - the attribute name.
Returns:
the attribute value.
Throws:
AttributeNotFoundException - if the name is unknown.

setAttributeValue

void setAttributeValue(String name,
                       Object value)
                       throws AttributeNotFoundException,
                              InvalidAttributeValueException
Sets the value of the named dynamic attribute without access checks and any variable specific validation.

Parameters:
name - the attribute name.
value - the attribute value.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.

getAttributeElement

Object getAttributeElement(String name,
                           int index)
                           throws AttributeNotFoundException
Gets the indexed element of an array attribute without validation.

Parameters:
name - the attribute name.
index - the element index.
Returns:
the value of the element.
Throws:
AttributeNotFoundException - if the name is unknown.

setAttributeElement

void setAttributeElement(String name,
                         int index,
                         Object value)
                         throws AttributeNotFoundException,
                                InvalidAttributeValueException
Sets the indexed element of an array attribute without validation.

Parameters:
name - the attribute name.
index - the element index.
value - the value of the element.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.

addAttributeElement

void addAttributeElement(String name,
                         Object value)
                         throws AttributeNotFoundException,
                                InvalidAttributeValueException
Adds an element to an array attribute without validation.

Parameters:
name - the attribute name.
value - the value of the element.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.

addAttributeElement

void addAttributeElement(String name,
                         int index,
                         Object value)
                         throws AttributeNotFoundException,
                                InvalidAttributeValueException
Adds an indexed element to an array attribute without validation.

Parameters:
name - the attribute name.
index - the element index.
value - the value of the element.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.

removeAttributeElement

boolean removeAttributeElement(String name,
                               Object value)
                               throws AttributeNotFoundException
Removes an element from an array attribute without validation.

Parameters:
name - the attribute name.
value - the value of the element.
Returns:
true if removed.
Throws:
AttributeNotFoundException - if the name is unknown.

removeAttributeElement

Object removeAttributeElement(String name,
                              int index)
                              throws AttributeNotFoundException
Removes the indexed element from an array attribute without validation.

Parameters:
name - the attribute name.
index - the element index.
Returns:
the removed value of the element.
Throws:
AttributeNotFoundException - if the name is unknown.

validatedValues

Map<String,Object> validatedValues(AttributeFilter... filter)
Returns validated attribute values as a map of name value bindings. Only dynamic attributes are included in the map.

Parameters:
filter - an optional filter.
Returns:
a map of attribute values.

resetValidatedValues

SortedMap<String,Exception> resetValidatedValues(Map<?,?> attributes,
                                                 Object... localization)
Resets attribute values in a map of name value bindings with validation. Only known dynamic attributes are set, others skipped. Indexed attribute elements may be defined by appending the index to the attribute name separated by a hyphen.

Invalid attributes are returned in a map binding an invalid attribute name to a validation exception. An empty map indicates that all attributes were valid.

Note that if the attributes map does not contain any settable values, null is returned.

Parameters:
attributes - the attributes map.
localization - optional base name, resource bundle and locale.
Returns:
a map of invalid attributes, an empty map or null.

validateAttributeValues

SortedMap<String,Exception> validateAttributeValues(Map<?,?> attributes,
                                                    Object... localization)
Validates attribute values in a map of name value bindings. Only known dynamic attributes are validated, others skipped. Indexed attribute elements may be defined by appending the index to the attribute name separated by a hyphen.

Invalid attributes are returned in a map binding an invalid attribute name to a validation exception. An empty map indicates that all attributes were valid.

Note that if the attributes map does not contain any settable values, null is returned.

Parameters:
attributes - the attributes map.
localization - optional base name, resource bundle and locale.
Returns:
a map of invalid attributes, an empty map or null.

validateAttributeValues

SortedMap<String,Exception> validateAttributeValues()
Validates attribute values of the current attributes. Only dynamic writable attributes are validated, others skipped.

Invalid attributes are returned in a map binding an invalid attribute name to a validation exception. An empty map indicates that all attributes were valid.

Returns:
a map of invalid attributes or an empty map.

clearAttributeValues

void clearAttributeValues()
Clears attribute values of the current attributes. Only dynamic writable attributes are cleared, others skipped.


getValidatedValue

Object getValidatedValue(String name)
                         throws AttributeNotFoundException
Gets the value of a named dynamic attribute with validation.

Parameters:
name - the attribute name.
Returns:
the attribute value.
Throws:
AttributeNotFoundException - if the name is unknown.

setValidatedValue

void setValidatedValue(String name,
                       Object value,
                       Object... localization)
                       throws AttributeNotFoundException,
                              InvalidAttributeValueException
Sets the value of an attribute as a name value pair with validation. Only dynamic attributes can be set as a name value pair.

Parameters:
name - the attribute name.
value - the attribute value.
localization - optional base name, resource bundle and locale.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.

getValidatedElement

Object getValidatedElement(String name,
                           int index)
                           throws AttributeNotFoundException
Gets the indexed element of a dynamic array attribute with validation.

Parameters:
name - the attribute name.
index - the element index.
Returns:
the value of the element.
Throws:
AttributeNotFoundException - if the name is unknown.

setValidatedElement

void setValidatedElement(String name,
                         int index,
                         Object value,
                         Object... localization)
                         throws AttributeNotFoundException,
                                InvalidAttributeValueException
Sets the indexed element of a dynamic array attribute with validation.

Parameters:
name - the attribute name.
index - the element index.
value - the value of the element.
localization - optional base name, resource bundle and locale.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.

addValidatedElement

void addValidatedElement(String name,
                         Object... localizedValue)
                         throws AttributeNotFoundException,
                                InvalidAttributeValueException
Adds an element to a dynamic array attribute with validation.

Parameters:
name - the attribute name.
localizedValue - the value of the element and optional base name, resource bundle and locale.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.

addValidatedElement

void addValidatedElement(String name,
                         int index,
                         Object value,
                         Object... localization)
                         throws AttributeNotFoundException,
                                InvalidAttributeValueException
Adds an indexed element to a dynamic array attribute with validation.

Parameters:
name - the attribute name.
index - the element index.
value - the value of the element.
localization - optional base name, resource bundle and locale.
Throws:
AttributeNotFoundException - if the name is unknown.
InvalidAttributeValueException - if the value is invalid.

removeValidatedElement

boolean removeValidatedElement(String name,
                               Object... localizedValue)
                               throws AttributeNotFoundException
Removes an element from a dynamic array attribute with validation.

Nota that Java things that separate localization would be ambiguous with the indexed alternative to remove elements.

Parameters:
name - the attribute name.
localizedValue - the value of the element and optional base name, resource bundle and locale.
Returns:
true if removed.
Throws:
AttributeNotFoundException - if the name is unknown.

removeValidatedElement

Object removeValidatedElement(String name,
                              int index,
                              Object... localization)
                              throws AttributeNotFoundException
Removes the indexed element from a dynamic array attribute with validation.

Parameters:
name - the attribute name.
index - the element index.
localization - optional base name, resource bundle and locale.
Returns:
the removed value of the element.
Throws:
AttributeNotFoundException - if the name is unknown.

getRecursiveValue

Object getRecursiveValue(String name,
                         String... pattern)
                         throws AttributeNotFoundException
Gets the first non-recursive value of a named recursive dynamic attribute with validation.

Parameters:
name - the attribute name.
pattern - an optional pattern
Returns:
the attribute value.
Throws:
AttributeNotFoundException - if the name is unknown.

getRecursiveElement

Object getRecursiveElement(String name,
                           int index,
                           String... pattern)
                           throws AttributeNotFoundException
Gets the first non-recursive indexed element of an recursive dynamic array attribute with validation.

Parameters:
name - the attribute name.
index - the element index.
pattern - an optional pattern
Returns:
the value of the element.
Throws:
AttributeNotFoundException - if the name is unknown.

attributeLength

int attributeLength(String name)
                    throws AttributeNotFoundException
Returns the length of an array attribute.

Parameters:
name - the attribute name.
Returns:
the attribute array length.
Throws:
AttributeNotFoundException - if the name is unknown.

variableInfo

VariableInfo variableInfo(boolean... modifiable)
Returns optionally modifiable variable info of this variable.

Parameters:
modifiable - true to get modifiable info, false otherwise.
Returns:
the variable info.

attributeInfo

Collection<VariableAttributeInfo> attributeInfo()
Returns attribute info of dynamic attributes of this variable.

Returns:
a modifiable collection of VariableAttributeInfo instances.

addAttributeInfo

boolean addAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs,
                         int... position)
Adds attribute info of new attributes to this variable if they're not already present.

Parameters:
attrs - a collection of MBeanFeatureInfo instances.
position - the attribute position (-1 = at the end).
Returns:
true if new attributes were added, otherwise false.
Throws:
UnsupportedOperationException - if immutable.

replaceAttributeInfo

void replaceAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs)
Replaces attribute info of dynamic attributes of this variable.

Parameters:
attrs - a collection of MBeanFeatureInfo instances.
Throws:
UnsupportedOperationException - if immutable.

clearAttributeInfo

void clearAttributeInfo()
Clears attribute info of dynamic attributes of this variable.

Throws:
UnsupportedOperationException - if immutable.

attributeList

List<VariableAttributeInfo> attributeList(boolean... modifiable)
Returns optionally modifiable attribute info of all attributes in the definition order without internal attributes.

Parameters:
modifiable - true for modifiable, false otherwise.
Returns:
a read-only list of VariableAttributeInfo instances.

attributeInfo

VariableAttributeInfo attributeInfo(String name,
                                    boolean... modifiable)
Returns optionally modifiable or recursive attribute info of a named attribute.

Parameters:
name - the name of the attribute.
modifiable - true for modifiable and recursive, false otherwise.
Returns:
the attribute info or null if not found.

idAttributeList

List<VariableAttributeInfo> idAttributeList()
Returns attribute info of id attributes in the definition order.

Returns:
a read-only list of VariableAttributeInfo instances.

containsAttribute

boolean containsAttribute(String name)
Checks whether the named attribute exists.

Parameters:
name - the name of the attribute.
Returns:
true if found, otherwise false.

containsTrait

boolean containsTrait(VariableAttributeInfo.Trait trait)
Checks whether the specified trait is permanently on in any of the attributes.

Note that attributs of recursive elements are scanned, too.

Parameters:
trait - the trait to check.
Returns:
true if found, otherwise false.

attributePosition

int attributePosition(String name)
Returns the position of the named attribute.

Parameters:
name - the attribute name.
Returns:
the position of the atribute or -1 if not found.

getType

String getType()
Gets the type of this variable.

Returns:
the type.

getId

Object getId()
Gets the id of this variable corresponding to its primary attributes. The id may be a single value, an object array or null.

Returns:
the id or null if not defined.

setId

void setId(Object id)
           throws AttributeNotFoundException,
                  InvalidAttributeValueException
Sets the id of this variable corresponding to its primary attributes. The id may be a single value, an object array or null.

Note that ids of recursive elements are nullified, too.

Parameters:
id - the id or null if not defined.
Throws:
AttributeNotFoundException - if the id is unknown.
InvalidAttributeValueException - if the id is invalid.

importAttributes

AttributeList importAttributes(Object source,
                               AttributeFilter... filter)
Imports filtered attribute values from another object. The object can be an object name of an MBean, a reference to another variable or any Java object. Attributes not compatible with attributes of this variable are not imported.

Note that attributes of compatible types are accepted directly without validation.

Parameters:
source - the source object.
filter - an optional attribute filter to apply.
Returns:
a list of imported attributes.

exportAttributes

AttributeList exportAttributes(Object target,
                               AttributeFilter... filter)
Exports filtered attribute values to another object. The object can be an object name of an MBean, a reference to another variable or any Java object. Attributes not compatible with attributes of this variable are not exported.

Parameters:
target - the target object.
filter - an optional attribute filter to apply.
Returns:
a list of exported attributes.


Copyright © 2004 The Norther Organization. All rights reserved.