org.xeril.xml
Class SimpleXmlInfo

java.lang.Object
  |
  +--org.xeril.xml.SimpleXmlInfo
All Implemented Interfaces:
XmlInfo

public class SimpleXmlInfo
extends java.lang.Object
implements XmlInfo

This class simply implements the XmlInfo by providing some default values.


Constructor Summary
SimpleXmlInfo()
           
 
Method Summary
 XmlMapDescriptor[] getXmlMapDescriptors()
          You can associate a map descriptor with each field of your object.
 java.lang.String getXmlName()
          Returns the xml name that will be used.
static XmlMapDescriptor hide(java.lang.String field_name)
          This is a convenient method that returns and XmlMapDescriptor which simply hides the element.
static XmlMapDescriptor rename(java.lang.String field_name, java.lang.String xml_name)
          This is a convenient method that returns and XmlMapDescriptor which simply renames the element.
static XmlMapDescriptor setIndexedMapper(java.lang.String field_name, java.lang.String xml_name, XmlMapper indexed_mapper)
          This is a convenient method that returns and XmlMapDescriptor which sets an indexed mapper and rename
static XmlMapDescriptor setIndexedMapper(java.lang.String field_name, XmlMapper indexed_mapper)
          This is a convenient method that returns and XmlMapDescriptor which sets an indexed mapper.
static XmlMapDescriptor setMapper(java.lang.String field_name, java.lang.String xml_name, XmlMapper mapper)
          This is a convenient method that returns and XmlMapDescriptor which sets a mapper and rename
static XmlMapDescriptor setMapper(java.lang.String field_name, XmlMapper mapper)
          This is a convenient method that returns and XmlMapDescriptor which sets a mapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleXmlInfo

public SimpleXmlInfo()
Method Detail

getXmlMapDescriptors

public XmlMapDescriptor[] getXmlMapDescriptors()
You can associate a map descriptor with each field of your object. Basically a map descriptor is used to "map" a field name to an XML tag. It is also used to map a type.

Specified by:
getXmlMapDescriptors in interface XmlInfo
Returns:
an array of map descriptors
See Also:
XmlMapDescriptor

getXmlName

public java.lang.String getXmlName()
Returns the xml name that will be used. It's probably not very nice to have the tag name of an object to be the name of its class, thus this method allows you to override this default. The default simple implementation is to return "".

Specified by:
getXmlName in interface XmlInfo
Returns:
the xml name of this class

hide

public static XmlMapDescriptor hide(java.lang.String field_name)
This is a convenient method that returns and XmlMapDescriptor which simply hides the element.

Parameters:
field_name - the name of the field to hide
Returns:
the map descriptor

rename

public static XmlMapDescriptor rename(java.lang.String field_name,
                                      java.lang.String xml_name)
This is a convenient method that returns and XmlMapDescriptor which simply renames the element.

Parameters:
field_name - the name of the field to rename
xml_name - the name of the xml tag
Returns:
the map descriptor

setMapper

public static XmlMapDescriptor setMapper(java.lang.String field_name,
                                         XmlMapper mapper)
This is a convenient method that returns and XmlMapDescriptor which sets a mapper.

Parameters:
field_name - the name of the field to rename
mapper - the mapper to set
Returns:
the map descriptor

setMapper

public static XmlMapDescriptor setMapper(java.lang.String field_name,
                                         java.lang.String xml_name,
                                         XmlMapper mapper)
This is a convenient method that returns and XmlMapDescriptor which sets a mapper and rename

Parameters:
field_name - the name of the field to rename
xml_name - the name of the xml tag
mapper - the mapper to set
Returns:
the map descriptor

setIndexedMapper

public static XmlMapDescriptor setIndexedMapper(java.lang.String field_name,
                                                XmlMapper indexed_mapper)
This is a convenient method that returns and XmlMapDescriptor which sets an indexed mapper.

Parameters:
field_name - the name of the field to rename
indexed_mapper - the indexed mapper to set
Returns:
the map descriptor

setIndexedMapper

public static XmlMapDescriptor setIndexedMapper(java.lang.String field_name,
                                                java.lang.String xml_name,
                                                XmlMapper indexed_mapper)
This is a convenient method that returns and XmlMapDescriptor which sets an indexed mapper and rename

Parameters:
field_name - the name of the field to rename
xml_name - the name of the xml tag
indexed_mapper - the indexed mapper to set
Returns:
the map descriptor