org.milyn.delivery.sax
Class DefaultSAXElementSerializer

java.lang.Object
  extended by org.milyn.delivery.sax.DefaultSAXElementSerializer
All Implemented Interfaces:
ContentHandler, SAXElementVisitor, SAXVisitAfter, SAXVisitBefore, SAXVisitChildren, SAXVisitor, Visitor

public class DefaultSAXElementSerializer
extends Object
implements SAXElementVisitor

Default Serializer for SAX Filtering.

Author:
tom.fennelly@gmail.com

Constructor Summary
DefaultSAXElementSerializer()
           
 
Method Summary
 boolean isStartWritten(SAXElement element)
           
 void onChildElement(SAXElement element, SAXElement childElement, ExecutionContext executionContext)
          Process the onChildElement event for the targeted element.
 void onChildText(SAXElement element, SAXText text, ExecutionContext executionContext)
          Process the onChildText event for the targeted element.
 void setWriterOwner(SAXVisitor writerOwner)
           
 void visitAfter(SAXElement element, ExecutionContext executionContext)
          Visit the supplied element after visiting its child elements.
 void visitBefore(SAXElement element, ExecutionContext executionContext)
          Visit the supplied element before visiting its child elements.
 void writeStartElement(SAXElement element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSAXElementSerializer

public DefaultSAXElementSerializer()
Method Detail

setWriterOwner

public void setWriterOwner(SAXVisitor writerOwner)

visitBefore

public void visitBefore(SAXElement element,
                        ExecutionContext executionContext)
                 throws SmooksException,
                        IOException
Description copied from interface: SAXVisitBefore
Visit the supplied element before visiting its child elements.

Specified by:
visitBefore in interface SAXVisitBefore
Parameters:
element - The SAX element being visited.
executionContext - Execution context.
Throws:
SmooksException - Event processing failure.
IOException - Error writing event to output writer.

onChildText

public void onChildText(SAXElement element,
                        SAXText text,
                        ExecutionContext executionContext)
                 throws SmooksException,
                        IOException
Description copied from interface: SAXVisitChildren
Process the onChildText event for the targeted element.

Be careful when caching element data. This is not a DOM.

Specified by:
onChildText in interface SAXVisitChildren
Parameters:
element - The element containing the text (parent). The targeted element.
text - The text.
executionContext - Execution context.
Throws:
SmooksException - Event processing failure.
IOException - Error writing event to output writer.

onChildElement

public void onChildElement(SAXElement element,
                           SAXElement childElement,
                           ExecutionContext executionContext)
                    throws SmooksException,
                           IOException
Description copied from interface: SAXVisitChildren
Process the onChildElement event for the targeted element.

Be careful when caching element data. This is not a DOM.

Specified by:
onChildElement in interface SAXVisitChildren
Parameters:
element - The element containing the child element (parent). The targeted element.
childElement - The child element just added to the targeted element.
executionContext - Execution context.
Throws:
SmooksException - Event processing failure.
IOException - Error writing event to output writer.

visitAfter

public void visitAfter(SAXElement element,
                       ExecutionContext executionContext)
                throws SmooksException,
                       IOException
Description copied from interface: SAXVisitAfter
Visit the supplied element after visiting its child elements.

Specified by:
visitAfter in interface SAXVisitAfter
Parameters:
element - The SAX element being visited.
executionContext - Execution context.
Throws:
SmooksException - Event processing failure.
IOException - Error writing event to output writer.

writeStartElement

public void writeStartElement(SAXElement element)
                       throws IOException
Throws:
IOException

isStartWritten

public boolean isStartWritten(SAXElement element)


Copyright © 2008. All Rights Reserved.