public class SAXDocumentSerializerWithPrefixMapping extends SAXDocumentSerializer
This serializer will not preserve the original prefixes and this serializer should not be used when prefixes need to be preserved, such as the case when there are qualified names in content.
A namespace URI to prefix map is utilized such that the prefixes in the map are utilized rather than the prefixes specified in the qualified name for elements and attributes.
Any namespace declarations with a namespace URI that is not present in the map are added.
| Modifier and Type | Field and Description |
|---|---|
protected StringIntMap |
_declaredNamespaces |
protected java.lang.String |
_lastCheckedNamespace |
protected java.lang.String |
_lastCheckedPrefix |
protected java.util.Map |
_namespaceToPrefixMapping |
protected java.util.Map |
_prefixToPrefixMapping |
_charactersAsCDATA, _elementHasNamespaces_b, _characterEncodingSchemeSystemDefault, _charBuffer, _markIndex, _octetBuffer, _octetBufferIndex, _s, _terminate, _v, _vData, attributeValueMapTotalCharactersConstraint, CHARACTER_ENCODING_SCHEME_SYSTEM_PROPERTY, characterContentChunkMapTotalCharactersConstraint, maxAttributeValueSize, maxCharacterContentChunkSize, minAttributeValueSize, minCharacterContentChunkSizeATTRIBUTE_VALUE_MAP_MEMORY_CONSTRAINT, BUFFER_SIZE_PROPERTY, CHARACTER_CONTENT_CHUNK_MAP_MEMORY_CONSTRAINT, EXTERNAL_VOCABULARIES_PROPERTY, IGNORE_COMMENTS_FEATURE, IGNORE_DTD_FEATURE, IGNORE_PROCESSING_INSTRUCTIONS_FEATURE, IGNORE_WHITE_SPACE_TEXT_CONTENT_FEATURE, MAX_ATTRIBUTE_VALUE_SIZE, MAX_CHARACTER_CONTENT_CHUNK_SIZE, MIN_ATTRIBUTE_VALUE_SIZE, MIN_CHARACTER_CONTENT_CHUNK_SIZE, REGISTERED_ENCODING_ALGORITHMS_PROPERTY, UTF_16BE, UTF_8| Constructor and Description |
|---|
SAXDocumentSerializerWithPrefixMapping(java.util.Map namespaceToPrefixMapping) |
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
convertQName(java.lang.String qName) |
protected boolean |
encodeAttribute(java.lang.String namespaceURI,
java.lang.String qName,
java.lang.String localName) |
protected boolean |
encodeAttributeMapEntry(LocalNameQualifiedNamesMap.Entry entry,
java.lang.String namespaceURI) |
protected void |
encodeAttributes(org.xml.sax.Attributes atts) |
protected void |
encodeElement(java.lang.String namespaceURI,
java.lang.String qName,
java.lang.String localName) |
protected boolean |
encodeElementMapEntry(LocalNameQualifiedNamesMap.Entry entry,
java.lang.String namespaceURI) |
protected java.lang.String |
getPrefix(java.lang.String namespaceURI) |
protected void |
putPrefix(java.lang.String namespaceURI,
java.lang.String prefix) |
void |
startPrefixMapping(java.lang.String prefix,
java.lang.String uri) |
alphabetCharacters, booleans, bytes, characters, characters, comment, countAttributes, dateTimeCharacters, doubles, endCDATA, endDocument, endDTD, endElement, endEntity, floats, ignorableWhitespace, ints, longs, numericCharacters, object, octets, processingInstruction, reset, setDocumentLocator, shorts, skippedEntity, startCDATA, startDocument, startDTD, startElement, startEntity, uuidscanAddAttributeToTable, canAddCharacterContentToTable, encodeAIIBuiltInAlgorithmData, encodeAIIObjectAlgorithmData, encodeAIIOctetAlgorithmData, encodeAlphabetCharacters, encodeAttributeQualifiedNameOnSecondBit, encodeCharacters, encodeCharactersNoClone, encodeCIIBuiltInAlgorithmData, encodeCIIBuiltInAlgorithmDataAsCDATA, encodeCIIObjectAlgorithmData, encodeCIIOctetAlgorithmData, encodeComment, encodeCommentNoClone, encodeDateTimeFourBitCharacters, encodeDateTimeNonIdentifyingStringOnFirstBit, encodeDocumentTermination, encodeDocumentTypeDeclaration, encodeElementQualifiedNameOnThirdBit, encodeElementTermination, encodeFourBitCharacters, encodeHeader, encodeIdentifyingNonEmptyStringOnFirstBit, encodeInitialVocabulary, encodeLiteralAttributeQualifiedNameOnSecondBit, encodeLiteralElementQualifiedNameOnThirdBit, encodeNamespaceAttribute, encodeNonEmptyCharacterStringOnFifthBit, encodeNonEmptyCharacterStringOnFifthBit, encodeNonEmptyCharacterStringOnSeventhBit, encodeNonEmptyFourBitCharacterString, encodeNonEmptyFourBitCharacterStringOnSeventhBit, encodeNonEmptyNBitCharacterStringOnSeventhBit, encodeNonEmptyOctetStringOnSecondBit, encodeNonEmptyUTF8StringAsOctetString, encodeNonEmptyUTF8StringAsOctetString, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnFirstBit, encodeNonIdentifyingStringOnThirdBit, encodeNonIdentifyingStringOnThirdBit, encodeNonIdentifyingStringOnThirdBit, encodeNonZeroInteger, encodeNonZeroIntegerOnFourthBit, encodeNonZeroIntegerOnSecondBitFirstBitOne, encodeNonZeroIntegerOnSecondBitFirstBitZero, encodeNonZeroIntegerOnThirdBit, encodeNonZeroOctetStringLength, encodeNonZeroOctetStringLengthOnFifthBit, encodeNonZeroOctetStringLengthOnSecondBit, encodeNonZeroOctetStringLengthOnSenventhBit, encodeNumericFourBitCharacters, encodeNumericNonIdentifyingStringOnFirstBit, encodeProcessingInstruction, encodeTermination, encodeUtf16String, encodeUtf16String, encodeUTF8String, encodeUTF8String, getAttributeValueMapMemoryLimit, getCharacterContentChunkMapMemoryLimit, getCharacterEncodingScheme, getIgnoreComments, getIgnoreDTD, getIgnoreProcesingInstructions, getIgnoreWhiteSpaceTextContent, getMaxAttributeValueSize, getMaxCharacterContentChunkSize, getMinAttributeValueSize, getMinCharacterContentChunkSize, getPrefixFromQualifiedName, getRegisteredEncodingAlgorithms, getVocabularyApplicationData, hasMark, isAttributeValueLengthMatchesLimit, isCharacterContentChunkLengthMatchesLimit, isWhiteSpace, isWhiteSpace, mark, resetMark, setAttributeValueMapMemoryLimit, setCharacterContentChunkMapMemoryLimit, setCharacterEncodingScheme, setExternalVocabulary, setIgnoreComments, setIgnoreDTD, setIgnoreProcesingInstructions, setIgnoreWhiteSpaceTextContent, setMaxAttributeValueSize, setMaxCharacterContentChunkSize, setMinAttributeValueSize, setMinCharacterContentChunkSize, setOutputStream, setRegisteredEncodingAlgorithms, setVocabulary, setVocabularyApplicationData, write, write, writeendPrefixMapping, error, fatalError, notationDecl, resolveEntity, unparsedEntityDecl, warningclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttributeValueMapMemoryLimit, getCharacterContentChunkMapMemoryLimit, getCharacterEncodingScheme, getIgnoreComments, getIgnoreDTD, getIgnoreProcesingInstructions, getIgnoreWhiteSpaceTextContent, getMaxAttributeValueSize, getMaxCharacterContentChunkSize, getMinAttributeValueSize, getMinCharacterContentChunkSize, getRegisteredEncodingAlgorithms, getVocabularyApplicationData, setAttributeValueMapMemoryLimit, setCharacterContentChunkMapMemoryLimit, setCharacterEncodingScheme, setExternalVocabulary, setIgnoreComments, setIgnoreDTD, setIgnoreProcesingInstructions, setIgnoreWhiteSpaceTextContent, setMaxAttributeValueSize, setMaxCharacterContentChunkSize, setMinAttributeValueSize, setMinCharacterContentChunkSize, setOutputStream, setRegisteredEncodingAlgorithms, setVocabularyApplicationDataprotected java.util.Map _namespaceToPrefixMapping
protected java.util.Map _prefixToPrefixMapping
protected java.lang.String _lastCheckedNamespace
protected java.lang.String _lastCheckedPrefix
protected StringIntMap _declaredNamespaces
public SAXDocumentSerializerWithPrefixMapping(java.util.Map namespaceToPrefixMapping)
public final void startPrefixMapping(java.lang.String prefix,
java.lang.String uri)
throws org.xml.sax.SAXException
startPrefixMapping in interface org.xml.sax.ContentHandlerstartPrefixMapping in class SAXDocumentSerializerorg.xml.sax.SAXExceptionprotected final void encodeElement(java.lang.String namespaceURI,
java.lang.String qName,
java.lang.String localName)
throws java.io.IOException
encodeElement in class SAXDocumentSerializerjava.io.IOExceptionprotected boolean encodeElementMapEntry(LocalNameQualifiedNamesMap.Entry entry, java.lang.String namespaceURI) throws java.io.IOException
java.io.IOExceptionprotected final void encodeAttributes(org.xml.sax.Attributes atts)
throws java.io.IOException,
FastInfosetException
encodeAttributes in class SAXDocumentSerializerjava.io.IOExceptionFastInfosetExceptionprivate java.lang.String convertQName(java.lang.String qName)
protected final boolean encodeAttribute(java.lang.String namespaceURI,
java.lang.String qName,
java.lang.String localName)
throws java.io.IOException
encodeAttribute in class SAXDocumentSerializerjava.io.IOExceptionprotected boolean encodeAttributeMapEntry(LocalNameQualifiedNamesMap.Entry entry, java.lang.String namespaceURI) throws java.io.IOException
java.io.IOExceptionprotected final java.lang.String getPrefix(java.lang.String namespaceURI)
protected final void putPrefix(java.lang.String namespaceURI,
java.lang.String prefix)