|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
XMLConvertor defines how XMLData will be extracted from and written to other objects (typcially properties and beans).
The interface returns data in the XMLData format, which is a minimal DOM structure. Each convertor should only return the XMLData structure for its own internal data passed on the passed in object. If the object contains references to other objects that have their own XML convertors, the content field should be set to the object.
Typically, this means that an XMLData instance has a number of children, each of which have either String or object content. However, if an object needs to create a more complex structure it can do.
Method Summary | |
void |
buildXMLData(XMLConvertorContext context,
XMLData parent,
java.lang.Object object)
Build the XMLData representation of the object passed in. |
void |
expandXMLData(XMLConvertorContext context,
XMLData data)
Expand the collapsed XMLData object passed in. |
boolean |
isConvertorFor(java.lang.Object object)
Check to see if this convertor handles the object. |
Method Detail |
public boolean isConvertorFor(java.lang.Object object)
object
- the object to check
public void buildXMLData(XMLConvertorContext context, XMLData parent, java.lang.Object object)
To avoid the need to build the entire DOM tree, it is possible to return a collapsed XMLData object. This is typically where a bean holds a reference to another bean. A collapsed XMLData is created by setting the content to the referenced bean. The expandXMLData method will then be called to get that data at the appropriate time.
context
- the context for the outputparent
- the parent XMLData to add toobject
- the object to convertpublic void expandXMLData(XMLConvertorContext context, XMLData data)
The object (typically a bean) to expand is stored in the content field of the passed in XMLData.
context
- the context for the outputdata
- the XMLData to add to
|
Joda System API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |