Class AbstractContentWriterHandler
java.lang.Object
org.x4o.sax3.io.AbstractContentWriterHandler
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ContentHandler
- Direct Known Subclasses:
AbstractContentWriterLexical
AbstractContentWriterHandler writes SAX content handler events as XML.
- Version:
- 1.0 May 3, 2013
- Author:
- Willem Cazander
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SAX3PropertyConfig
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionCreates XmlWriter which prints to the Writer interface. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
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.protected void
charactersRaw
(String text) void
close()
void
comment
(char[] ch, int start, int length) Prints xml comment.void
Prints xml comment.void
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
void
startElement
(String uri, String localName, String name, Attributes atts) void
void
void
startElementTag
(String uri, String localName) void
startPrefixMapping
(String prefix, String uri) Starts the prefix mapping of an xml namespace uri.protected void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
DEFAULT_PROPERTY_CONFIG
-
OUTPUT_ENCODING
- See Also:
-
OUTPUT_CHAR_TAB
- See Also:
-
OUTPUT_CHAR_NEWLINE
- See Also:
-
OUTPUT_CHAR_NULL
- See Also:
-
OUTPUT_COMMENT_ENABLE
- See Also:
-
OUTPUT_COMMENT_AUTO_SPACE
- See Also:
-
OUTPUT_LINE_BREAK_WIDTH
- See Also:
-
OUTPUT_LINE_PER_ATTRIBUTE
- See Also:
-
PROLOG_LICENCE_FILE
- See Also:
-
PROLOG_LICENCE_RESOURCE
- See Also:
-
PROLOG_LICENCE_ENCODING
- See Also:
-
PROLOG_LICENCE_ENABLE
- See Also:
-
PROLOG_USER_COMMENT
- See Also:
-
PROLOG_USER_COMMENT_ENABLE
- See Also:
-
ROOT_END_APPEND_NEWLINE
- See Also:
-
ROOT_START_NAMESPACE_ALL
- See Also:
-
-
Constructor Details
-
AbstractContentWriterHandler
Creates XmlWriter which prints to the Writer interface.- Parameters:
out
- The writer to print the xml to.
-
-
Method Details
-
getPropertyConfig
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
- See Also:
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
- See Also:
-
startElement
public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Parameters:
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.- Throws:
SAXException
- See Also:
-
startElementTag
- Throws:
SAXException
-
startElementNamespace
- Throws:
SAXException
-
startElementNamespaceAll
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Parameters:
uri
- The xml namespace uri.localName
- The local name of the xml tag.name
- The (full) name of the xml tag.- Throws:
SAXException
- See Also:
-
startPrefixMapping
Starts the prefix mapping of an xml namespace uri.- Specified by:
startPrefixMapping
in interfaceContentHandler
- Parameters:
prefix
- The xml prefix of this xml namespace uri.uri
- The xml namespace uri to add the prefix for.- Throws:
SAXException
- See Also:
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Parameters:
prefix
- The xml prefix of this xml namespace uri to be ended.- Throws:
SAXException
- See Also:
-
characters
Prints xml characters and uses characters(java.lang.String) method.- Specified by:
characters
in interfaceContentHandler
- Parameters:
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.- Throws:
SAXException
- When IOException has happend while printing.- See Also:
-
characters
Escape and prints xml characters.- Parameters:
text
- The text to write.- Throws:
SAXException
- When IOException has happend while printing.- See Also:
-
characters
- Throws:
SAXException
-
charactersRaw
- Throws:
SAXException
-
ignorableWhitespace
Prints xml ignorable whitespace.- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Parameters:
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.- Throws:
SAXException
- When IOException has happend while printing.- See Also:
-
ignorableWhitespace
Prints xml ignorable whitespace.- Parameters:
text
- The text to print.- Throws:
SAXException
- When IOException has happend while printing.- See Also:
-
ignorableWhitespace
Prints xml ignorable whitespace character.- Parameters:
c
- The character to print.- Throws:
SAXException
- When IOException has happend while printing.
-
processingInstruction
Prints xml instructions.- Specified by:
processingInstruction
in interfaceContentHandler
- Parameters:
target
- The target.data
- The data.- Throws:
SAXException
- See Also:
-
setDocumentLocator
Not implemented.- Specified by:
setDocumentLocator
in interfaceContentHandler
- Parameters:
locator
- The DocumentLocator to set.- See Also:
-
skippedEntity
Not implemented.- Specified by:
skippedEntity
in interfaceContentHandler
- Parameters:
name
- The name of the skipped entity.- Throws:
SAXException
- See Also:
-
comment
Prints xml comment.- Parameters:
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.- Throws:
SAXException
- When IOException has happend while printing.- See Also:
-
comment
Prints xml comment.- Parameters:
text
- The text to write.- Throws:
SAXException
- When IOException has happend while printing.- See Also:
-
autoCloseStartElement
Auto close the start element if working in printing event.- Throws:
SAXException
- When prints gives exception.
-
writeFlush
- Throws:
SAXException
-