FileDocCategorySizeDatePackage
DOMAdapter.javaAPI DocJava SE 5 API12061Fri Aug 26 14:55:40 BST 2005com.sun.org.apache.xalan.internal.xsltc.dom

DOMAdapter

public final class DOMAdapter extends Object implements DOM
author
Jacek Ambroziak
author
Morten Jorgensen

Fields Summary
private DOMEnhancedForDTM
_enhancedDOM
private DOM
_dom
private String[]
_namesArray
private String[]
_urisArray
private int[]
_typesArray
private String[]
_namespaceArray
private short[]
_mapping
private int[]
_reverse
private short[]
_NSmapping
private short[]
_NSreverse
private StripFilter
_filter
private int
_multiDOMMask
Constructors Summary
public DOMAdapter(DOM dom, String[] namesArray, String[] urisArray, int[] typesArray, String[] namespaceArray)

    
      
                       
                       
                       
                        
        if (dom instanceof DOMEnhancedForDTM){
            _enhancedDOM = (DOMEnhancedForDTM) dom;
        }

        _dom = dom;
        _namesArray = namesArray;
        _urisArray = urisArray;
        _typesArray = typesArray;
        _namespaceArray = namespaceArray;
    
Methods Summary
public voidcharacters(int textNode, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler)

        if (_enhancedDOM != null) {
            _enhancedDOM.characters(textNode, handler);
        }
        else {
            _dom.characters(textNode, handler);
        }
    
public voidcopy(int node, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler)

        _dom.copy(node, handler);
    
public voidcopy(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator nodes, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler)

	_dom.copy(nodes, handler);
    
public intgetAttributeNode(int type, int element)

	return _dom.getAttributeNode(getReverse()[type], element);
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorgetAxisIterator(int axis)

        if (_enhancedDOM != null) {
            return _enhancedDOM.getAxisIterator(axis);
        }
        else {
            return _dom.getAxisIterator(axis);
        }        
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorgetChildren(int node)

        if (_enhancedDOM != null) {
            return _enhancedDOM.getChildren(node);
        }
        else {
            DTMAxisIterator iterator = _dom.getChildren(node);
            return iterator.setStartNode(node);
        }
    
public com.sun.org.apache.xalan.internal.xsltc.DOMgetDOMImpl()

    	return _dom;
    
public intgetDocument()

        return _dom.getDocument();
    
public java.lang.StringgetDocumentURI()

        if (_enhancedDOM != null) {
            return _enhancedDOM.getDocumentURI();
        }
        else {
            return "";
        }
    
public java.lang.StringgetDocumentURI(int node)

        return _dom.getDocumentURI(node);
    
public com.sun.org.apache.xalan.internal.xsltc.runtime.HashtablegetElementsWithIDs()

        return _dom.getElementsWithIDs();
    
public intgetExpandedTypeID(int node)

        if (_enhancedDOM != null) {
            return getMapping()[_enhancedDOM.getExpandedTypeID2(node)];
        }
        else {
            return getMapping()[_dom.getExpandedTypeID(node)];
        }
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorgetIterator()
Returns singleton iterator containg the document root

        return _dom.getIterator();
    
public java.lang.StringgetLanguage(int node)

        return _dom.getLanguage(node);
    
private short[]getMapping()

        if (_mapping == null) {
            if (_enhancedDOM != null) {
                _mapping = _enhancedDOM.getMapping(_namesArray, _urisArray,
                                                   _typesArray);
            } 
        }
        return _mapping;
    
public intgetMultiDOMMask()

	return _multiDOMMask;
    
private short[]getNSMapping()

	if (_NSmapping == null) {
            if (_enhancedDOM != null) {
	        _NSmapping = _enhancedDOM.getNamespaceMapping(_namespaceArray);
            }
	}
	return _NSmapping;
    
private short[]getNSReverse()

	if (_NSreverse == null) {
            if (_enhancedDOM != null) {
	        _NSreverse = _enhancedDOM
                                  .getReverseNamespaceMapping(_namespaceArray);
            }
	}
	return _NSreverse;
    
public intgetNSType(int node)

	return _dom.getNSType(node);
    
public java.lang.String[]getNamesArray()

        return _namesArray;
    
public java.lang.String[]getNamespaceArray()

        return _namespaceArray;
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorgetNamespaceAxisIterator(int axis, int ns)

        return _dom.getNamespaceAxisIterator(axis, getNSReverse()[ns]);
    
public java.lang.StringgetNamespaceName(int node)

    	if (node == DTM.NULL) {
    	    return "";
    	}
        return _dom.getNamespaceName(node);
    
public intgetNamespaceType(int node)

    	return getNSMapping()[_dom.getNSType(node)];
    
public intgetNodeHandle(int nodeId)

    	return _dom.getNodeHandle(nodeId);
    
public intgetNodeIdent(int nodeHandle)

    	return _dom.getNodeIdent(nodeHandle);
    
public java.lang.StringgetNodeName(int node)

    	if (node == DTM.NULL) {
    	    return "";
    	}
        return _dom.getNodeName(node);
    
