Package net.sf.saxon.expr.parser
Class ExpressionVisitor
- java.lang.Object
- 
- net.sf.saxon.expr.parser.ExpressionVisitor
 
- 
 public class ExpressionVisitor extends java.lang.ObjectThe ExpressionVisitor supports the various phases of processing of an expression tree which require a recursive walk of the tree structure visiting each node in turn. In maintains a stack holding the ancestor nodes of the node currently being visited.
- 
- 
Constructor SummaryConstructors Constructor Description ExpressionVisitor(Configuration config)Create an ExpressionVisitor
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecrementDepth()Decrement depthConfigurationgetConfiguration()Get the ConfigurationStaticContextgetStaticContext()Get the static context for the expressions being visited.java.lang.StringgetTargetEdition()Get the target environment for which we are optimizingbooleanincrementAndTestDepth()Increment and test depthbooleanisOptimizeForPatternMatching()Ask whether the visitor is to optimize expressions for evaluation as an XSLT match patternbooleanisOptimizeForStreaming()Ask whether the visitor is to optimize expressions for evaluation in a streaming environmentvoidissueWarning(java.lang.String message, Location locator)Issue a warning messagebooleanisSuppressWarnings()Ask if warnings have been suppressed.static ExpressionVisitormake(StaticContext env)Factory method: make an expression visitorXPathContextmakeDynamicContext()Create a dynamic context suitable for early evaluation of constant subexpressionsOptimizerobtainOptimizer()Obtain an optimizer.voidsetOptimizeForPatternMatching(boolean option)Tell the visitor to optimize expressions for evaluation as an XSLT match patternvoidsetOptimizeForStreaming(boolean option)Tell the visitor to optimize expressions for evaluation in a streaming environmentvoidsetStaticContext(StaticContext staticContext)Set the static context for the expressions being visited.voidsetSuppressWarnings(boolean suppressWarnings)Say whether warnings should be suppressed.
 
- 
- 
- 
Constructor Detail- 
ExpressionVisitorpublic ExpressionVisitor(Configuration config) Create an ExpressionVisitor- Parameters:
- config- the Saxon configuration
 
 
- 
 - 
Method Detail- 
getConfigurationpublic Configuration getConfiguration() Get the Configuration- Returns:
- the configuration
 
 - 
getStaticContextpublic StaticContext getStaticContext() Get the static context for the expressions being visited. Note: this may not reflect all changes in static context (e.g. namespace context, base URI) applying to nested expressions- Returns:
- the static context
 
 - 
setStaticContextpublic void setStaticContext(StaticContext staticContext) Set the static context for the expressions being visited. Note: this may not reflect all changes in static context (e.g. namespace context, base URI) applying to nested expressions- Parameters:
- staticContext- the static context
 
 - 
makepublic static ExpressionVisitor make(StaticContext env) Factory method: make an expression visitor- Parameters:
- env- the static context
- Returns:
- the new expression visitor
 
 - 
issueWarningpublic void issueWarning(java.lang.String message, Location locator)Issue a warning message- Parameters:
- message- the message
- locator- the query/stylesheet location associated with the message
 
 - 
makeDynamicContextpublic XPathContext makeDynamicContext() Create a dynamic context suitable for early evaluation of constant subexpressions- Returns:
- a dynamic evaluation context
 
 - 
obtainOptimizerpublic Optimizer obtainOptimizer() Obtain an optimizer. The optimizer is created on the first call of this method and is retained for use in subsequent calls.- Returns:
- a suitable optimizer, taking into account the optimization options defined by the Configuration and by the static context
 
 - 
setOptimizeForStreamingpublic void setOptimizeForStreaming(boolean option) Tell the visitor to optimize expressions for evaluation in a streaming environment- Parameters:
- option- true if optimizing for streaming
 
 - 
isOptimizeForStreamingpublic boolean isOptimizeForStreaming() Ask whether the visitor is to optimize expressions for evaluation in a streaming environment- Returns:
- true if optimizing for streaming
 
 - 
setOptimizeForPatternMatchingpublic void setOptimizeForPatternMatching(boolean option) Tell the visitor to optimize expressions for evaluation as an XSLT match pattern- Parameters:
- option- true if optimizing for pattern matching
 
 - 
isOptimizeForPatternMatchingpublic boolean isOptimizeForPatternMatching() Ask whether the visitor is to optimize expressions for evaluation as an XSLT match pattern- Returns:
- true if optimizing for pattern matching
 
 - 
getTargetEditionpublic java.lang.String getTargetEdition() Get the target environment for which we are optimizing- Returns:
- the target environment (for example "EE" or "JS"). Defaults to the edition of the current configuration
 
 - 
incrementAndTestDepthpublic boolean incrementAndTestDepth() Increment and test depth- Returns:
- true if the current depth is less than a maximum limit; and increment the current depth
 
 - 
decrementDepthpublic void decrementDepth() Decrement depth
 - 
isSuppressWarningspublic boolean isSuppressWarnings() Ask if warnings have been suppressed. This typically happens when processing code that has been copied, to prevent multiple warnings for the same code- Returns:
- true if warnings are suppressed
 
 - 
setSuppressWarningspublic void setSuppressWarnings(boolean suppressWarnings) Say whether warnings should be suppressed. This is typically done when processing code that has been copied, to prevent multiple warnings for the same code- Parameters:
- suppressWarnings- set to true to suppress warnings
 
 
- 
 
-