|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.xml.parsing.NamespaceHandling
public class NamespaceHandling
This class is used by the UnmarshalHandler to handle name spaces. It
manages a stack of name spaces, keeps track of when an new name space scope
is needed and maps name space URIs to package names.
| Constructor Summary | |
|---|---|
NamespaceHandling()
|
|
| Method Summary | |
|---|---|
void |
addDefaultNamespace(String namespaceURI)
Binds the namespaceURI to the default namespace. |
void |
addNamespace(String prefix,
String namespaceURI)
Binds the namespaceURI to the prefix |
void |
addNamespaceToPackageMapping(String nsURI,
String packageName)
Adds a mapping from the given namespace URI to the given package name. |
void |
createNamespace()
Creates a new name space. |
String |
getDefaultNamespaceURI()
Gets the namespace URI that is bound to the default name space. |
String |
getMappedPackage(String namespace)
Looks up the package name from the given namespace URI. |
String |
getNamespacePrefix(String namespaceURI)
Gets the prefix that is bound to a namespaceURI. |
NamespacesStack |
getNamespaceStack()
Returns the namespace stack. |
String |
getNamespaceURI(String prefix)
Gets the namespaceURI that is bound to a prefix. |
boolean |
isNewNamespaceScopeNecessary()
Indicates whether a new name space scope is needed. |
void |
processNamespaces(XMLClassDescriptor classDesc,
Object object)
Saves local namespace declarations to the object model if necessary. |
void |
removeCurrentNamespaceInstance()
Pops the current namespace instance |
Object |
resolveNamespace(Object value)
Extracts the prefix and resolves it to it's associated namespace. |
void |
setNewNamespaceScopeNecessary(boolean value)
|
void |
startNamespaceScope()
Starts a new name space scope, and resets the corresponding flag. |
void |
stopNamespaceScope()
Stops a name space scope, and resets the corresponding flag to false. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NamespaceHandling()
| Method Detail |
|---|
public void addNamespaceToPackageMapping(String nsURI,
String packageName)
nsURI - the namespace URI to map from.packageName - the package name to map to.public String getMappedPackage(String namespace)
namespace - the namespace URI to lookup
public void processNamespaces(XMLClassDescriptor classDesc,
Object object)
classDesc - the current ClassDescriptor.object - the Object of the current state
public Object resolveNamespace(Object value)
throws SAXException
value - the QName to resolve.
SAXException - if the nammespace associated with the prefix is nullpublic void removeCurrentNamespaceInstance()
public void addDefaultNamespace(String namespaceURI)
namespaceURI - Namespace URI
public void addNamespace(String prefix,
String namespaceURI)
prefix - XML name space prefixnamespaceURI - XML name space URI.public String getNamespacePrefix(String namespaceURI)
namespaceURI - the namespaceURI to get the prefix from
public String getNamespaceURI(String prefix)
prefix - the prefix to get the namespaceURI from
public String getDefaultNamespaceURI()
public void createNamespace()
public NamespacesStack getNamespaceStack()
public boolean isNewNamespaceScopeNecessary()
public void startNamespaceScope()
public void stopNamespaceScope()
public void setNewNamespaceScopeNecessary(boolean value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||