Class AbstractXDBXWriterHandler
java.lang.Object
org.x4o.sax3.io.xdbx.AbstractXDBXWriterHandler
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ContentHandler
- Direct Known Subclasses:
AbstractXDBXWriterLexical
Writes SAX content handler events as binary XML called XDBX.
- Version:
- 1.0 Dec 19, 2024
- Author:
- Willem Cazander
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates writer which prints to the stream interface. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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, String name) void
startPrefixMapping
(String prefix, String uri) Starts the prefix mapping of an xml namespace uri.protected void
void
writeHeaderFlags
(OutputStream out, int flags) protected void
writeLengthValue
(byte[] data) protected void
writeLengthValue
(String data) protected void
writeTag
(XDBXContentTag tag) protected void
writeTagLengthValue
(XDBXContentTag tag, String data) protected void
writeVariableInteger
(int i) protected boolean
xdbxStringId
(String data) protected int
xdbxStringStore
(String data) 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_DECLARATION
- See Also:
-
OUTPUT_CHAR_NULL
- See Also:
-
OUTPUT_COMMENT_ENABLE
- See Also:
-
OUTPUT_COMMENT_AUTO_SPACE
- 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_START_NAMESPACE_ALL
- See Also:
-
-
Constructor Details
-
AbstractXDBXWriterHandler
Creates writer which prints to the stream interface.- Parameters:
out
- The stream to print the xml to.
-
-
Method Details
-
getPropertyConfig
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
xdbxStringId
-
xdbxStringStore
-
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:
-
writeFlush
- Throws:
SAXException
-
writeHeaderFlags
- Throws:
SAXException
-
writeTag
- Throws:
SAXException
-
writeTagLengthValue
- Throws:
SAXException
-
writeVariableInteger
- Throws:
SAXException
-
writeLengthValue
- Throws:
SAXException
-
writeLengthValue
- Throws:
SAXException
-