org.ws4d.java.types
Class CustomizeMDataHandler

java.lang.Object
  extended by org.ws4d.java.types.CustomizeMDataHandler
All Implemented Interfaces:
ElementHandler

public class CustomizeMDataHandler
extends java.lang.Object
implements ElementHandler

This class implement a generic handler for user added customize metadata


Method Summary
static CustomizeMDataHandler getInstance()
          Give a static instance of the CustomizeMDataHandler
 java.lang.Object handleElement(QName elementName, ElementParser parser)
          Processes the content (both child elements and attributes) of the element with the specified elementName and returns its representation as a Java object.
 void serializeElement(XmlSerializer serializer, QName qname, java.lang.Object data)
          Method to serialize the UnknownElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

handleElement

public java.lang.Object handleElement(QName elementName,
                                      ElementParser parser)
                               throws org.xmlpull.v1.XmlPullParserException,
                                      java.io.IOException
Description copied from interface: ElementHandler
Processes the content (both child elements and attributes) of the element with the specified elementName and returns its representation as a Java object. The element content can be obtained successively from the provided parser. It is guaranteed that this parser will be always namespace-aware. Note that the parser's current position is already at the start position of the current element, that is, the following assumptions hold immediately after entering this method:

parser.getEventType() == XmlPullParser.START_TAG

parser.getName() == elementName.getLocalPart()

parser.getNamespace() == elementName.getNamespace()

Attention! The provided parser supports neither custom properties, nor any features! Also, it doesn't accept any entity replacement text.

Specified by:
handleElement in interface ElementHandler
Parameters:
elementName - the qualified name of the element to process
parser - the parser to obtain element data from
Returns:
a Java object corresponding to the content of the given XML element
Throws:
org.xmlpull.v1.XmlPullParserException - if an error during processing of the element content occurs
java.io.IOException - if an error during reading the element source occurs
See Also:
ElementHandler.handleElement(QName, ElementParser)

serializeElement

public void serializeElement(XmlSerializer serializer,
                             QName qname,
                             java.lang.Object data)
                      throws java.lang.IllegalArgumentException,
                             WS4DIllegalStateException,
                             java.io.IOException
Description copied from interface: ElementHandler
Method to serialize the UnknownElement

Specified by:
serializeElement in interface ElementHandler
Parameters:
serializer - ,the Serializer which is used to serialize the UnknownElement
qname - ,the qualified name of the UnknownElement to process
data - ,the value of the UnknownElement
Throws:
java.lang.IllegalArgumentException
WS4DIllegalStateException
java.io.IOException
See Also:
ElementHandler.serializeElement(XmlSerializer, QName, Object)

getInstance

public static CustomizeMDataHandler getInstance()
Give a static instance of the CustomizeMDataHandler

Returns: