Package net.sf.saxon.pattern
Class StreamingFunctionArgumentPattern
- java.lang.Object
-
- net.sf.saxon.expr.Expression
-
- net.sf.saxon.expr.PseudoExpression
-
- net.sf.saxon.pattern.Pattern
-
- net.sf.saxon.pattern.StreamingFunctionArgumentPattern
-
- All Implemented Interfaces:
ExportAgent
,Locatable
,IdentityComparable
,Traceable
public class StreamingFunctionArgumentPattern extends Pattern
This is a special pattern that matches the node supplied as the first argument of a call to a streamable stylesheet function; it corresponds to the pattern match="$arg" where $arg is the first argument of the function.
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
StreamingFunctionArgumentPattern()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Pattern
copy(RebindingMap rebindings)
Copy an AnchorPattern.void
export(ExpressionPresenter presenter)
Diagnostic print of expression structure.static StreamingFunctionArgumentPattern
getInstance()
ItemType
getItemType()
Get a NodeTest that all the nodes matching this pattern must satisfyUType
getUType()
Get a UType indicating which kinds of items this Pattern can match.boolean
matches(Item item, XPathContext context)
Determine whether this Pattern matches the given Node.java.lang.String
reconstruct()
Reconstruct a string representation of the pattern in cases where the original string is not availablePattern
typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType)
Type-check the pattern.-
Methods inherited from class net.sf.saxon.pattern.Pattern
allocateSlots, bindCurrent, convertToTypedPattern, effectiveBooleanValue, getDefaultPriority, getDependencies, getFingerprint, getHostLanguage, getOriginalText, handleDynamicError, isLiftable, isMotionless, isRecoverable, make, matchesBeneathAnchor, matchesCurrentGroup, optimize, patternContainsVariable, replaceCurrent, selectNodes, setOriginalText, setPriority, setRecoverable, simplify, toPattern, toShortString, toString
-
Methods inherited from class net.sf.saxon.expr.PseudoExpression
computeCardinality, evaluateAsString, evaluateItem, getImplementationMethod, iterate, process
-
Methods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeHashCode, computeSpecialProperties, computeStaticProperties, dynamicError, equals, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getCost, getEvaluationMethod, getExpressionName, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operands, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplifyChildren, staticTypeCheck, suppressValidation, typeCheckChildren, typeError, unordered, verifyParentPointers
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
-
-
-
Method Detail
-
getInstance
public static StreamingFunctionArgumentPattern getInstance()
-
getUType
public UType getUType()
Get a UType indicating which kinds of items this Pattern can match.
-
typeCheck
public Pattern typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
Type-check the pattern.- Overrides:
typeCheck
in classPattern
- Parameters:
visitor
- the expression visitorcontextItemType
- the type of the context item at the point where the pattern is defined. Set to null if it is known that the context item is undefined.- Returns:
- the optimised Pattern
- Throws:
XPathException
- if an error is discovered during this phase (typically a type error)
-
matches
public boolean matches(Item item, XPathContext context) throws XPathException
Determine whether this Pattern matches the given Node. This is the main external interface for matching patterns: it sets current() to the node being tested- Specified by:
matches
in classPattern
- Parameters:
item
- The NodeInfo representing the Element or other node to be tested against the Patterncontext
- The dynamic context. Only relevant if the pattern uses variables, or contains calls on functions such as document() or key().- Returns:
- true if the node matches the Pattern, false otherwise
- Throws:
XPathException
- if an error occurs while matching the pattern (the caller will usually treat this the same as a false result)
-
getItemType
public ItemType getItemType()
Get a NodeTest that all the nodes matching this pattern must satisfy- Specified by:
getItemType
in classPattern
- Returns:
- a NodeTest, as specific as possible, which all the matching nodes satisfy
-
reconstruct
public java.lang.String reconstruct()
Description copied from class:Pattern
Reconstruct a string representation of the pattern in cases where the original string is not available- Overrides:
reconstruct
in classPattern
-
export
public void export(ExpressionPresenter presenter) throws XPathException
Description copied from class:Expression
Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.- Specified by:
export
in interfaceExportAgent
- Specified by:
export
in classPattern
- Parameters:
presenter
- the expression presenter used to display the structure- Throws:
XPathException
- if the export fails, for example if an expression is found that won't work in the target environment.
-
copy
public Pattern copy(RebindingMap rebindings)
Copy an AnchorPattern. Since there is only one, return the same.
-
-