FileDocCategorySizeDatePackage
JAXPNamespaceContextWrapper.javaAPI DocApache Xerces 3.0.13998Fri Sep 14 20:33:52 BST 2007org.apache.xerces.util

JAXPNamespaceContextWrapper

public final class JAXPNamespaceContextWrapper extends Object implements org.apache.xerces.xni.NamespaceContext

A read-only XNI wrapper around a JAXP NamespaceContext.

author
Michael Glavassevich, IBM
version
$Id: JAXPNamespaceContextWrapper.java 447241 2006-09-18 05:12:57Z mrglavas $

Fields Summary
private NamespaceContext
fNamespaceContext
private SymbolTable
fSymbolTable
private List
fPrefixes
Constructors Summary
public JAXPNamespaceContextWrapper(SymbolTable symbolTable)

        setSymbolTable(symbolTable);
    
Methods Summary
public booleandeclarePrefix(java.lang.String prefix, java.lang.String uri)

        return true;
    
public java.util.EnumerationgetAllPrefixes()

        // It's not possible to get the list of all prefixes from the NamespaceContext
        // so the best we can do is return an empty enumeration.
        return new Enumeration () {
            public boolean hasMoreElements() {
                return false;
            }
            public Object nextElement() {
                return null;
            }
        };
    
public java.lang.StringgetDeclaredPrefixAt(int index)

        return (String) fPrefixes.get(index);
    
public intgetDeclaredPrefixCount()

        return (fPrefixes != null) ? fPrefixes.size() : 0;
    
public java.util.ListgetDeclaredPrefixes()

        return fPrefixes;
    
public javax.xml.namespace.NamespaceContextgetNamespaceContext()

        return fNamespaceContext;
    
public java.lang.StringgetPrefix(java.lang.String uri)

        if (fNamespaceContext != null) {
            if (uri == null) {
                uri = XMLConstants.NULL_NS_URI;
            }
            String prefix = fNamespaceContext.getPrefix(uri);
            if (prefix == null) {
                prefix = XMLConstants.DEFAULT_NS_PREFIX;
            }
            return (fSymbolTable != null) ? fSymbolTable.addSymbol(prefix) : prefix.intern();
        }
        return null;
    
public SymbolTablegetSymbolTable()

        return fSymbolTable;
    
public java.lang.StringgetURI(java.lang.String prefix)

        if (fNamespaceContext != null) {
            String uri = fNamespaceContext.getNamespaceURI(prefix);
            if (uri != null && !XMLConstants.NULL_NS_URI.equals(uri)) {
                return (fSymbolTable != null) ? fSymbolTable.addSymbol(uri) : uri.intern();
            }
        }
        return null;
    
public voidpopContext()

public voidpushContext()

public voidreset()

public voidsetDeclaredPrefixes(java.util.List prefixes)

        fPrefixes = prefixes;
    
public voidsetNamespaceContext(javax.xml.namespace.NamespaceContext context)

        fNamespaceContext = context;
    
public voidsetSymbolTable(SymbolTable symbolTable)

        fSymbolTable = symbolTable;