DTMDefaultBaseTraverserspublic abstract class DTMDefaultBaseTraversers extends DTMDefaultBase This class implements the traversers for DTMDefaultBase.
PLEASE NOTE that the public interface for all traversers should be
in terms of DTM Node Handles... but they may use the internal node
identity indices within their logic, for efficiency's sake. Be very
careful to avoid confusing these when maintaining this code. |
Constructors Summary |
---|
public DTMDefaultBaseTraversers(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing)Construct a DTMDefaultBaseTraversers object from a DOM node.
super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
doIndexing);
| public DTMDefaultBaseTraversers(DTMManager mgr, Source source, int dtmIdentity, DTMWSFilter whiteSpaceFilter, XMLStringFactory xstringfactory, boolean doIndexing, int blocksize, boolean usePrevsib, boolean newNameTable)Construct a DTMDefaultBaseTraversers object from a DOM node.
super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
doIndexing, blocksize, usePrevsib, newNameTable);
|
Methods Summary |
---|
public com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser | getAxisTraverser(int axis)This returns a stateless "traverser", that can navigate
over an XPath axis, though perhaps not in document order.
DTMAxisTraverser traverser;
if (null == m_traversers) // Cache of stateless traversers for this DTM
{
m_traversers = new DTMAxisTraverser[Axis.getNamesLength()];
traverser = null;
}
else
{
traverser = m_traversers[axis]; // Share/reuse existing traverser
if (traverser != null)
return traverser;
}
switch (axis) // Generate new traverser
{
case Axis.ANCESTOR :
traverser = new AncestorTraverser();
break;
case Axis.ANCESTORORSELF :
traverser = new AncestorOrSelfTraverser();
break;
case Axis.ATTRIBUTE :
traverser = new AttributeTraverser();
break;
case Axis.CHILD :
traverser = new ChildTraverser();
break;
case Axis.DESCENDANT :
traverser = new DescendantTraverser();
break;
case Axis.DESCENDANTORSELF :
traverser = new DescendantOrSelfTraverser();
break;
case Axis.FOLLOWING :
traverser = new FollowingTraverser();
break;
case Axis.FOLLOWINGSIBLING :
traverser = new FollowingSiblingTraverser();
break;
case Axis.NAMESPACE :
traverser = new NamespaceTraverser();
break;
case Axis.NAMESPACEDECLS :
traverser = new NamespaceDeclsTraverser();
break;
case Axis.PARENT :
traverser = new ParentTraverser();
break;
case Axis.PRECEDING :
traverser = new PrecedingTraverser();
break;
case Axis.PRECEDINGSIBLING :
traverser = new PrecedingSiblingTraverser();
break;
case Axis.SELF :
traverser = new SelfTraverser();
break;
case Axis.ALL :
traverser = new AllFromRootTraverser();
break;
case Axis.ALLFROMNODE :
traverser = new AllFromNodeTraverser();
break;
case Axis.PRECEDINGANDANCESTOR :
traverser = new PrecedingAndAncestorTraverser();
break;
case Axis.DESCENDANTSFROMROOT :
traverser = new DescendantFromRootTraverser();
break;
case Axis.DESCENDANTSORSELFFROMROOT :
traverser = new DescendantOrSelfFromRootTraverser();
break;
case Axis.ROOT :
traverser = new RootTraverser();
break;
case Axis.FILTEREDLIST :
return null; // Don't want to throw an exception for this one.
default :
throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_UNKNOWN_AXIS_TYPE, new Object[]{Integer.toString(axis)})); //"Unknown axis traversal type: "+axis);
}
if (null == traverser)
throw new DTMException(XMLMessages.createXMLMessage(XMLErrorResources.ER_AXIS_TRAVERSER_NOT_SUPPORTED, new Object[]{Axis.getNames(axis)}));
// "Axis traverser not supported: "
// + Axis.names[axis]);
m_traversers[axis] = traverser;
return traverser;
|
|