public class AbstractContentWriterHandler extends Object implements ContentHandler
Modifier and Type | Field and Description |
---|---|
protected Attributes |
EMPTY_ATTRIBUTES |
protected String |
encoding |
Constructor and Description |
---|
AbstractContentWriterHandler(Writer out,
String encoding,
String charNewLine,
String charTab)
Creates XmlWriter which prints to the Writer interface.
|
Modifier and Type | Method and Description |
---|---|
protected void |
autoCloseStartElement()
Auto close the start element if working in printing event.
|
void |
characters(char c) |
void |
characters(char[] ch,
int start,
int length)
Prints xml characters and uses characters(java.lang.String) method.
|
void |
characters(String text)
Escape and prints xml characters.
|
void |
charactersRaw(String text) |
void |
closeWriter() |
void |
closeWriterSafe() |
void |
comment(char[] ch,
int start,
int length)
Prints xml comment.
|
void |
comment(String text)
Prints xml comment.
|
void |
endDocument() |
void |
endElement(String uri,
String localName,
String name) |
void |
endPrefixMapping(String prefix) |
void |
ignorableWhitespace(char c)
Prints xml ignorable whitespace character.
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Prints xml ignorable whitespace.
|
void |
ignorableWhitespace(String text)
Prints xml ignorable whitespace.
|
void |
processingInstruction(String target,
String data)
Prints xml instructions.
|
void |
setDocumentLocator(Locator locator)
Not implemented.
|
void |
skippedEntity(String name)
Not implemented.
|
void |
startDocument() |
void |
startElement(String uri,
String localName,
String name,
Attributes atts) |
void |
startElementNamespace(String uri) |
void |
startElementNamespaceAll(String uri) |
void |
startElementTag(String uri,
String localName) |
void |
startPrefixMapping(String prefix,
String uri)
Starts the prefix mapping of an xml namespace uri.
|
protected void |
writeFlush() |
protected final Attributes EMPTY_ATTRIBUTES
protected String encoding
public void closeWriter() throws IOException
IOException
public void closeWriterSafe()
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
ContentHandler.startDocument()
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
ContentHandler.endDocument()
public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException
startElement
in interface ContentHandler
uri
- The xml namespace uri.localName
- The local name of the xml tag.name
- The (full) name of the xml tag.atts
- The attributes of the xml tag.SAXException
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void startElementTag(String uri, String localName) throws SAXException
SAXException
public void startElementNamespace(String uri) throws SAXException
SAXException
public void startElementNamespaceAll(String uri) throws SAXException
SAXException
public void endElement(String uri, String localName, String name) throws SAXException
endElement
in interface ContentHandler
uri
- The xml namespace uri.localName
- The local name of the xml tag.name
- The (full) name of the xml tag.SAXException
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
prefix
- The xml prefix of this xml namespace uri.uri
- The xml namespace uri to add the prefix for.SAXException
ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
prefix
- The xml prefix of this xml namespace uri to be ended.SAXException
ContentHandler.endPrefixMapping(java.lang.String)
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
ch
- Character buffer.start
- The start index of the chars in the ch buffer.length
- The length index of the chars in the ch buffer.SAXException
- When IOException has happend while printing.ContentHandler.characters(char[], int, int)
public void characters(String text) throws SAXException
SAXException
ContentWriter.characters(java.lang.String)
public void characters(char c) throws SAXException
SAXException
public void charactersRaw(String text) throws SAXException
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
ch
- Character buffer.start
- The start index of the chars in the ch buffer.length
- The length index of the chars in the ch buffer.SAXException
- When IOException has happend while printing.ContentHandler.ignorableWhitespace(char[], int, int)
public void ignorableWhitespace(String text) throws SAXException
text
- The text to print.SAXException
- When IOException has happend while printing.ContentWriter.ignorableWhitespace(java.lang.String)
public void ignorableWhitespace(char c) throws SAXException
c
- The character to print.SAXException
- When IOException has happend while printing.public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
target
- The target.data
- The data.SAXException
ContentHandler.processingInstruction(java.lang.String, java.lang.String)
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
locator
- The DocumentLocator to set.ContentHandler.setDocumentLocator(org.xml.sax.Locator)
public void skippedEntity(String name) throws SAXException
skippedEntity
in interface ContentHandler
name
- The name of the skipped entity.SAXException
ContentHandler.skippedEntity(java.lang.String)
public void comment(char[] ch, int start, int length) throws SAXException
ch
- Character buffer.start
- The start index of the chars in the ch buffer.length
- The length index of the chars in the ch buffer.SAXException
- When IOException has happend while printing.DefaultHandler2.comment(char[], int, int)
public void comment(String text) throws SAXException
SAXException
ContentWriter.comment(java.lang.String)
protected void autoCloseStartElement() throws SAXException
IOException
- When prints gives exception.SAXException
protected void writeFlush() throws SAXException
SAXException
Copyright © 2004-2013 X4O. All Rights Reserved.