org.xwiki.portlet.util
Class XHTMLWriter

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by org.dom4j.io.XMLWriter
          extended by org.xwiki.portlet.util.XHTMLWriter
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, LexicalHandler, XMLFilter, XMLReader

public class XHTMLWriter
extends org.dom4j.io.XMLWriter

A specialized XMLWriter for XHTML serialization.

Version:
$Id: 48bc37cbfee82fef22b4c9ed7f853c60a43629a6 $

Field Summary
 
Fields inherited from class org.dom4j.io.XMLWriter
DEFAULT_FORMAT, lastOutputNodeType, LEXICAL_HANDLER_NAMES, preserve, writer
 
Constructor Summary
XHTMLWriter(Writer writer)
          Creates a new XHTML writer that outputs the serialized XHTML using the given writer.
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void comment(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String namespaceURI, String localName, String qName)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(String target, String data)
           
 void startCDATA()
           
 void startElement(String namespaceURI, String localName, String qName, Attributes attributes)
           
 void startEntity(String name)
           
protected  void writeClose(String qualifiedName)
           
protected  void writeEmptyElementClose(String qualifiedName)
           
 
Methods inherited from class org.dom4j.io.XMLWriter
close, createWriter, defaultMaximumAllowedCharacter, endCDATA, endDTD, endEntity, endPrefixMapping, escapeAttributeEntities, escapeElementEntities, flush, getLexicalHandler, getMaximumAllowedCharacter, getOutputFormat, getProperty, handleException, indent, installLexicalHandler, isElementSpacePreserved, isEscapeText, isExpandEmptyElements, isNamespaceDeclaration, notationDecl, parse, println, resolveEntityRefs, setDocumentLocator, setEscapeText, setIndentLevel, setLexicalHandler, setMaximumAllowedCharacter, setOutputStream, setProperty, setResolveEntityRefs, setWriter, shouldEncodeChar, startDocument, startDTD, startPrefixMapping, unparsedEntityDecl, write, write, write, write, write, write, write, write, write, write, write, write, write, writeAttribute, writeAttribute, writeAttributes, writeAttributes, writeCDATA, writeClose, writeComment, writeDeclaration, writeDocType, writeDocType, writeElement, writeElementContent, writeEntity, writeEntityRef, writeEscapeAttributeEntities, writeNamespace, writeNamespace, writeNamespaces, writeNode, writeNodeText, writeOpen, writePrintln, writeProcessingInstruction, writeString
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, parse, resolveEntity, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XHTMLWriter

public XHTMLWriter(Writer writer)
            throws UnsupportedEncodingException
Creates a new XHTML writer that outputs the serialized XHTML using the given writer.

Parameters:
writer - where to serialize the XHTML
Throws:
UnsupportedEncodingException - if the output format encoding is not supported
Method Detail

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class org.dom4j.io.XMLWriter
Throws:
SAXException

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.dom4j.io.XMLWriter
Throws:
SAXException

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class org.dom4j.io.XMLWriter
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class org.dom4j.io.XMLWriter
Throws:
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Overrides:
ignorableWhitespace in class org.dom4j.io.XMLWriter
Throws:
SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class org.dom4j.io.XMLWriter
Throws:
SAXException

startEntity

public void startEntity(String name)
                 throws SAXException
Specified by:
startEntity in interface LexicalHandler
Overrides:
startEntity in class org.dom4j.io.XMLWriter
Throws:
SAXException

startCDATA

public void startCDATA()
                throws SAXException
Specified by:
startCDATA in interface LexicalHandler
Overrides:
startCDATA in class org.dom4j.io.XMLWriter
Throws:
SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Specified by:
comment in interface LexicalHandler
Overrides:
comment in class org.dom4j.io.XMLWriter
Throws:
SAXException

writeClose

protected void writeClose(String qualifiedName)
                   throws IOException
Overrides:
writeClose in class org.dom4j.io.XMLWriter
Throws:
IOException

writeEmptyElementClose

protected void writeEmptyElementClose(String qualifiedName)
                               throws IOException
Overrides:
writeEmptyElementClose in class org.dom4j.io.XMLWriter
Throws:
IOException


Copyright © 2004-2013 XWiki. All Rights Reserved.