net.sf.saxon.expr
Class ParentNodeExpression

java.lang.Object
  extended by net.sf.saxon.expr.Expression
      extended by net.sf.saxon.expr.SingleNodeExpression
          extended by net.sf.saxon.expr.ParentNodeExpression
All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, EvaluableItem, SequenceIterable, InstructionInfo, Locator

public class ParentNodeExpression
extends SingleNodeExpression

Class ParentNodeExpression represents the XPath expression ".." or "parent::node()"

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.expr.Expression
EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, PUSH_SELECTION, staticProperties, WATCH_METHOD
 
Constructor Summary
ParentNodeExpression()
           
 
Method Summary
 PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
          Add a representation of this expression to a PathMap.
 Expression copy()
          Copy an expression.
 boolean equals(Object other)
          Is this expression the same as another expression?
 void explain(ExpressionPresenter destination)
          Diagnostic print of expression structure.
 String getExpressionName()
          Get a name identifying the kind of expression, in terms meaningful to a user.
 NodeInfo getNode(XPathContext context)
          Return the node selected by this SingleNodeExpression
 int hashCode()
          get HashCode for comparing two expressions
protected  String noContextMessage()
          Customize the error message on type checking
 String toString()
          The toString() method for an expression attempts to give a representation of the expression in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath.
 
Methods inherited from class net.sf.saxon.expr.SingleNodeExpression
computeCardinality, computeSpecialProperties, effectiveBooleanValue, evaluateItem, getIntrinsicDependencies, getItemType, iterate, optimize, typeCheck
 
Methods inherited from class net.sf.saxon.expr.Expression
adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getImplementationMethod, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, iterateSubExpressions, markTailFunctionCalls, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, typeError
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParentNodeExpression

public ParentNodeExpression()
Method Detail

getExpressionName

public String getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.

Overrides:
getExpressionName in class Expression
Returns:
a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in explain() output displaying the expression.

noContextMessage

protected String noContextMessage()
Customize the error message on type checking

Specified by:
noContextMessage in class SingleNodeExpression

getNode

public NodeInfo getNode(XPathContext context)
                 throws XPathException
Return the node selected by this SingleNodeExpression

Specified by:
getNode in class SingleNodeExpression
Parameters:
context - The context for the evaluation
Returns:
the parent of the current node defined by the context
Throws:
XPathException

copy

public Expression copy()
Copy an expression. This makes a deep copy.

Specified by:
copy in class Expression
Returns:
the copy of the original expression

addToPathMap

public PathMap.PathMapNodeSet addToPathMap(PathMap pathMap,
                                           PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap. The PathMap captures a map of the nodes visited by an expression in a source tree.

Overrides:
addToPathMap in class Expression
Parameters:
pathMap - the PathMap to which the expression should be added
pathMapNodeSet -
Returns:
the pathMapNode representing the focus established by this expression, in the case where this expression is the first operand of a path expression or filter expression

equals

public boolean equals(Object other)
Is this expression the same as another expression?

Overrides:
equals in class Object

hashCode

public int hashCode()
get HashCode for comparing two expressions

Overrides:
hashCode in class Object

toString

public String toString()
The toString() method for an expression attempts to give a representation of the expression in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath. In the case of XSLT instructions, the toString() method gives an abstracted view of the syntax

Overrides:
toString in class Expression
Returns:
a representation of the expression as a string

explain

public void explain(ExpressionPresenter destination)
Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.

Specified by:
explain in class Expression
Parameters:
destination - the expression presenter used to display the structure


Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.