public abstract class XMLWriterNamespaceBase extends Object implements IXMLWriter
| Modifier and Type | Field and Description |
|---|---|
protected String[] |
m_prefixes
Prefixes currently defined for namespaces.
|
protected String[] |
m_uris
URIs for namespaces.
|
| Constructor and Description |
|---|
XMLWriterNamespaceBase(String[] uris)
Constructor.
|
XMLWriterNamespaceBase(XMLWriterNamespaceBase base,
String[] uris)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
decrementNesting()
Decrement the current nesting depth.
|
protected abstract void |
defineNamespace(int index,
String prefix)
Report to subclass that namespace has been defined.
|
String[][] |
getExtensionNamespaces()
Get extension namespace URIs added to those in mapping.
|
int |
getNamespaceCount()
Get the number of namespaces currently defined.
|
String |
getNamespacePrefix(int index)
Get current prefix defined for namespace.
|
String[] |
getNamespaces()
Get namespace URIs for mapping.
|
String |
getNamespaceUri(int index)
Get URI for namespace.
|
int |
getNestingDepth()
Get the current element nesting depth.
|
int |
getPrefixIndex(String prefix)
Get index of namespace mapped to prefix.
|
protected static String[][] |
growArray(String[][] base,
String[] items)
Grow array of array of strings.
|
protected void |
incrementNesting()
Increment the current nesting depth.
|
protected String |
internalNamespacePrefix(int index)
Get current prefix defined for translated namespace index.
|
protected String |
internalNamespaceUri(int index)
Get URI for translated namespace index.
|
protected void |
internalSetUris(String[] uris)
Set namespace URIs.
|
int[] |
openNamespaces(int[] nums,
String[] prefs)
Open the specified namespaces.
|
void |
popExtensionNamespaces()
Remove extension namespace URIs.
|
void |
popTranslationTable()
Pop a translation table used for converting namespace index numbers to
values matching the internal lookup.
|
void |
pushExtensionNamespaces(String[] uris)
Append extension namespace URIs to those in mapping.
|
void |
pushTranslationTable(int[] table)
Push a translation table to be used for converting namespace index
numbers passed as arguments to values used for internal lookup.
|
void |
reset()
Reset to initial state for reuse.
|
protected static String[][] |
shrinkArray(String[][] base)
Shrink array of array of strings.
|
int |
translateNamespace(int index)
Translate a namespace index number to match internal tables.
|
protected abstract void |
undefineNamespace(int index)
Report to subclass that namespace has been undefined.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAttribute, close, closeEmptyTag, closeStartTag, endTag, flush, indent, init, setIndentSpaces, startTagClosed, startTagNamespaces, startTagOpen, writeCData, writeComment, writeDocType, writeEntityRef, writePI, writeTextContent, writeXMLDeclprotected String[] m_uris
protected String[] m_prefixes
public XMLWriterNamespaceBase(String[] uris)
uris - ordered array of URIs for namespaces used in document (must
be constant; the value in position 0 must always be the empty string "",
and the value in position 1 must always be the XML namespace
"http://www.w3.org/XML/1998/namespace")public XMLWriterNamespaceBase(XMLWriterNamespaceBase base, String[] uris)
base - existing instanceuris - ordered array of URIs for namespaces used in documentprotected abstract void defineNamespace(int index,
String prefix)
throws IOException
index - post-translation namespace URI index numberprefix - prefix used for namespaceIOException - if error writing to documentprotected abstract void undefineNamespace(int index)
index - post-translation namespace URI index numberprotected void internalSetUris(String[] uris)
uris - ordered array of URIs for namespaces used in documentpublic int[] openNamespaces(int[] nums,
String[] prefs)
throws IOException
openNamespaces in interface IXMLWriternums - array of namespace indexes defined by this element (reference
kept until namespaces are closed, values may be modified by this method)prefs - array of namespace prefixes mapped by this element (no
null values, use "" for default namespace declaration)IOException - on error writing to documentpublic final int getNestingDepth()
getNestingDepth in interface IXMLWriterpublic final int getNamespaceCount()
getNamespaceCount in interface IXMLWriterprotected void incrementNesting()
protected void decrementNesting()
public void reset()
reset in interface IXMLWriterpublic final String[] getNamespaces()
getNamespaces in interface IXMLWriterprotected final String internalNamespaceUri(int index)
index - namespace URI index number (post-translation)null if the namespace index
is invalidpublic final String getNamespaceUri(int index)
getNamespaceUri in interface IXMLWriterindex - namespace URI index numbernull if the namespace index
is invalidprotected final String internalNamespacePrefix(int index)
index - namespace URI index number (post-translation)null if the namespace is not
currently mappedpublic final String getNamespacePrefix(int index)
getNamespacePrefix in interface IXMLWriterindex - namespace URI index numbernull if the namespace is not
currently mappedpublic final int getPrefixIndex(String prefix)
getPrefixIndex in interface IXMLWriterprefix - text to match (non-null, use "" for default
prefix)protected static String[][] growArray(String[][] base, String[] items)
base - array to be grown (null is treated as zero
length)items - array of strings to be added at end of base arrayprotected static String[][] shrinkArray(String[][] base)
base - array to be shrunknull if
empty)public void pushExtensionNamespaces(String[] uris)
pushExtensionNamespaces in interface IXMLWriteruris - namespace URIs to extend those in mappingpublic void popExtensionNamespaces()
pushExtensionNamespaces(java.lang.String[]).popExtensionNamespaces in interface IXMLWriterpublic final String[][] getExtensionNamespaces()
getExtensionNamespaces in interface IXMLWriternull if
none)public int translateNamespace(int index)
index - raw namespace indexpublic void pushTranslationTable(int[] table)
pushTranslationTable in interface IXMLWritertable - translation table to be used (null if no
change)public void popTranslationTable()
popTranslationTable in interface IXMLWriterCopyright © 2005-2013 jibx.org. All Rights Reserved.