|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.rt.VariableX
public class VariableX
A lightweight Variable implementation supporting a fixed set of dynamic attributes by default. VariableX doesn't implement NotificationBroadcaster, which prevents its use with handles. The meta-data of the attribute set is locked and shared with other instances of the same virtual type making the memory footprint smaller.
Field Summary |
---|
Fields inherited from interface org.norther.tammi.core.base.ReferableMBean |
---|
MBEAN, NS |
Constructor Summary | |
---|---|
|
VariableX()
Constructs a new variable. |
protected |
VariableX(String type)
Constructs a new variable with a virtual type. |
|
VariableX(String type,
MBeanReference<? extends VariableRegistry> vr)
Constructs a new variable with a virtual type from the specified registry. |
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. |
protected boolean |
addAttributeInfoIfAbsent(int position,
Collection<VariableAttributeInfo> c)
Adds a collection of attribute info instances without cloning. |
void |
addTraceListener(TraceListener listener)
Adds a listener if 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. |
protected void |
attributeInfoRegistered(int position,
VariableAttributeInfo info)
Callback for a registered attribute info. |
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. |
void |
clearLastModified()
Clears the timestamp of the last modification of the traced object. |
void |
clearTraceListeners()
Clears all listeners from this traceable. |
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. |
boolean |
equals(Object other)
|
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. |
protected Object |
getAttributeValue(int position,
VariableAttributeInfo info,
boolean validate)
Gets the attribute value. |
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. |
protected Map<String,Object> |
getAttributeValues(boolean validate,
AttributeFilter... filter)
Gets attribute values. |
String |
getCanonicalName()
Gets the canonical object name of the MBean as a string. |
Object |
getId()
Gets the id of this variable corresponding to its primary attributes. |
protected Object |
getInternalAttributeValue(int position,
VariableAttributeInfo info,
boolean reset)
Gets the internal attribute value. |
long |
getLastModified()
Gets the timestamp of the last modification of the traced object. |
long |
getLastModified(Object key)
Gets the timestamp of the last modification of the specified resource. |
MBeanReference<Variable> |
getMBean()
Gets a reference to the MBean. |
MBeanInfo |
getMBeanInfo()
|
protected MBeanServer |
getMBeanServer()
Gets the MBean server. |
protected ObjectName |
getObjectName()
Gets the object name. |
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 |
invoke(String name,
Object[] params,
String[] signature)
|
boolean |
isEmpty()
Checks whether this variable contains any attributes. |
void |
postDeregister()
|
void |
postRegister(Boolean done)
|
void |
preDeregister()
|
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
|
protected void |
putAttributeElement(int position,
VariableAttributeInfo info,
int index,
boolean add,
Object value,
boolean validate,
Object... localization)
Puts the indexed attribute element with optional validation. |
protected Object |
putAttributeValue(int position,
VariableAttributeInfo info,
Object value,
boolean validate,
Object... localization)
Puts the attribute value with optional validation. |
protected boolean |
putAttributeValues(Map<?,?> attributes,
boolean localize,
AttributeFilter af,
Object... localization)
Puts attribute values. |
protected Object |
putInternalAttributeValue(int position,
VariableAttributeInfo info,
Object value,
boolean reset)
Puts the internal attribute value. |
protected Object |
putInternalAttributeValue(int position,
VariableAttributeInfo info,
Object value,
long timestamp,
boolean reset)
Puts the internal attribute value with a modification timestamp. |
protected void |
registerAttributeInfo(VariableInfo meta)
Registers attribute info. |
protected Object[] |
removeAttributeElement(int position,
VariableAttributeInfo info,
int index,
Object value,
boolean validate,
Object... localization)
Removes the specified attribute element with optional validation. |
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. |
void |
removeTraceListener(TraceListener listener)
Removes a listener. |
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 |
sendNotification(String message,
String name,
String type,
Object... values)
Sends a modification notification. |
void |
setAttribute(Attribute attr)
Sets the value of the given internal or dynamic attribute without access checks and any variable specific validation. |
protected void |
setAttributeElement(int position,
VariableAttributeInfo info,
int index,
boolean add,
Object value,
boolean validate,
Object... localization)
Sets the indexed attribute element with optional 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 |
setCanonicalName(String name)
Sets the canonical object name of the MBean as a string. |
void |
setId(Object id)
Sets the id of this variable corresponding to its primary attributes. |
void |
setLastModified(Object key,
long timestamp)
Sets the timestamp of the last modification of the specified resource. |
protected void |
setObjectName(ObjectName name)
Sets the object name. |
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. |
String |
toString()
|
protected Object |
validateAttributeValue(VariableAttributeInfo info,
Object value,
Object... localization)
Validates an attribute value by accessors and meta-data with run-time exceptions. |
SortedMap<String,Exception> |
validateAttributeValues()
Validates attribute values of the current attributes. |
protected SortedMap<String,Exception> |
validateAttributeValues(List<Variable> nested,
Map<?,?> attributes,
OrderedMap<String,Object> validated,
Object... localization)
Validates attribute values in a map of name value bindings. |
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. |
protected void |
validateMandatoryValue(VariableAttributeInfo info,
int index,
Object value)
Validates a mandatory attribute value with run-time exceptions. |
VariableInfo |
variableInfo(boolean... modifiable)
Returns optionally modifiable variable info of this variable. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VariableX()
public VariableX(String type, MBeanReference<? extends VariableRegistry> vr)
type
- the variable type.vr
- the variable registry.protected VariableX(String type)
type
- the variable type.Method Detail |
---|
public boolean equals(Object other)
equals
in class Object
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
preRegister
in interface MBeanRegistration
Exception
public void postRegister(Boolean done)
postRegister
in interface MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface MBeanRegistration
Exception
public void postDeregister()
postDeregister
in interface MBeanRegistration
public String toString()
toString
in class Object
public Object clone()
Variable
clone
in interface Variable
clone
in class Object
public MBeanReference<Variable> getMBean()
ReferableMBean
getMBean
in interface ReferableMBean<Variable>
public Object getAttribute(String name) throws AttributeNotFoundException, ReflectionException, MBeanException
Variable
getAttribute
in interface DynamicMBean
getAttribute
in interface Variable
name
- the attribute name.
AttributeNotFoundException
- if the name is unknown.
ReflectionException
- if a getter is not found.
MBeanException
- if getting of the value fails.public void setAttribute(Attribute attr) throws AttributeNotFoundException, InvalidAttributeValueException, ReflectionException, MBeanException
Variable
setAttribute
in interface DynamicMBean
setAttribute
in interface Variable
attr
- the attribute to set.
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.public AttributeList getAttributes(String[] names)
Variable
getAttributes
in interface DynamicMBean
getAttributes
in interface Variable
names
- an array of attribute names.
public AttributeList setAttributes(AttributeList attrs)
Variable
setAttributes
in interface DynamicMBean
setAttributes
in interface Variable
attrs
- the attributes to set.
public Map<String,Object> getAttributeValues()
Variable
getAttributeValues
in interface Variable
public void setAttributeValues(Map<?,?> attributes) throws InvalidAttributeValueException
Variable
This method provides compatibility with bean accessors.
setAttributeValues
in interface Variable
attributes
- the attributes map.
InvalidAttributeValueException
- if values are invalid.public void setAttributeValues(Map<?,?> attributes, Object... localization) throws InvalidAttributeValueException
Variable
setAttributeValues
in interface Variable
attributes
- the attributes map.localization
- optional base name, resource bundle and locale.
InvalidAttributeValueException
- if values are invalid.public Object getAttributeValue(String name) throws AttributeNotFoundException
Variable
getAttributeValue
in interface Variable
name
- the attribute name.
AttributeNotFoundException
- if the name is unknown.public void setAttributeValue(String name, Object value) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
setAttributeValue
in interface Variable
name
- the attribute name.value
- the attribute value.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.public Object getAttributeElement(String name, int index) throws AttributeNotFoundException
Variable
getAttributeElement
in interface Variable
name
- the attribute name.index
- the element index.
AttributeNotFoundException
- if the name is unknown.public void setAttributeElement(String name, int index, Object value) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
setAttributeElement
in interface Variable
name
- the attribute name.index
- the element index.value
- the value of the element.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.public void addAttributeElement(String name, Object value) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
addAttributeElement
in interface Variable
name
- the attribute name.value
- the value of the element.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.public void addAttributeElement(String name, int index, Object value) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
addAttributeElement
in interface Variable
name
- the attribute name.index
- the element index.value
- the value of the element.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.public boolean removeAttributeElement(String name, Object value) throws AttributeNotFoundException
Variable
removeAttributeElement
in interface Variable
name
- the attribute name.value
- the value of the element.
AttributeNotFoundException
- if the name is unknown.public Object removeAttributeElement(String name, int index) throws AttributeNotFoundException
Variable
removeAttributeElement
in interface Variable
name
- the attribute name.index
- the element index.
AttributeNotFoundException
- if the name is unknown.public Map<String,Object> validatedValues(AttributeFilter... filter)
Variable
validatedValues
in interface Variable
filter
- an optional filter.
public SortedMap<String,Exception> resetValidatedValues(Map<?,?> attributes, Object... localization)
Variable
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.
resetValidatedValues
in interface Variable
attributes
- the attributes map.localization
- optional base name, resource bundle and locale.
public SortedMap<String,Exception> validateAttributeValues(Map<?,?> attributes, Object... localization)
Variable
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.
validateAttributeValues
in interface Variable
attributes
- the attributes map.localization
- optional base name, resource bundle and locale.
public SortedMap<String,Exception> validateAttributeValues()
Variable
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.
validateAttributeValues
in interface Variable
public void clearAttributeValues()
Variable
clearAttributeValues
in interface Variable
public Object getValidatedValue(String name) throws AttributeNotFoundException
Variable
getValidatedValue
in interface Variable
name
- the attribute name.
AttributeNotFoundException
- if the name is unknown.public void setValidatedValue(String name, Object value, Object... localization) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
setValidatedValue
in interface Variable
name
- the attribute name.value
- the attribute value.localization
- optional base name, resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.public Object getValidatedElement(String name, int index) throws AttributeNotFoundException
Variable
getValidatedElement
in interface Variable
name
- the attribute name.index
- the element index.
AttributeNotFoundException
- if the name is unknown.public void setValidatedElement(String name, int index, Object value, Object... localization) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
setValidatedElement
in interface Variable
name
- the attribute name.index
- the element index.value
- the value of the element.localization
- optional base name, resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.public void addValidatedElement(String name, Object... localizedValue) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
addValidatedElement
in interface Variable
name
- the attribute name.localizedValue
- the value of the element and optional base name,
resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.public void addValidatedElement(String name, int index, Object value, Object... localization) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
addValidatedElement
in interface Variable
name
- the attribute name.index
- the element index.value
- the value of the element.localization
- optional base name, resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.
InvalidAttributeValueException
- if the value is invalid.public boolean removeValidatedElement(String name, Object... localizedValue) throws AttributeNotFoundException
Variable
Nota that Java things that separate localization would be ambiguous with the indexed alternative to remove elements.
removeValidatedElement
in interface Variable
name
- the attribute name.localizedValue
- the value of the element and optional base name,
resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.public Object removeValidatedElement(String name, int index, Object... localization) throws AttributeNotFoundException
Variable
removeValidatedElement
in interface Variable
name
- the attribute name.index
- the element index.localization
- optional base name, resource bundle and locale.
AttributeNotFoundException
- if the name is unknown.public Object getRecursiveValue(String name, String... pattern) throws AttributeNotFoundException
Variable
getRecursiveValue
in interface Variable
name
- the attribute name.pattern
- an optional pattern
AttributeNotFoundException
- if the name is unknown.public Object getRecursiveElement(String name, int index, String... pattern) throws AttributeNotFoundException
Variable
getRecursiveElement
in interface Variable
name
- the attribute name.index
- the element index.pattern
- an optional pattern
AttributeNotFoundException
- if the name is unknown.public int attributeLength(String name) throws AttributeNotFoundException
Variable
attributeLength
in interface Variable
name
- the attribute name.
AttributeNotFoundException
- if the name is unknown.public VariableInfo variableInfo(boolean... modifiable)
Variable
variableInfo
in interface Variable
modifiable
- true to get modifiable info, false otherwise.
public Collection<VariableAttributeInfo> attributeInfo()
Variable
attributeInfo
in interface Variable
public boolean addAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs, int... position)
Variable
addAttributeInfo
in interface Variable
attrs
- a collection of MBeanFeatureInfo instances.position
- the attribute position (-1 = at the end).
public void replaceAttributeInfo(Collection<? extends MBeanFeatureInfo> attrs)
Variable
replaceAttributeInfo
in interface Variable
attrs
- a collection of MBeanFeatureInfo instances.public void clearAttributeInfo()
Variable
clearAttributeInfo
in interface Variable
public List<VariableAttributeInfo> attributeList(boolean... modifiable)
Variable
attributeList
in interface Variable
modifiable
- true for modifiable, false otherwise.
public VariableAttributeInfo attributeInfo(String name, boolean... modifiable)
Variable
attributeInfo
in interface Variable
name
- the name of the attribute.modifiable
- true for modifiable and recursive, false otherwise.
public List<VariableAttributeInfo> idAttributeList()
Variable
idAttributeList
in interface Variable
public boolean containsAttribute(String name)
Variable
containsAttribute
in interface Variable
name
- the name of the attribute.
public boolean containsTrait(VariableAttributeInfo.Trait trait)
Variable
Note that attributs of recursive elements are scanned, too.
containsTrait
in interface Variable
trait
- the trait to check.
public int attributePosition(String name)
Variable
attributePosition
in interface Variable
name
- the attribute name.
public String getType()
Variable
getType
in interface Variable
public Object getId()
Variable
getId
in interface Variable
public void setId(Object id) throws AttributeNotFoundException, InvalidAttributeValueException
Variable
Note that ids of recursive elements are nullified, too.
setId
in interface Variable
id
- the id or null if not defined.
AttributeNotFoundException
- if the id is unknown.
InvalidAttributeValueException
- if the id is invalid.public AttributeList importAttributes(Object source, AttributeFilter... filter)
Variable
Note that attributes of compatible types are accepted directly without validation.
importAttributes
in interface Variable
source
- the source object.filter
- an optional attribute filter to apply.
public AttributeList exportAttributes(Object target, AttributeFilter... filter)
Variable
exportAttributes
in interface Variable
target
- the target object.filter
- an optional attribute filter to apply.
public Object invoke(String name, Object[] params, String[] signature) throws MBeanException, ReflectionException
invoke
in interface DynamicMBean
MBeanException
ReflectionException
public MBeanInfo getMBeanInfo()
getMBeanInfo
in interface DynamicMBean
public String getCanonicalName()
Identifiable
getCanonicalName
in interface Identifiable
public void setCanonicalName(String name) throws MalformedObjectNameException
Identifiable
setCanonicalName
in interface Identifiable
name
- the canonical object name as a string.
MalformedObjectNameException
- for an invalid name.public long getLastModified()
Traceable
getLastModified
in interface Traceable
public long getLastModified(Object key)
Traceable
getLastModified
in interface Traceable
key
- the key of the resource.
public void setLastModified(Object key, long timestamp)
Traceable
setLastModified
in interface Traceable
key
- the key of the resource.timestamp
- the modification timestamp.public void clearLastModified()
Traceable
clearLastModified
in interface Traceable
public void addTraceListener(TraceListener listener)
Traceable
addTraceListener
in interface Traceable
listener
- a listener to add.public void removeTraceListener(TraceListener listener)
Traceable
removeTraceListener
in interface Traceable
listener
- the listener to remove.public void clearTraceListeners()
Traceable
clearTraceListeners
in interface Traceable
public boolean isEmpty()
public void sendNotification(String message, String name, String type, Object... values)
NotificationEmitter
interface can implement this method also
to provide modification notifications.
message
- the notification message.name
- the attribute name.type
- the attribute type.values
- the old and new values of the attribute.protected ObjectName getObjectName()
protected void setObjectName(ObjectName name)
name
- the object name.
IllegalStateException
- if already registered.protected MBeanServer getMBeanServer()
protected Map<String,Object> getAttributeValues(boolean validate, AttributeFilter... filter)
validate
- true to validate.filter
- an optional filter.
protected boolean putAttributeValues(Map<?,?> attributes, boolean localize, AttributeFilter af, Object... localization) throws InvalidAttributeValueException
attributes
- a map of validated attributes.localize
- true to apply localization.af
- an optional filter.localization
- optional base name, resource bundle and locale.
InvalidAttributeValueException
- if values are invalid.protected Object getAttributeValue(int position, VariableAttributeInfo info, boolean validate)
position
- the attribute position.info
- the attribute to get.validate
- true for validation, false otherwise.
protected Object putAttributeValue(int position, VariableAttributeInfo info, Object value, boolean validate, Object... localization) throws InvalidAttributeValueException
position
- the attribute position.info
- the attribute to set.value
- the attribute value.validate
- true for full validation, false for meta-data only.localization
- optional base name, resource bundle and locale.
InvalidAttributeValueException
- if the value is invalid.protected void setAttributeElement(int position, VariableAttributeInfo info, int index, boolean add, Object value, boolean validate, Object... localization) throws InvalidAttributeValueException
position
- the attribute position.info
- the attribute to set.index
- the element index.add
- true if to be added.value
- the attribute element.validate
- true for full validation, false for meta-data only.localization
- optional base name, resource bundle and locale.
InvalidAttributeValueException
- if the value is invalid.protected Object[] removeAttributeElement(int position, VariableAttributeInfo info, int index, Object value, boolean validate, Object... localization)
position
- the attribute position.info
- the attribute to remove.index
- the element index.value
- the element value.validate
- true for full validation, false for meta-data only.localization
- optional base name, resource bundle and locale.
protected void putAttributeElement(int position, VariableAttributeInfo info, int index, boolean add, Object value, boolean validate, Object... localization)
position
- the attribute position.info
- the attribute to put.index
- the value index.add
- true if to be added.value
- the attribute value.validate
- true to validate, false otherwise.localization
- optional base name, resource bundle and locale.protected SortedMap<String,Exception> validateAttributeValues(List<Variable> nested, Map<?,?> attributes, OrderedMap<String,Object> validated, Object... localization)
Valid attributes are added to a map binding a valid attribute name to its value.
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.
nested
- stack of nested variables.attributes
- the attributes map.validated
- the validated attributes map.localization
- optional base name, resource bundle and locale.
protected Object validateAttributeValue(VariableAttributeInfo info, Object value, Object... localization)
info
- the attribute to validate.value
- the attribute value.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.
ShadowValueException
- if the value is a shadow value.
IllegalArgumentException
- if the value is invalid.
IndexOutOfBoundsException
- if array indices are exceeded.
IllegalStateException
- if the attribute is not writable.protected void validateMandatoryValue(VariableAttributeInfo info, int index, Object value)
info
- the attribute to validate.index
- the index of an element.value
- the attribute value.
NullPointerException
- if a mandatory attribute is null.protected Object getInternalAttributeValue(int position, VariableAttributeInfo info, boolean reset)
position
- the attribute position.info
- the attribute to get.reset
- true to reset access rights, false otherwise.
protected Object putInternalAttributeValue(int position, VariableAttributeInfo info, Object value, boolean reset)
position
- the attribute position.info
- the attribute to put.value
- the attribute value.reset
- true to reset access rights, false otherwise.
protected Object putInternalAttributeValue(int position, VariableAttributeInfo info, Object value, long timestamp, boolean reset)
position
- the attribute position.info
- the attribute to put.value
- the attribute value.timestamp
- the timestamp.reset
- true to reset access rights, false otherwise.
protected void registerAttributeInfo(VariableInfo meta)
meta
- the variable info.protected boolean addAttributeInfoIfAbsent(int position, Collection<VariableAttributeInfo> c)
position
- the position index (-1 = at the end).c
- a collection of VariableAttributeInfo instances.
UnsupportedOperationException
- if immutable.protected void attributeInfoRegistered(int position, VariableAttributeInfo info)
position
- the attribute position.info
- the registered attribute.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |