StreamWriterBase, which
implements the "namespace repairing" mode of operation.
This means that the writer ensures correctness and validity
of namespace bindings, as based on namespace URIs caller
passes, by adding necessary namespace declarations and using
prefixes as required to obtain expected results.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int[] | _autoNsSeq
Sequence number used for generating dynamic namespace prefixes. |
| pack-priv final String | |
| pack-priv String | |
| pack-priv HashMap | _suggestedPrefixes
Map that contains URI-to-prefix entries that point out suggested prefixes for URIs. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected WName | _generateAttrName(String suggPrefix, String localName, String
Non-empty namespace URI that will be used for the
attribute uri)
|
| protected final String | _generateElemPrefix(String uri)
Method called if given URI is not yet bound, and no suggested prefix is given (or one given can't be used). |
| protected String | _serializeQName(QName name)
Implements abstract com. |
| public void | _setPrefix(String prefix, String uri)
Implements abstract com. |
| private final boolean | Returns: True, if prefix indicates default namespace (is null or empty); false otherwise
|
| public void | |
| public void | setDefaultNamespace(String
the uri to bind to the default namespace, may be null uri)Implements abstract com. Implements javax. |
| public void | writeAttribute(String
the uri of the prefix for this attribute nsURI, String the local name of the attribute localName, String the value of the attribute value)Implements abstract com. Implements javax. |
| public void | writeAttribute(String
the prefix for this attribute prefix, String the uri of the prefix for this attribute nsURI, String the local name of the attribute localName, String the value of the attribute value)Implements abstract com. Implements javax. |
| public void | writeDefaultNamespace(String
the uri to bind the default namespace to nsURI)Implements abstract com. Implements javax. |
| public void | writeEmptyElement(String
the uri to bind the tag to, may not be null nsURI, String local name of the tag, may not be null localName)Implements abstract com. Implements javax. |
| public void | writeEmptyElement(String
the prefix of the tag, may not be null prefix, String local name of the tag, may not be null localName, String the uri to bind the tag to, may not be null nsURI)Implements abstract com. Implements javax. |
| public void | writeNamespace(String
the prefix to bind this namespace to prefix, String the uri to bind the prefix to nsURI)Implements abstract com. Implements javax. |
| public void | writeStartElement(String
the namespaceURI of the prefix to use, may not be null nsURI, String local name of the tag, may not be null localName)Implements abstract com. Implements javax. |
| public void | writeStartElement(String
the prefix of the tag, may not be null prefix, String local name of the tag, may not be null localName, String the uri to bind the prefix to, may not be null nsURI)Implements abstract com. Implements javax. |
| public void | writeTypedAttribute(String prefix, String nsURI, String localName, AsciiValueEncoder enc)
Implements abstract com. |
| _autoNsSeq | back to summary |
|---|---|
| pack-priv int[] _autoNsSeq Sequence number used for generating dynamic namespace prefixes. Array used as a wrapper to allow for easy sharing of the sequence number. | |
| _cfgAutomaticNsPrefix | back to summary |
|---|---|
| pack-priv final String _cfgAutomaticNsPrefix | |
| _suggestedDefNs | back to summary |
|---|---|
| pack-priv String _suggestedDefNs | |
| _suggestedPrefixes | back to summary |
|---|---|
| pack-priv HashMap<String, String> _suggestedPrefixes Map that contains URI-to-prefix entries that point out suggested
prefixes for URIs. These are populated by calls to
| |
| RepairingStreamWriter | back to summary |
|---|---|
| public RepairingStreamWriter(WriterConfig cfg, XmlWriter writer, WNameTable symbols) | |
| _generateAttrName | back to summary |
|---|---|
protected WName _generateAttrName(String suggPrefix, String localName, String uri) throws XMLStreamException
| |
| _generateElemPrefix | back to summary |
|---|---|
| protected final String _generateElemPrefix(String uri) throws XMLStreamException Method called if given URI is not yet bound, and no suggested prefix is given (or one given can't be used). If so, methods is to create a not-yet-bound-prefix for the namespace. | |
| _serializeQName | back to summary |
|---|---|
| protected String _serializeQName(QName name) throws XMLStreamException Implements abstract com.
| |
| _setPrefix | back to summary |
|---|---|
| public void _setPrefix(String prefix, String uri) Implements abstract com.
| |
| _writeStartAndVerify | back to summary |
|---|---|
private final boolean _writeStartAndVerify(String prefix, String localName, String nsURI, boolean isEmpty) throws XMLStreamException
| |
| _writeStartOrEmpty | back to summary |
|---|---|
| public void _writeStartOrEmpty(String prefix, String localName, String nsURI, boolean isEmpty) throws XMLStreamException | |
| setDefaultNamespace | back to summary |
|---|---|
| public void setDefaultNamespace(String uri) throws XMLStreamException Implements abstract com. Implements javax. With repairing writer, this is only taken as a suggestion as to how the caller would prefer prefixes to be mapped.
| |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(String nsURI, String localName, String value) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes an attribute to the output stream
| |
| writeAttribute | back to summary |
|---|---|
| public void writeAttribute(String prefix, String nsURI, String localName, String value) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes an attribute to the output stream
| |
| writeDefaultNamespace | back to summary |
|---|---|
| public void writeDefaultNamespace(String nsURI) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes the default namespace to the stream
| |
| writeEmptyElement | back to summary |
|---|---|
| public void writeEmptyElement(String nsURI, String localName) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes an empty element tag to the output
| |
| writeEmptyElement | back to summary |
|---|---|
| public void writeEmptyElement(String prefix, String localName, String nsURI) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes an empty element tag to the output
| |
| writeNamespace | back to summary |
|---|---|
| public void writeNamespace(String prefix, String nsURI) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes a namespace to the output stream If the prefix argument to this method is the empty string, "xmlns", or null this method will delegate to writeDefaultNamespace
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(String nsURI, String localName) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes a start tag to the output
| |
| writeStartElement | back to summary |
|---|---|
| public void writeStartElement(String prefix, String localName, String nsURI) throws XMLStreamException Implements abstract com. Implements javax. Doc from javax. Writes a start tag to the output
| |
| writeTypedAttribute | back to summary |
|---|---|
| public void writeTypedAttribute(String prefix, String nsURI, String localName, AsciiValueEncoder enc) throws XMLStreamException Implements abstract com. Doc from com. Need to leave implementation of this method abstract, because repairing and non-repairing modes differ in how names are handled.
| |