xpointer.xmlns
Class PrefixResolverImpl

java.lang.Object
  |
  +--xpointer.xmlns.PrefixResolverImpl
All Implemented Interfaces:
org.apache.xml.utils.PrefixResolver

public class PrefixResolverImpl
extends java.lang.Object
implements org.apache.xml.utils.PrefixResolver


Constructor Summary
PrefixResolverImpl()
          Creates new PrefixResolverImpl
 
Method Summary
 java.lang.String getBaseIdentifier()
          Return the base identifier.
 java.lang.String getNamespaceForPrefix(java.lang.String prefix)
          Given a namespace, get the corrisponding prefix.
 java.lang.String getNamespaceForPrefix(java.lang.String prefix, org.w3c.dom.Node context)
          Given a namespace, get the corrisponding prefix, based on the node context.
 void setNamespace(java.lang.String prefix, java.lang.String URI)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixResolverImpl

public PrefixResolverImpl()
Creates new PrefixResolverImpl
Method Detail

setNamespace

public void setNamespace(java.lang.String prefix,
                         java.lang.String URI)

getBaseIdentifier

public java.lang.String getBaseIdentifier()
Return the base identifier.
Specified by:
getBaseIdentifier in interface org.apache.xml.utils.PrefixResolver
Returns:
The base identifier from where relative URIs should be absolutized, or null if the base ID is unknown.

getNamespaceForPrefix

public java.lang.String getNamespaceForPrefix(java.lang.String prefix)
Given a namespace, get the corrisponding prefix. This assumes that the PrevixResolver hold's it's own namespace context, or is a namespace context itself.
Specified by:
getNamespaceForPrefix in interface org.apache.xml.utils.PrefixResolver
Parameters:
prefix - The prefix to look up, which may be an empty string ("") for the default Namespace.
Returns:
The associated Namespace URI, or null if the prefix is undeclared in this context.

getNamespaceForPrefix

public java.lang.String getNamespaceForPrefix(java.lang.String prefix,
                                              org.w3c.dom.Node context)
Given a namespace, get the corrisponding prefix, based on the node context.
Specified by:
getNamespaceForPrefix in interface org.apache.xml.utils.PrefixResolver
Parameters:
prefix - The prefix to look up, which may be an empty string ("") for the default Namespace.
context - The node context from which to look up the URI.
Returns:
The associated Namespace URI, or null if the prefix is undeclared in this context.