Devsphere.com


com.devsphere.xml.taglib.output.write
Class Serializer

java.lang.Object
  |
  +--com.devsphere.xml.taglib.output.write.Serializer

public class Serializer
extends java.lang.Object

This class provides support for serializing SAX events and DOM trees.


Field Summary
protected  javax.xml.transform.Transformer domToStream
           
protected  Filter filter
           
protected  java.util.Properties properties
           
protected  javax.xml.transform.sax.TransformerHandler saxToStream
           
 
Constructor Summary
Serializer()
          Initializes the serializer
 
Method Summary
 javax.xml.transform.sax.TransformerHandler getHandler()
          Returns a SAX handler that can be used to serialize SAX events.
 java.io.Writer getOut()
          Gets the current writer used for output.
 java.util.Properties getOutputProperties()
          Gets the output properties of the serializer.
protected static javax.xml.transform.sax.SAXTransformerFactory getTransformerFactory()
          Returns a JAXP transformer factory.
 void setOut(java.io.Writer out)
          Sets the current writer used for output.
 void setOutputProperties(java.util.Properties properties)
          Sets the output properties of the serializer.
 void write(org.w3c.dom.Node dom)
          Serializes a DOM tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filter

protected Filter filter

properties

protected java.util.Properties properties

domToStream

protected javax.xml.transform.Transformer domToStream

saxToStream

protected javax.xml.transform.sax.TransformerHandler saxToStream
Constructor Detail

Serializer

public Serializer()
Initializes the serializer

Method Detail

getOut

public java.io.Writer getOut()
Gets the current writer used for output.

Returns:
the current writer used for output

setOut

public void setOut(java.io.Writer out)
Sets the current writer used for output.

Parameters:
out - the current writer used for output

getOutputProperties

public java.util.Properties getOutputProperties()
Gets the output properties of the serializer.

Returns:
the output properties

setOutputProperties

public void setOutputProperties(java.util.Properties properties)
Sets the output properties of the serializer.

Parameters:
properties - the output properties

write

public void write(org.w3c.dom.Node dom)
           throws javax.servlet.jsp.JspException
Serializes a DOM tree.

Parameters:
dom - the root of the DOM tree
Throws:
javax.servlet.jsp.JspException - to signal any error that might occur

getHandler

public javax.xml.transform.sax.TransformerHandler getHandler()
                                                      throws javax.servlet.jsp.JspException
Returns a SAX handler that can be used to serialize SAX events.

Returns:
a SAX handler that serializes SAX events
Throws:
javax.servlet.jsp.JspException - to signal any error that might occur

getTransformerFactory

protected static javax.xml.transform.sax.SAXTransformerFactory getTransformerFactory()
Returns a JAXP transformer factory.

Returns:
a JAXP transformer factory

 Devsphere.com