com.redspr.beanldom
Interface ClassInfo

All Known Implementing Classes:
BaseInfo

public interface ClassInfo

Superset of methods needed by clients to the cache of Object to XML mapping information. Could have modelled this using real polymorphism but seemed like overkill.

Author:
Sam Hough

Field Summary
static int ARRAY
          should be accessed as an array
static int BEAN
          - terrible name
static int VALUE
          should be converted into a string as a TextNode or attribute value
 
Method Summary
 Object[] getArray(Object target)
          called if type == ARRAY.
 PropertyInfo[] getAttributes()
          list of attributes for this class.
 PropertyInfo[] getElements()
          list of elements for this class.
 int getType()
          How should the implementation handle objects of this class
 String getValue(Object target)
          convert target to a string.
 

Field Detail

BEAN

public static final int BEAN
- terrible name

See Also:
Constant Field Values

VALUE

public static final int VALUE
should be converted into a string as a TextNode or attribute value

See Also:
Constant Field Values

ARRAY

public static final int ARRAY
should be accessed as an array

See Also:
Constant Field Values
Method Detail

getType

public int getType()
How should the implementation handle objects of this class


getValue

public String getValue(Object target)
convert target to a string. Clients are obliged to use this method to convert objects of this class to strings if getType has returned VALUE. Returns null to indicate no value for an attribute/not text element for element.


getArray

public Object[] getArray(Object target)
called if type == ARRAY. NB Class of the array is used to determine mapping. Not class of each object.


getAttributes

public PropertyInfo[] getAttributes()
list of attributes for this class. Return a zero length array if none.


getElements

public PropertyInfo[] getElements()
list of elements for this class. Return a zero length array if none. NB one entry even for an array.