Class TextSerializerVisitor
- java.lang.Object
-
- org.smooks.engine.delivery.dom.serialize.DefaultDOMSerializerVisitor
-
- org.smooks.engine.delivery.dom.serialize.TextSerializerVisitor
-
- All Implemented Interfaces:
ContentHandler
,BeforeVisitor
,SaxNgVisitor
,SerializerVisitor
,Visitor
,DOMSerializerVisitor
public class TextSerializerVisitor extends DefaultDOMSerializerVisitor implements BeforeVisitor
Write a <text> element. Basically just drops the <text> tags.- Author:
- tom.fennelly@jboss.com
-
-
Field Summary
-
Fields inherited from class org.smooks.engine.delivery.dom.serialize.DefaultDOMSerializerVisitor
closeEmptyElements, domSerializer, rewriteEntities
-
-
Constructor Summary
Constructors Constructor Description TextSerializerVisitor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Element
createTextElement(Element element, String templatingResult)
static String
getText(Element element)
static boolean
isTextElement(Element element)
void
visitBefore(Element element, ExecutionContext executionContext)
Visits the beginning of anElement
.void
writeEndElement(Element element, Writer writer, ExecutionContext executionContext)
Write the element end portion; close the element.void
writeStartElement(Element element, Writer writer, ExecutionContext executionContext)
Write the element start portion; the element name and it's attributes.-
Methods inherited from class org.smooks.engine.delivery.dom.serialize.DefaultDOMSerializerVisitor
postConstruct, setCloseEmptyElements, setRewriteEntities, writeCharacterData, writeChildElements, writeElementCDATA, writeElementComment, writeElementEntityRef, writeElementNode
-
-
-
-
Method Detail
-
writeStartElement
public void writeStartElement(Element element, Writer writer, ExecutionContext executionContext) throws IOException
Description copied from interface:SerializerVisitor
Write the element start portion; the element name and it's attributes. EG: <a href="http://www.x.com">- Specified by:
writeStartElement
in interfaceSerializerVisitor
- Overrides:
writeStartElement
in classDefaultDOMSerializerVisitor
- 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.
-
writeEndElement
public void writeEndElement(Element element, Writer writer, ExecutionContext executionContext) throws IOException
Description copied from interface:SerializerVisitor
Write the element end portion; close the element. EG: </a>- Specified by:
writeEndElement
in interfaceSerializerVisitor
- Overrides:
writeEndElement
in classDefaultDOMSerializerVisitor
- 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.
-
createTextElement
public static Element createTextElement(Element element, String templatingResult)
-
isTextElement
public static boolean isTextElement(Element element)
-
visitBefore
public void visitBefore(Element element, ExecutionContext executionContext) throws SmooksException
Description copied from interface:BeforeVisitor
Visits the beginning of anElement
.- Specified by:
visitBefore
in interfaceBeforeVisitor
- Parameters:
element
- theElement
representing the beginning of the fragment. TheElement
's ancestors are traversable unless the global configuration parametermaintain.element.stack
is set to false. TheElement
's child nodes are not traversable.executionContext
- the currentExecutionContext
- Throws:
SmooksException
-
-