com.bowstreet.util
Interface JSON2XMLHandler

All Known Implementing Classes:
JSON2XMLHandlerImpl

public interface JSON2XMLHandler

Interface used to support converting JSON to XML.
These interface methods are called during the conversion process of JSON to XML.

See Also:
JSONUtil, JSON2XMLHandlerImpl

Method Summary
 void beginArray(IXml parent)
          Called at the beginning of processing a JSON Array.
 void beginData(IXml parent, java.lang.String value)
          Called to add a text value to the specified parent element.
 IXml beginDocument()
          Called at the beginning of the JSON to XML conversion.
 IXml beginElement(IXml parent, java.lang.String name)
          Called to add a new child element to the specified parent.
 void endArray(IXml parent)
          Called at the end of processing a JSON Array.
 void endData(IXml parent)
          Called at the end of data creation.
 void endDocument(IXml document)
          Called at the end of the JSON to XML conversion.
 void endElement(IXml element)
          Called at the end of element creation.
 

Method Detail

beginArray

void beginArray(IXml parent)
Called at the beginning of processing a JSON Array.

Parameters:
parent - The parent element of the array.

beginData

void beginData(IXml parent,
               java.lang.String value)
Called to add a text value to the specified parent element.

Parameters:
parent - The parent which to add the data to.
value - The text value to be added.

beginDocument

IXml beginDocument()
Called at the beginning of the JSON to XML conversion.
This method must create and return a new IXml element, which will be used as the document root.

Returns:
A new IXml element.

beginElement

IXml beginElement(IXml parent,
                  java.lang.String name)
Called to add a new child element to the specified parent.
This method must create and return a new IXml element, which will be used as the new element.

Parameters:
parent - The parent which to add the new element to.
Returns:
A new IXml element.

endArray

void endArray(IXml parent)
Called at the end of processing a JSON Array.

Parameters:
parent - The parent element of the array.

endData

void endData(IXml parent)
Called at the end of data creation.

Parameters:
element - The element that data was added to.

endDocument

void endDocument(IXml document)
Called at the end of the JSON to XML conversion.

Parameters:
document - The document root IXml element.

endElement

void endElement(IXml element)
Called at the end of element creation.

Parameters:
element - The element that was created.


Copyright © 2009 IBM. All Rights Reserved.