org.milyn.delivery.dom.serialize
Class TextSerializationUnit

java.lang.Object
  extended by org.milyn.delivery.dom.serialize.DefaultSerializationUnit
      extended by org.milyn.delivery.dom.serialize.TextSerializationUnit
All Implemented Interfaces:
ContentHandler, SerializationUnit, SAXVisitBefore, SAXVisitor, Visitor

public class TextSerializationUnit
extends DefaultSerializationUnit
implements SAXVisitBefore

Write a <text> element.

Basically just drops the <text> tags.

Author:
tom.fennelly@jboss.com

Constructor Summary
TextSerializationUnit()
           
 
Method Summary
static Element createTextElement(Element element, String templatingResult)
           
static String getText(Element element)
           
static boolean isTextElement(Element element)
           
 void visitBefore(SAXElement element, ExecutionContext executionContext)
          Visit the supplied element before visiting its child elements.
 void writeElementEnd(Element element, Writer writer, ExecutionContext executionContext)
          Write the element end portion; close the element.
 void writeElementStart(Element element, Writer writer, ExecutionContext executionContext)
          Write the element start portion; the element name and it's attributes.
 
Methods inherited from class org.milyn.delivery.dom.serialize.DefaultSerializationUnit
isRewriteEntities, setCloseEmptyElements, setRewriteEntities, writeAttributes, writeChildElements, writeElementCDATA, writeElementComment, writeElementEnd, writeElementEntityRef, writeElementNode, writeElementStart, writeElementText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextSerializationUnit

public TextSerializationUnit()
Method Detail

writeElementStart

public void writeElementStart(Element element,
                              Writer writer,
                              ExecutionContext executionContext)
                       throws IOException
Description copied from interface: SerializationUnit
Write the element start portion; the element name and it's attributes.

EG: <a href="http://www.x.com">

Specified by:
writeElementStart in interface SerializationUnit
Overrides:
writeElementStart in class DefaultSerializationUnit
Parameters:
element - The element start to write.
writer - The writer to be written to.
executionContext - ExecutionContext instance for the delivery context.
Throws:
IOException - Exception writing output.

writeElementEnd

public void writeElementEnd(Element element,
                            Writer writer,
                            ExecutionContext executionContext)
                     throws IOException
Description copied from interface: SerializationUnit
Write the element end portion; close the element.

EG: </a>

Specified by:
writeElementEnd in interface SerializationUnit
Overrides:
writeElementEnd in class DefaultSerializationUnit
Parameters:
element - The element end to write.
writer - The writer to be written to.
executionContext - ExecutionContext instance for the delivery context.
Throws:
IOException - Exception writing output.

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.

createTextElement

public static Element createTextElement(Element element,
                                        String templatingResult)

isTextElement

public static boolean isTextElement(Element element)

getText

public static String getText(Element element)


Copyright © 2009. All Rights Reserved.