com.lifecde.jxm
Class ClassToXMLMap

java.lang.Object
  |
  +--com.lifecde.jxm.ClassToXMLMap

public class ClassToXMLMap
extends java.lang.Object

Maps Class field names and values to XML.

Author:
Brian King

Field Summary
protected static Log log
           
protected  XMLNaming namePolicy
          name translation policy
 
Constructor Summary
ClassToXMLMap()
           
 
Method Summary
 java.lang.Object getID(java.lang.Object obj)
          Get the value used as an XML ID.
 XMLAttributeMap[] getXMLAttributes(java.lang.Object obj)
           
 ElementMap[] getXMLElements(java.lang.Object obj)
          Get related object to XML child element map.
 java.lang.String getXMLName(java.lang.Object obj)
          Get the XML element name for the given class.
 boolean isCollection(java.lang.Class c)
          The class represents a Collection if it is an array, a sub-class of java.util.Collection, or java.util.Iterator.
protected  boolean isSimpleType(java.lang.Class c)
          Return true if the Class is a primitive, such as String, Character, Byte, etc.
protected  java.lang.String methodToAttribute(java.lang.String name)
          Given a Java accessor method name return an XML attribute name.
protected  java.lang.String relationshipToElement(java.lang.String name)
          Given a Java accessor method name return an XML element name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Log log

namePolicy

protected XMLNaming namePolicy
name translation policy

Constructor Detail

ClassToXMLMap

public ClassToXMLMap()
Method Detail

getID

public java.lang.Object getID(java.lang.Object obj)
Get the value used as an XML ID. Return null if there is none.


getXMLName

public java.lang.String getXMLName(java.lang.Object obj)
Get the XML element name for the given class.


getXMLAttributes

public XMLAttributeMap[] getXMLAttributes(java.lang.Object obj)

getXMLElements

public ElementMap[] getXMLElements(java.lang.Object obj)
Get related object to XML child element map.


isCollection

public boolean isCollection(java.lang.Class c)
The class represents a Collection if it is an array, a sub-class of java.util.Collection, or java.util.Iterator.

Parameters:
c - the class to test

isSimpleType

protected boolean isSimpleType(java.lang.Class c)
Return true if the Class is a primitive, such as String, Character, Byte, etc.


methodToAttribute

protected java.lang.String methodToAttribute(java.lang.String name)
Given a Java accessor method name return an XML attribute name.


relationshipToElement

protected java.lang.String relationshipToElement(java.lang.String name)
Given a Java accessor method name return an XML element name.