gnu.kawa.xml

Class TreeScanner

Implemented Interfaces:
Externalizable, Named
Known Direct Subclasses:
AncestorAxis, AncestorOrSelfAxis, AttributeAxis, ChildAxis, DescendantAxis, DescendantOrSelfAxis, FollowingAxis, FollowingSiblingAxis, ParentAxis, PrecedingAxis, PrecedingSiblingAxis, SelfAxis

public abstract class TreeScanner
extends MethodProc
implements Externalizable

Abstract class that scans part of a node tree. Takes a node argument, and writes matching "relative" nodes out to a PositionConsumer as a sequence of position pairs. This is uses to implement "path expressions" as in XPath/XSLT/XQuery. For example, the ChildAxis sub-class writes out all child nodes of the argument that match the 'type' NodePredicate.

Field Summary

NodePredicate
type

Fields inherited from class gnu.mapping.MethodProc

NO_MATCH, NO_MATCH_AMBIGUOUS, NO_MATCH_BAD_TYPE, NO_MATCH_TOO_FEW_ARGS, NO_MATCH_TOO_MANY_ARGS, argTypes

Fields inherited from class gnu.mapping.ProcedureN

noArgs

Method Summary

void
apply(CallContext ctx)
int
numArgs()
void
readExternal(ObjectInput in)
abstract void
scan(AbstractSequence seq, int ipos, PositionConsumer out)
String
toString()
void
writeExternal(ObjectOutput out)

Methods inherited from class gnu.mapping.MethodProc

applyN, getParameterType, isApplicable, matchFailAsException, mostSpecific, mostSpecific, numParameters, resolveParameterTypes

Methods inherited from class gnu.mapping.ProcedureN

apply0, apply1, apply2, apply3, apply4, applyN

Methods inherited from class gnu.mapping.Procedure

apply, apply, apply0, apply1, apply2, apply3, apply4, applyN, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, numArgs, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString

Field Details

type

public NodePredicate type

Method Details

apply

public void apply(CallContext ctx)
            throws Throwable
Overrides:
apply in interface Procedure

numArgs

public int numArgs()
Overrides:
numArgs in interface Procedure

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException

scan

public abstract void scan(AbstractSequence seq,
                          int ipos,
                          PositionConsumer out)

toString

public String toString()
Overrides:
toString in interface Procedure

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException