org.attoparser.markup.dom
Class MarkupWriterAttoDOMVisitor

Object
  extended by org.attoparser.markup.dom.AbstractAttoDOMVisitor
      extended by org.attoparser.markup.dom.MarkupWriterAttoDOMVisitor
All Implemented Interfaces:
AttoDOMVisitor

public final class MarkupWriterAttoDOMVisitor
extends AbstractAttoDOMVisitor

Implementation of AttoDOMVisitor capable of writing an attoDOM tree as markup code.

Since:
1.0
Author:
Daniel Fernández

Constructor Summary
MarkupWriterAttoDOMVisitor(Writer writer)
           Create a new instance of this visitor, specifying the Writer that will be used for outputting the markup code.
 
Method Summary
 Writer getWriter()
           
 void visitCDATASection(CDATASection cdataSection)
           Visit a CDATASection node.
 void visitCloseElement(Element element)
           Visit a non-standalone Element node after its children have been visited.
 void visitComment(Comment comment)
           Visit a Comment node.
 void visitDocType(DocType docType)
           Visit a DocType node.
 void visitOpenElement(Element element)
           Visit a non-standalone Element node before its children are visited.
 void visitProcessingInstruction(ProcessingInstruction processingInstruction)
           Visit a ProcessingInstruction node.
 void visitStandaloneElement(Element element)
           Visit a standalone Element node.
 void visitText(Text text)
           Visit a Text node.
 void visitXmlDeclaration(XmlDeclaration xmlDeclaration)
           Visit an XmlDeclaration node.
 
Methods inherited from class org.attoparser.markup.dom.AbstractAttoDOMVisitor
visitEndDocument, visitStartDocument
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkupWriterAttoDOMVisitor

public MarkupWriterAttoDOMVisitor(Writer writer)

Create a new instance of this visitor, specifying the Writer that will be used for outputting the markup code.

For example, this writer could be a StringWriter (for obtaining a String), an HttpServletResponse.getWriter(), etc.

Parameters:
writer - the writer to be used as output.
Method Detail

getWriter

public Writer getWriter()

visitXmlDeclaration

public void visitXmlDeclaration(XmlDeclaration xmlDeclaration)
                         throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit an XmlDeclaration node.

Specified by:
visitXmlDeclaration in interface AttoDOMVisitor
Overrides:
visitXmlDeclaration in class AbstractAttoDOMVisitor
Parameters:
xmlDeclaration - the node to be visited.
Throws:
AttoDOMVisitorException

visitDocType

public void visitDocType(DocType docType)
                  throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit a DocType node.

Specified by:
visitDocType in interface AttoDOMVisitor
Overrides:
visitDocType in class AbstractAttoDOMVisitor
Parameters:
docType - the node to be visited.
Throws:
AttoDOMVisitorException

visitProcessingInstruction

public void visitProcessingInstruction(ProcessingInstruction processingInstruction)
                                throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit a ProcessingInstruction node.

Specified by:
visitProcessingInstruction in interface AttoDOMVisitor
Overrides:
visitProcessingInstruction in class AbstractAttoDOMVisitor
Parameters:
processingInstruction - the node to be visited.
Throws:
AttoDOMVisitorException

visitStandaloneElement

public void visitStandaloneElement(Element element)
                            throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit a standalone Element node.

Specified by:
visitStandaloneElement in interface AttoDOMVisitor
Overrides:
visitStandaloneElement in class AbstractAttoDOMVisitor
Parameters:
element - the element to be visited.
Throws:
AttoDOMVisitorException

visitOpenElement

public void visitOpenElement(Element element)
                      throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit a non-standalone Element node before its children are visited.

This method does not need to traverse the element children, this will be done automatically after calling this handler.

Specified by:
visitOpenElement in interface AttoDOMVisitor
Overrides:
visitOpenElement in class AbstractAttoDOMVisitor
Parameters:
element - the element to be visited.
Throws:
AttoDOMVisitorException

visitCloseElement

public void visitCloseElement(Element element)
                       throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit a non-standalone Element node after its children have been visited.

This method does not need to traverse the element children, this is done before calling this closing handler.

Specified by:
visitCloseElement in interface AttoDOMVisitor
Overrides:
visitCloseElement in class AbstractAttoDOMVisitor
Parameters:
element - the element to be visited.
Throws:
AttoDOMVisitorException

visitText

public void visitText(Text text)
               throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit a Text node.

Specified by:
visitText in interface AttoDOMVisitor
Overrides:
visitText in class AbstractAttoDOMVisitor
Parameters:
text - the node to be visited.
Throws:
AttoDOMVisitorException

visitCDATASection

public void visitCDATASection(CDATASection cdataSection)
                       throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit a CDATASection node.

Specified by:
visitCDATASection in interface AttoDOMVisitor
Overrides:
visitCDATASection in class AbstractAttoDOMVisitor
Parameters:
cdataSection - the node to be visited.
Throws:
AttoDOMVisitorException

visitComment

public void visitComment(Comment comment)
                  throws AttoDOMVisitorException
Description copied from interface: AttoDOMVisitor

Visit a Comment node.

Specified by:
visitComment in interface AttoDOMVisitor
Overrides:
visitComment in class AbstractAttoDOMVisitor
Parameters:
comment - the node to be visited.
Throws:
AttoDOMVisitorException


Copyright © 2012 The ATTOPARSER team. All Rights Reserved.