| java.lang.Object org.jibx.runtime.impl.XMLWriterNamespaceBase
All known Subclasses: org.jibx.runtime.impl.XMLWriterBase, org.jibx.runtime.impl.StAXWriter, org.jibx.extras.JDOMWriter,
XMLWriterNamespaceBase | abstract public class XMLWriterNamespaceBase implements IXMLWriter(Code) | | Base implementation of XML writer interface namespace handling. This tracks
only the namespace declarations and the element nesting depth. It can be used
as a base class for all forms of output.
author: Dennis M. Sosnoski version: 1.0 |
m_prefixes | protected String[] m_prefixes(Code) | | Prefixes currently defined for namespaces.
|
XMLWriterNamespaceBase | public XMLWriterNamespaceBase(String[] uris)(Code) | | Constructor.
Parameters: uris - ordered array of URIs for namespaces used in document (mustbe 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") |
XMLWriterNamespaceBase | public XMLWriterNamespaceBase(XMLWriterNamespaceBase base, String[] uris)(Code) | | Copy constructor. This initializes the extension namespace information
from an existing instance.
Parameters: base - existing instance Parameters: uris - ordered array of URIs for namespaces used in document |
decrementNesting | protected void decrementNesting()(Code) | | Decrement the current nesting depth. Subclasses need to call this method
whenever an element end tag is written.
|
defineNamespace | abstract protected void defineNamespace(int index, String prefix) throws IOException(Code) | | Report to subclass that namespace has been defined.
Parameters: index - namespace URI index number Parameters: prefix - prefix used for namespace throws: IOException - if error writing to document |
getExtensionNamespaces | final public String[][] getExtensionNamespaces()(Code) | | Get extension namespace URIs added to those in mapping. This gets the
current set of extension definitions. The returned arrays must not be
modified.
array of arrays of extension namespaces (null ifnone) |
getNamespaceCount | final public int getNamespaceCount()(Code) | | Get the number of namespaces currently defined. This is equivalent to the
index of the next extension namespace added.
namespace count |
getNamespacePrefix | final public String getNamespacePrefix(int index)(Code) | | Get current prefix defined for namespace.
Parameters: index - namespace URI index number current prefix text, or null if the namespace is notcurrently mapped |
getNamespaceUri | final public String getNamespaceUri(int index)(Code) | | Get URI for namespace.
Parameters: index - namespace URI index number namespace URI text, or null if the namespace indexis invalid |
getNamespaces | final public String[] getNamespaces()(Code) | | Get namespace URIs for mapping. This gets the full ordered array of
namespaces known in the binding used for this marshalling, where the
index number of each namespace URI is the namespace index used to lookup
the prefix when marshalling a name in that namespace. The returned array
must not be modified.
array of namespaces |
getNestingDepth | final public int getNestingDepth()(Code) | | Get the current element nesting depth. Elements are only counted in the
depth returned when they're officially open - after the start tag has
been output and before the end tag has been output.
number of nested elements at current point in output |
getPrefixIndex | final public int getPrefixIndex(String prefix)(Code) | | Get index of namespace mapped to prefix. This can be an expensive
operation with time proportional to the number of namespaces defined, so
it should be used with care.
Parameters: prefix - text to match (non-null , use "" for defaultprefix) index namespace URI index number mapped to prefix |
growArray | protected static String[][] growArray(String[][] base, String[] items)(Code) | | Grow array of array of strings.
Parameters: base - array to be grown (null is treated as zerolength) Parameters: items - array of strings to be added at end of base array array with added array of items |
incrementNesting | protected void incrementNesting()(Code) | | Increment the current nesting depth. Subclasses need to call this method
whenever an element start tag is written.
|
openNamespaces | public int[] openNamespaces(int[] nums, String[] prefs) throws IOException(Code) | | Open the specified namespaces. Previously active namespace declarations
are not duplicated.
Parameters: nums - array of namespace indexes defined by this element (mustbe constant, reference is kept until end of element) Parameters: prefs - array of namespace prefixes mapped by this element (nonull values, use "" for default namespace declaration) array of indexes for namespaces not previously active (the onesactually needing to be declared, in the case of text output) throws: IOException - on error writing to document |
pushExtensionNamespaces | public void pushExtensionNamespaces(String[] uris)(Code) | | Append extension namespace URIs to those in mapping.
Parameters: uris - namespace URIs to extend those in mapping |
reset | public void reset()(Code) | | Reset to initial state for reuse. Subclasses overriding this method need
to call this base class implementation during their processing.
|
shrinkArray | protected static String[][] shrinkArray(String[][] base)(Code) | | Shrink array of array of strings.
Parameters: base - array to be shrunk array with last set of items eliminated (null ifempty) |
undefineNamespace | abstract protected void undefineNamespace(int index)(Code) | | Report to subclass that namespace has been undefined.
Parameters: index - namespace URI index number |
|
|