com.skaringa.javaxml.handler.sax
Class DocumentInputHandler

java.lang.Object
  extended by com.skaringa.javaxml.handler.sax.DocumentInputHandler

public final class DocumentInputHandler
extends java.lang.Object

Class that handles events from a SAXInputHandler. It constitutes a new object according to the SAX events.


Constructor Summary
DocumentInputHandler()
           
 
Method Summary
 void appendText(char[] ch, int start, int length)
          Called if a text node is found in the XML input.
 void endDocument()
          Called at the end of a document.
 void endElement(java.lang.String name)
          Called at the end of an element.
 java.lang.ClassLoader getClassLoader()
          Get the class loader used to load classes during deserialization.
 java.lang.Object getObject()
          Get the deserialized object.
 java.util.Map getProperties()
          Get the properties of the InputHandler
 void setClassLoader(java.lang.ClassLoader loader)
          Set the class loader used to load classes during deserialization.
 void setProperties(java.util.Map propertyMap)
          Set the properties of the InputHandler
 void startDocument()
          Called at the start of a document.
 void startElement(java.lang.String name, org.xml.sax.Attributes attrs)
          Called at the start of an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentInputHandler

public DocumentInputHandler()
Method Detail

getObject

public java.lang.Object getObject()
Get the deserialized object.

Returns:
The new Object.

startDocument

public void startDocument()
Called at the start of a document. Does nothing.


endDocument

public void endDocument()
Called at the end of a document. Does nothing.


startElement

public void startElement(java.lang.String name,
                         org.xml.sax.Attributes attrs)
                  throws DeserializerException
Called at the start of an element. It figures out the deserializer of the element and calls its startDeserialize method.

Parameters:
name - The element name.
attrs - The attributes of the element.
Throws:
DeserializerException - If the deserialization failes.

appendText

public void appendText(char[] ch,
                       int start,
                       int length)
Called if a text node is found in the XML input.

Parameters:
ch - Character array containing the text.
start - Start position of the text in the array.
length - Length of the text in the array.

endElement

public void endElement(java.lang.String name)
                throws DeserializerException
Called at the end of an element. It retrieves the deserializer and object that were created in startElement and calls endDeserialize. The object created this way is then populated to the member of its parent.

Parameters:
name - The element name.
Throws:
DeserializerException - If the deserialization failes.

setProperties

public void setProperties(java.util.Map propertyMap)
Set the properties of the InputHandler

Parameters:
propertyMap - The properties.

getProperties

public java.util.Map getProperties()
Get the properties of the InputHandler

Returns:
The properties.

setClassLoader

public void setClassLoader(java.lang.ClassLoader loader)
Set the class loader used to load classes during deserialization.

Parameters:
loader - The class loader.

getClassLoader

public java.lang.ClassLoader getClassLoader()
Get the class loader used to load classes during deserialization.

Returns:
The class loader.