de.ispsoft.jaxme
Interface Parselet


public interface Parselet

A Parselet can serialize an element or attribute into a character stream. Vice versa, it can deserialize the character stream into an element or attribute.

Author:
Stefan Becher, Jochen Wiedmann

Method Summary
 java.lang.Object parse(java.lang.Object pData)
          Called for parsing a character stream and returning an object with the parsed data.
 void serialize(java.lang.Object pSerializable, java.lang.Object pData)
          Called for serializing an element or attribute.
 

Method Detail

serialize

public void serialize(java.lang.Object pSerializable,
                      java.lang.Object pData)
               throws org.xml.sax.SAXException

Called for serializing an element or attribute.

Parameters:
pSerializable - The element or attribute to serialize. Null is a valid value:
  • For attributes and elements with multiplicity 0 or 1, the null means that the attribute or element is missing.
  • For elements with multiplicity > 1 the method is called multiple times, always receiving one value. Finally the method is called again, indicating the end of the value list.
pData - The object to serialize the pSerializable into.
Throws:
org.xml.sax.SAXException

parse

public java.lang.Object parse(java.lang.Object pData)
                       throws org.xml.sax.SAXException

Called for parsing a character stream and returning an object with the parsed data.

Returns:
Attribute or element value, null has a special meaning:
  • For attributes and elements with multiplicity 0 or 1, the null means that the attribute or element is omitted.
  • For elements with multiplicity > 1 the method is called multiple times, always returing one value, until it returns null. The null indicates the end of the value list.
Throws:
org.xml.sax.SAXException