public java.lang.StringgetNodeNameX(int node)

    	if (node == DTM.NULL) {
    	    return "";
    	}
        return _dom.getNodeNameX(node);
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorgetNodeValueIterator(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator iterator, int type, java.lang.String value, boolean op)

        return _dom.getNodeValueIterator(iterator, type, value, op);
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorgetNthDescendant(int type, int n, boolean includeself)

        return _dom.getNthDescendant(getReverse()[type], n, includeself);
    
public com.sun.org.apache.xml.internal.serializer.SerializationHandlergetOutputDomBuilder()
Returns a SerializationHandler class wrapped in a SAX adapter.

    	return _dom.getOutputDomBuilder();
    
public intgetParent(int node)

        return _dom.getParent(node);
    
public com.sun.org.apache.xalan.internal.xsltc.DOMgetResultTreeFrag(int initSize, int rtfType)
Return a instance of a DOM class to be used as an RTF

    	if (_enhancedDOM != null) {
    	    return _enhancedDOM.getResultTreeFrag(initSize, rtfType);
    	}
    	else {
    	    return _dom.getResultTreeFrag(initSize, rtfType);
    	}
    
public com.sun.org.apache.xalan.internal.xsltc.DOMgetResultTreeFrag(int initSize, int rtfType, boolean addToManager)
Return a instance of a DOM class to be used as an RTF

    	if (_enhancedDOM != null) {
    	    return _enhancedDOM.getResultTreeFrag(initSize, rtfType,
                                                  addToManager);
    	}
    	else {
	    return _dom.getResultTreeFrag(initSize, rtfType, addToManager);
	}
    
private int[]getReverse()

	if (_reverse == null) {
            if (_enhancedDOM != null) {
	        _reverse = _enhancedDOM.getReverseMapping(_namesArray,
                                                          _urisArray,
                                                          _typesArray);
            }
	}
	return _reverse;
    
public intgetSize()

        return _dom.getSize();
    
public java.lang.StringgetStringValue()

        return _dom.getStringValue();
    
public java.lang.StringgetStringValueX(int node)

    	
    	if (_enhancedDOM != null) {
            return _enhancedDOM.getStringValueX(node);
        }
        else {
            if (node == DTM.NULL) {
    	        return "";
    	    }
            return _dom.getStringValueX(node);
        }
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorgetTypedAxisIterator(int axis, int type)

        final int[] reverse = getReverse();
        if (_enhancedDOM != null) {
            return _enhancedDOM.getTypedAxisIterator(axis, reverse[type]);
        } else {
            return _dom.getTypedAxisIterator(axis, type);
        }      
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratorgetTypedChildren(int type)

        final int[] reverse = getReverse();

        if (_enhancedDOM != null) {
            return _enhancedDOM.getTypedChildren(reverse[type]);
        }
        else {
            return _dom.getTypedChildren(type);
        }      
    
public int[]getTypesArray()

    	return _typesArray;
    
public java.lang.StringgetUnparsedEntityURI(java.lang.String entity)

        return _dom.getUnparsedEntityURI(entity);
    
public java.lang.String[]getUrisArray()

    	return _urisArray;
    
public booleanisAttribute(int node)

        return(_dom.isAttribute(node));
    
public booleanisElement(int node)

        return(_dom.isElement(node));
    
public booleanlessThan(int node1, int node2)

        return _dom.lessThan(node1, node2);
    
public java.lang.StringlookupNamespace(int node, java.lang.String prefix)

	return _dom.lookupNamespace(node, prefix);
    
public org.w3c.dom.NodemakeNode(int index)

        return _dom.makeNode(index);
    
public org.w3c.dom.NodemakeNode(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator iter)

        return _dom.makeNode(iter);
    
public org.w3c.dom.NodeListmakeNodeList(int index)

        return _dom.makeNodeList(index);
    
public org.w3c.dom.NodeListmakeNodeList(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator iter)

        return _dom.makeNodeList(iter);
    
public com.sun.org.apache.xml.internal.dtm.DTMAxisIteratororderNodes(com.sun.org.apache.xml.internal.dtm.DTMAxisIterator source, int node)

        return _dom.orderNodes(source, node);
    
public voidsetDocumentURI(java.lang.String uri)

        if (_enhancedDOM != null) {
            _enhancedDOM.setDocumentURI(uri);
        }
    
public voidsetFilter(com.sun.org.apache.xalan.internal.xsltc.StripFilter filter)

	_filter = filter;
    
public voidsetMultiDOMMask(int mask)

	_multiDOMMask = mask;
    
public voidsetupMapping(java.lang.String[] names, java.lang.String[] urisArray, int[] typesArray, java.lang.String[] namespaces)

        _namesArray = names;
        _urisArray = urisArray;
        _typesArray = typesArray;
        _namespaceArray = namespaces;
    
public java.lang.StringshallowCopy(int node, com.sun.org.apache.xml.internal.serializer.SerializationHandler handler)

        if (_enhancedDOM != null) {
            return _enhancedDOM.shallowCopy(node, handler);
        }
        else {
            return _dom.shallowCopy(node, handler);
        }