DTMDefaultBaseIteratorspublic abstract class DTMDefaultBaseIterators extends DTMDefaultBaseTraversers This class implements the traversers for DTMDefaultBase. |
Constructors Summary |
---|
public DTMDefaultBaseIterators(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 DTMDefaultBaseIterators(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.DTMAxisIterator | getAxisIterator(int axis)This is a shortcut to the iterators that implement the
XPath axes.
Returns a bare-bones iterator that must be initialized
with a start node (using iterator.setStartNode()).
DTMAxisIterator iterator = null;
switch (axis)
{
case Axis.SELF :
iterator = new SingletonIterator();
break;
case Axis.CHILD :
iterator = new ChildrenIterator();
break;
case Axis.PARENT :
return (new ParentIterator());
case Axis.ANCESTOR :
return (new AncestorIterator());
case Axis.ANCESTORORSELF :
return ((new AncestorIterator()).includeSelf());
case Axis.ATTRIBUTE :
return (new AttributeIterator());
case Axis.DESCENDANT :
iterator = new DescendantIterator();
break;
case Axis.DESCENDANTORSELF :
iterator = (new DescendantIterator()).includeSelf();
break;
case Axis.FOLLOWING :
iterator = new FollowingIterator();
break;
case Axis.PRECEDING :
iterator = new PrecedingIterator();
break;
case Axis.FOLLOWINGSIBLING :
iterator = new FollowingSiblingIterator();
break;
case Axis.PRECEDINGSIBLING :
iterator = new PrecedingSiblingIterator();
break;
case Axis.NAMESPACE :
iterator = new NamespaceIterator();
break;
case Axis.ROOT :
iterator = new RootIterator();
break;
default :
throw new DTMException(XMLMessages.createXMLMessage(
XMLErrorResources.ER_ITERATOR_AXIS_NOT_IMPLEMENTED,
new Object[]{Axis.getNames(axis)}));
//"Error: iterator for axis '" + Axis.names[axis]
//+ "' not implemented");
}
return (iterator);
| public com.sun.org.apache.xml.internal.dtm.DTMAxisIterator | getTypedAxisIterator(int axis, int type)Get an iterator that can navigate over an XPath Axis, predicated by
the extended type ID.
Returns an iterator that must be initialized
with a start node (using iterator.setStartNode()).
DTMAxisIterator iterator = null;
/* This causes an error when using patterns for elements that
do not exist in the DOM (translet types which do not correspond
to a DOM type are mapped to the DOM.ELEMENT type).
*/
// if (type == NO_TYPE) {
// return(EMPTYITERATOR);
// }
// else if (type == ELEMENT) {
// iterator = new FilterIterator(getAxisIterator(axis),
// getElementFilter());
// }
// else
{
switch (axis)
{
case Axis.SELF :
iterator = new TypedSingletonIterator(type);
break;
case Axis.CHILD :
iterator = new TypedChildrenIterator(type);
break;
case Axis.PARENT :
return (new ParentIterator().setNodeType(type));
case Axis.ANCESTOR :
return (new TypedAncestorIterator(type));
case Axis.ANCESTORORSELF :
return ((new TypedAncestorIterator(type)).includeSelf());
case Axis.ATTRIBUTE :
return (new TypedAttributeIterator(type));
case Axis.DESCENDANT :
iterator = new TypedDescendantIterator(type);
break;
case Axis.DESCENDANTORSELF :
iterator = (new TypedDescendantIterator(type)).includeSelf();
break;
case Axis.FOLLOWING :
iterator = new TypedFollowingIterator(type);
break;
case Axis.PRECEDING :
iterator = new TypedPrecedingIterator(type);
break;
case Axis.FOLLOWINGSIBLING :
iterator = new TypedFollowingSiblingIterator(type);
break;
case Axis.PRECEDINGSIBLING :
iterator = new TypedPrecedingSiblingIterator(type);
break;
case Axis.NAMESPACE :
iterator = new TypedNamespaceIterator(type);
break;
case Axis.ROOT :
iterator = new TypedRootIterator(type);
break;
default :
throw new DTMException(XMLMessages.createXMLMessage(
XMLErrorResources.ER_TYPED_ITERATOR_AXIS_NOT_IMPLEMENTED,
new Object[]{Axis.getNames(axis)}));
//"Error: typed iterator for axis "
//+ Axis.names[axis] + "not implemented");
}
}
return (iterator);
|
|