com.redspr.beanldom.info
Class BaseInfo

java.lang.Object
  |
  +--com.redspr.beanldom.info.BaseInfo
All Implemented Interfaces:
ClassInfo
Direct Known Subclasses:
ArrayInfo, LBeanInfo, ValueInfo

public abstract class BaseInfo
extends Object
implements ClassInfo

Create default behaviour for ClassInfo objects.

Author:
Sam Hough

Field Summary
 
Fields inherited from interface com.redspr.beanldom.ClassInfo
ARRAY, BEAN, VALUE
 
Constructor Summary
BaseInfo()
           
 
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.
 String getValue(Object target)
          convert target to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.redspr.beanldom.ClassInfo
getType
 

Constructor Detail

BaseInfo

public BaseInfo()
Method Detail

getValue

public String getValue(Object target)
Description copied from interface: ClassInfo
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.

Specified by:
getValue in interface ClassInfo

getArray

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

Specified by:
getArray in interface ClassInfo

getAttributes

public PropertyInfo[] getAttributes()
Description copied from interface: ClassInfo
list of attributes for this class. Return a zero length array if none.

Specified by:
getAttributes in interface ClassInfo

getElements

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

Specified by:
getElements in interface ClassInfo