|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.XMLFilterImpl
com.sun.xml.txw2.output.IndentingXMLFilter
public class IndentingXMLFilter
XMLFilterImpl
that does indentation to SAX events.
Constructor Summary | |
---|---|
IndentingXMLFilter()
|
|
IndentingXMLFilter(org.xml.sax.ContentHandler handler)
|
|
IndentingXMLFilter(org.xml.sax.ContentHandler handler,
org.xml.sax.ext.LexicalHandler lexical)
|
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
Write a sequence of characters. |
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
void |
endDTD()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Write an end tag. |
void |
endEntity(java.lang.String name)
|
int |
getIndentStep()
Deprecated. Only return the length of the indent string. |
org.xml.sax.ext.LexicalHandler |
getLexicalHandler()
|
void |
setIndentStep(int indentStep)
Deprecated. Should use the version that takes string. |
void |
setIndentStep(java.lang.String s)
|
void |
setLexicalHandler(org.xml.sax.ext.LexicalHandler lexical)
|
void |
startCDATA()
|
void |
startDTD(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
Write a start tag. |
void |
startEntity(java.lang.String name)
|
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl |
---|
endDocument, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndentingXMLFilter()
public IndentingXMLFilter(org.xml.sax.ContentHandler handler)
public IndentingXMLFilter(org.xml.sax.ContentHandler handler, org.xml.sax.ext.LexicalHandler lexical)
Method Detail |
---|
public org.xml.sax.ext.LexicalHandler getLexicalHandler()
public void setLexicalHandler(org.xml.sax.ext.LexicalHandler lexical)
public int getIndentStep()
Return the current indent step: each start tag will be indented by this number of spaces times the number of ancestors that the element has.
setIndentStep(int)
public void setIndentStep(int indentStep)
indentStep
- The new indent step (0 or less for no
indentation).getIndentStep()
public void setIndentStep(java.lang.String s)
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
Each tag will begin on a new line, and will be indented by the current indent step times the number of ancestors that the element has.
The newline and indentation will be passed on down the filter chain through regular characters events.
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.XMLFilterImpl
uri
- The element's Namespace URI.localName
- The element's local name.qName
- The element's qualified (prefixed) name.atts
- The element's attribute list.
org.xml.sax.SAXException
- If there is an error
writing the start tag, or if a filter further
down the chain raises an exception.XMLWriter.startElement(String, String, String,Attributes)
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
If the element has contained other elements, the tag will appear indented on a new line; otherwise, it will appear immediately following whatever came before.
The newline and indentation will be passed on down the filter chain through regular characters events.
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.XMLFilterImpl
uri
- The element's Namespace URI.localName
- The element's local name.qName
- The element's qualified (prefixed) name.
org.xml.sax.SAXException
- If there is an error
writing the end tag, or if a filter further
down the chain raises an exception.XMLWriter.endElement(String, String, String)
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.XMLFilterImpl
ch
- The characters to write.start
- The starting position in the array.length
- The number of characters to use.
org.xml.sax.SAXException
- If there is an error
writing the characters, or if a filter further
down the chain raises an exception.XMLWriter.characters(char[], int, int)
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
comment
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) throws org.xml.sax.SAXException
startDTD
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endDTD() throws org.xml.sax.SAXException
endDTD
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void startEntity(java.lang.String name) throws org.xml.sax.SAXException
startEntity
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endEntity(java.lang.String name) throws org.xml.sax.SAXException
endEntity
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void startCDATA() throws org.xml.sax.SAXException
startCDATA
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
public void endCDATA() throws org.xml.sax.SAXException
endCDATA
in interface org.xml.sax.ext.LexicalHandler
org.xml.sax.SAXException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |