Package org.codehaus.staxmate.out
Class SMNamespace
java.lang.Object
org.codehaus.staxmate.out.SMNamespace
- Direct Known Subclasses:
SMGlobalNamespace
,SMLocalNamespace
Abstract base class for all namespace objects (local and global ones).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Method called to indicate that the namespace is now bound to a specific prefix within current output context.protected abstract void
_bindPermanentlyAs
(String prefix) Method used to permanently bind this (local) namespace to a prefix.protected abstract void
_unbind()
Method called to indicate that the namespace is no longer bound to its current prefix within the current output context.abstract String
abstract String
abstract String
final String
getURI()
final boolean
protected abstract boolean
isValidIn
(SMOutputContext ctxt) Method used to verify that the namespace is actually valid within the specified output context.abstract boolean
abstract void
prefersDefaultNs
(boolean state) abstract void
setPreferredPrefix
(String prefPrefix) Method that can be called to associate a "preferred" prefix; prefix that this namespace should be bound to instead of some automatically generated one (unless that prefix is already bound to another URI).
-
Field Details
-
_uri
URI of the actual namespace this class encapsulates
-
-
Constructor Details
-
SMNamespace
-
-
Method Details
-
getURI
-
getPreferredPrefix
- Returns:
- Prefix that the caller application has at some point indicated to be a prefix it'd like to see; StaxMate may try to use it as the prefix to bind if there are no
-
getBoundPrefix
-
getLastBoundPrefix
-
prefersDefaultNs
public abstract boolean prefersDefaultNs() -
isBoundToPrefix
public final boolean isBoundToPrefix() -
prefersDefaultNs
public abstract void prefersDefaultNs(boolean state) -
setPreferredPrefix
Method that can be called to associate a "preferred" prefix; prefix that this namespace should be bound to instead of some automatically generated one (unless that prefix is already bound to another URI). -
isValidIn
Method used to verify that the namespace is actually valid within the specified output context. -
_bindAs
Method called to indicate that the namespace is now bound to a specific prefix within current output context. Note that this will not be called when the namespace is defined as the default namespace, but only when it is also bound to a prefix. -
_bindPermanentlyAs
Method used to permanently bind this (local) namespace to a prefix. Generally called if a new "global" binding is found at point where a global instance can not be created. Calling this method will essentially mark a local instace as behaving similar to a global one. -
_unbind
protected abstract void _unbind()Method called to indicate that the namespace is no longer bound to its current prefix within the current output context. Since default namespace declarations do not cause binding, this method will not be called for default namespaces either.
-