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 String
Prefix this namespace is (permanently) bound to.Fields inherited from class org.codehaus.staxmate.out.SMNamespace
_uri
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
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).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 boolean
isValidIn
(SMOutputContext ctxt) Method used to verify that the namespace is actually valid within the specified output context.boolean
void
prefersDefaultNs
(boolean state) 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).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:
getPreferredPrefix
in 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:
getBoundPrefix
in classSMNamespace
-
getLastBoundPrefix
- Specified by:
getLastBoundPrefix
in classSMNamespace
-
prefersDefaultNs
public boolean prefersDefaultNs()- Specified by:
prefersDefaultNs
in classSMNamespace
-
prefersDefaultNs
public void prefersDefaultNs(boolean state) - Specified by:
prefersDefaultNs
in classSMNamespace
-
setPreferredPrefix
Description copied from class:SMNamespace
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).- Specified by:
setPreferredPrefix
in classSMNamespace
-
isValidIn
Description copied from class:SMNamespace
Method used to verify that the namespace is actually valid within the specified output context.- Specified by:
isValidIn
in 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:
_bindAs
in classSMNamespace
-
_bindPermanentlyAs
Description copied from class:SMNamespace
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.- Specified by:
_bindPermanentlyAs
in classSMNamespace
-
_unbind
protected void _unbind()Description copied from class:SMNamespace
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.- Specified by:
_unbind
in classSMNamespace
-