|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xeril.xml.ObjectToXml
This class is used to display an object in XML
Field Summary | |
static java.lang.String |
NULL_TAG
The constant for null objects |
Constructor Summary | |
ObjectToXml(java.io.PrintWriter out)
Constructor. |
Method Summary | |
protected void |
displayArray(java.lang.Object array,
java.lang.Class cl,
Indent ind,
XmlMapDescriptor map_desc,
java.lang.String tag_name)
Displays the value provided. |
protected void |
displayField(java.lang.Object value,
java.lang.Class cl,
Indent ind,
XmlMapDescriptor map_desc,
java.lang.String tag_name)
Displays a field. |
void |
displayObject(java.lang.Object o)
Displays an object in XML format. |
protected void |
displayObject(java.lang.Object o,
java.lang.Class cl,
Indent ind)
Displays an object in XML format. |
protected void |
displayValue(java.lang.Object value,
java.lang.Class cl,
Indent ind,
XmlMapDescriptor map_desc)
Displays the value provided. |
protected void |
displayValue(java.lang.Object value,
java.lang.Class cl,
Indent ind,
XmlMapper mapper)
Displays the value provided. |
protected XmlMapDescriptor |
getXmlMapDescriptor(java.lang.String field_name,
XmlInfo info)
Tries to extract the map descriptor the field_name and info object. |
static void |
objectToXml(java.lang.Object o,
java.io.PrintWriter out)
Displays an object in XML format. |
protected java.lang.String |
xmlizeString(java.lang.String original)
Returns a string which is clean for XML. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String NULL_TAG
Constructor Detail |
public ObjectToXml(java.io.PrintWriter out)
out
- the writer to write the xml resultMethod Detail |
public static void objectToXml(java.lang.Object o, java.io.PrintWriter out) throws java.lang.IllegalAccessException, XmlMapperException
o
- the object you want to displayout
- the print writer for writing the resultpublic void displayObject(java.lang.Object o) throws java.lang.IllegalAccessException, XmlMapperException
o
- the object you want to displayprotected void displayObject(java.lang.Object o, java.lang.Class cl, Indent ind) throws java.lang.IllegalAccessException, XmlMapperException
o
- the object you want to displaycl
- the class of the object (if o == null.. impossible to find!)ind
- the indentation objectprotected void displayField(java.lang.Object value, java.lang.Class cl, Indent ind, XmlMapDescriptor map_desc, java.lang.String tag_name) throws java.lang.IllegalAccessException, XmlMapperException
null
) to be able to (eventually) extract some information
from it.
value
- the value of the fieldcl
- the class of the fieldind
- the indentation objectmap_desc
- the map descriptortag_name
- the name of the tag of the fieldprotected void displayValue(java.lang.Object value, java.lang.Class cl, Indent ind, XmlMapDescriptor map_desc) throws XmlMapperException, java.lang.IllegalAccessException
value
- the value to displaycl
- the class of the valueind
- the indentation objectmap_desc
- the map descriptor object to find (eventually) a mapperprotected void displayValue(java.lang.Object value, java.lang.Class cl, Indent ind, XmlMapper mapper) throws XmlMapperException, java.lang.IllegalAccessException
value
- the value to displaycl
- the class of the valueind
- the indentation objectmapper
- the mapper to display the valueprotected void displayArray(java.lang.Object array, java.lang.Class cl, Indent ind, XmlMapDescriptor map_desc, java.lang.String tag_name) throws XmlMapperException, java.lang.IllegalAccessException
array
- the array to displaycl
- the class of the arrayind
- the indentation objectmap_desc
- the map descriptor object to find (eventually) a mappertag_name
- the name of the tagprotected XmlMapDescriptor getXmlMapDescriptor(java.lang.String field_name, XmlInfo info)
null
is
returned.
field_name
- the name of the field we are looking for its map descinfo
- the info object that may hold the tag nameprotected java.lang.String xmlizeString(java.lang.String original)
original
- the string to clean (it is safe to use null
)""
if
original == null
)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |