Package org.codehaus.staxmate.out
Class SMGlobalNamespace
java.lang.Object
org.codehaus.staxmate.out.SMNamespace
org.codehaus.staxmate.out.SMGlobalNamespace
Namespace that is global and shared for all
SMOutputContext)s
(~= XML documents or sub-trees). This includes the
pre-defined namespaces (ones with "xml" and "xmlns" prefixes as well
as the default "empty"/missing namespace, one bound to "" if no explicit
declaration is made).-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringPrefix this namespace is (permanently) bound to.Fields inherited from class org.codehaus.staxmate.out.SMNamespace
_uri -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidGlobal namespaces should never be bound/unbound, so if this gets called, an exception will be thrown (but note that this being an 'internal' method, this is more like an assertion).protected void_bindPermanentlyAs(String prefix) Method used to permanently bind this (local) namespace to a prefix.protected void_unbind()Method called to indicate that the namespace is no longer bound to its current prefix within the current output context.protected booleanisValidIn(SMOutputContext ctxt) Method used to verify that the namespace is actually valid within the specified output context.booleanvoidprefersDefaultNs(boolean state) voidsetPreferredPrefix(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).Methods inherited from class org.codehaus.staxmate.out.SMNamespace
getURI, isBoundToPrefix
-
Field Details
-
_prefix
Prefix this namespace is (permanently) bound to.
-
-
Constructor Details
-
SMGlobalNamespace
-
-
Method Details
-
getPreferredPrefix
- Specified by:
getPreferredPrefixin classSMNamespace- 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
- Specified by:
getBoundPrefixin classSMNamespace
-
getLastBoundPrefix
- Specified by:
getLastBoundPrefixin classSMNamespace
-
prefersDefaultNs
public boolean prefersDefaultNs()- Specified by:
prefersDefaultNsin classSMNamespace
-
prefersDefaultNs
public void prefersDefaultNs(boolean state) - Specified by:
prefersDefaultNsin classSMNamespace
-
setPreferredPrefix
Description copied from class:SMNamespaceMethod 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).- Specified by:
setPreferredPrefixin classSMNamespace
-
isValidIn
Description copied from class:SMNamespaceMethod used to verify that the namespace is actually valid within the specified output context.- Specified by:
isValidInin classSMNamespace
-
_bindAs
Global namespaces should never be bound/unbound, so if this gets called, an exception will be thrown (but note that this being an 'internal' method, this is more like an assertion).- Specified by:
_bindAsin classSMNamespace
-
_bindPermanentlyAs
Description copied from class:SMNamespaceMethod 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.- Specified by:
_bindPermanentlyAsin classSMNamespace
-
_unbind
protected void _unbind()Description copied from class:SMNamespaceMethod 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.- Specified by:
_unbindin classSMNamespace
-