org.norther.tammi.root.ojb.util
Class PersistentFieldVariableImpl

java.lang.Object
  extended by org.norther.tammi.root.ojb.util.PersistentFieldVariableImpl
All Implemented Interfaces:
Serializable, PersistentField

public class PersistentFieldVariableImpl
extends Object
implements PersistentField, Serializable

Implements a persistent field accessor for attributes of Variables. Other types of MBeans and Java Beans are supported as well.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
static String PATH_TOKEN_EXPRESSION
          The field path delimiter.
 
Constructor Summary
PersistentFieldVariableImpl(Class type, String name)
          Constructs a new persistent field.
 
Method Summary
 Object get(Object variable)
          Gets the value of the attribute of the specified variable.
protected  Object get(Object variable, PropertyDescriptor pd)
          Gets the value of the specified property of the specified variable.
protected  Object get(Object variable, VariableAttributeInfo info)
          Gets the value of the specified attribute of the specified variable.
protected  Object getAttributeDescriptor()
          Gets the attribute descriptor.
protected  Object[] getAttributeGraph(Object variable)
          Gets the attribute graph.
 Class getDeclaringClass()
           
 String getName()
           
 Class getType()
           
 void set(Object variable, Object value)
          Sets the value of the attribute of the specified variable.
protected  void set(Object variable, PropertyDescriptor pd, Object value)
          Sets the value of the specified property of the specified variable.
protected  void set(Object variable, VariableAttributeInfo info, Object value)
          Sets the value of the specified attribute of the specified variable.
 String toString()
           
 boolean usesAccessorsAndMutators()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PATH_TOKEN_EXPRESSION

public static final String PATH_TOKEN_EXPRESSION
The field path delimiter.

See Also:
Constant Field Values
Constructor Detail

PersistentFieldVariableImpl

public PersistentFieldVariableImpl(Class type,
                                   String name)
Constructs a new persistent field.

Parameters:
type - the variable type.
name - the attribute name.
Method Detail

getName

public String getName()
Specified by:
getName in interface PersistentField

getType

public Class getType()
Specified by:
getType in interface PersistentField

getDeclaringClass

public Class getDeclaringClass()
Specified by:
getDeclaringClass in interface PersistentField

usesAccessorsAndMutators

public boolean usesAccessorsAndMutators()
Specified by:
usesAccessorsAndMutators in interface PersistentField

get

public Object get(Object variable)
Gets the value of the attribute of the specified variable.

For Variables, a string representation is returned if the attribute is serialized.

Specified by:
get in interface PersistentField
Parameters:
variable - the variable.
Returns:
the attribute value.
Throws:
MetadataException - on errors.

set

public void set(Object variable,
                Object value)
         throws PersistenceBrokerException
Sets the value of the attribute of the specified variable.

Specified by:
set in interface PersistentField
Parameters:
variable - the variable.
value - the attribute value.
Throws:
PersistenceBrokerException - on errors.

toString

public String toString()
Overrides:
toString in class Object

get

protected Object get(Object variable,
                     VariableAttributeInfo info)
Gets the value of the specified attribute of the specified variable.

Parameters:
variable - the variable.
info - the attribute info.
Returns:
the attribute value.
Throws:
MetadataException - on errors.

get

protected Object get(Object variable,
                     PropertyDescriptor pd)
Gets the value of the specified property of the specified variable.

Parameters:
variable - the variable.
pd - the property descriptor.
Returns:
the attribute value.
Throws:
MetadataException - on errors.

set

protected void set(Object variable,
                   VariableAttributeInfo info,
                   Object value)
Sets the value of the specified attribute of the specified variable.

Parameters:
variable - the variable.
info - the attribute info.
value - the attribute value.
Throws:
MetadataException - on errors.

set

protected void set(Object variable,
                   PropertyDescriptor pd,
                   Object value)
Sets the value of the specified property of the specified variable.

Parameters:
variable - the variable.
pd - the property descriptor.
value - the attribute value.
Throws:
MetadataException - on errors.

getAttributeDescriptor

protected Object getAttributeDescriptor()
Gets the attribute descriptor.

Returns:
the attribute descriptor.
Throws:
MetadataException - on introspection errors.

getAttributeGraph

protected Object[] getAttributeGraph(Object variable)
Gets the attribute graph.

Parameters:
variable - the variable.
Returns:
the attribute graph.
Throws:
MetadataException - on introspection errors.


Copyright © 2004 The Norther Organization. All rights reserved.