org.apache.xpath.compiler
Class Compiler

java.lang.Object
  |
  +--org.apache.xpath.compiler.OpMap
        |
        +--org.apache.xpath.compiler.Compiler

public class Compiler
extends OpMap


Fields inherited from class org.apache.xpath.compiler.OpMap
m_opMap, m_tokenQueue, m_tokenQueueSize, MAPINDEX_LENGTH
 
Constructor Summary
Compiler()
           
Compiler(ErrorHandler errorHandler, Locator locator)
           
 
Method Summary
 void assert(boolean b, java.lang.String msg)
          Tell the user of an assertion error, and probably throw an exception.
 Expression compile(int opPos)
          **For advanced use only** Execute the XPath object from a given opcode position.
 int countPredicates(int opPos)
          Count the number of predicates in the step.
 void error(int msg, java.lang.Object[] args)
          Tell the user of an error, and probably throw an exception.
 Expression[] getCompiledPredicates(int opPos)
           
 PrefixResolver getNamespaceContext()
          Get the current namespace context for the xpath.
 int getWhatToShow(int opPos)
           
 Expression locationPath(int opPos)
          **For advanced use only** Execute a location path.
 Expression locationPathPattern(int opPos)
          Execute a a location path pattern.
 Expression predicate(int opPos)
          **For advanced use only** Evaluate a predicate.
 void setNamespaceContext(PrefixResolver pr)
          Set the current namespace context for the xpath.
 void warn(int msg, java.lang.Object[] args)
          Warn the user of an problem.
 
Methods inherited from class org.apache.xpath.compiler.OpMap
getArgLength, getArgLengthOfStep, getFirstChildPos, getFirstChildPosOfStep, getFirstPredicateOpPos, getNextOpPos, getNextOpPos, getNextStepPos, getOp, getOpMap, getPatternString, getStepLocalName, getStepNS, getStepTestType, getTargetElementQNames, getToken, getTokenQueue, getTokenQueueSize, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Compiler

public Compiler(ErrorHandler errorHandler,
                Locator locator)

Compiler

public Compiler()
Method Detail

compile

public Expression compile(int opPos)
                   throws SAXException
**For advanced use only** Execute the XPath object from a given opcode position.
Parameters:
xctxt - The execution context.
context - The current source tree context node.
opPos - The current position in the xpath.m_opMap array.
callback - Interface that implements the processLocatedNode method.
callbackInfo - Object that will be passed to the processLocatedNode method.
Returns:
The result of the XPath.

locationPath

public Expression locationPath(int opPos)
                        throws SAXException
**For advanced use only** Execute a location path.
Parameters:
context - The current source tree context node.
opPos - The current position in the m_opMap array.
callback - Interface that implements the processLocatedNode method.
callbackInfo - Object that will be passed to the processLocatedNode method.

predicate

public Expression predicate(int opPos)
                     throws SAXException
**For advanced use only** Evaluate a predicate.
Parameters:
context - The current source tree context node.
opPos - The current position in the m_opMap array.

locationPathPattern

public Expression locationPathPattern(int opPos)
                               throws SAXException
Execute a a location path pattern. This will return a score of MATCH_SCORE_NONE, MATCH_SCORE_NODETEST, MATCH_SCORE_OTHER, MATCH_SCORE_QNAME.
Parameters:
xpath - The xpath that is executing.
context - The current source tree context node.
opPos - The current position in the xpath.m_opMap array.

getWhatToShow

public int getWhatToShow(int opPos)

getCompiledPredicates

public Expression[] getCompiledPredicates(int opPos)
                                   throws SAXException

countPredicates

public int countPredicates(int opPos)
                    throws SAXException
Count the number of predicates in the step.

warn

public void warn(int msg,
                 java.lang.Object[] args)
          throws SAXException
Warn the user of an problem.

assert

public void assert(boolean b,
                   java.lang.String msg)
            throws SAXException
Tell the user of an assertion error, and probably throw an exception.

error

public void error(int msg,
                  java.lang.Object[] args)
           throws SAXException
Tell the user of an error, and probably throw an exception.

getNamespaceContext

public PrefixResolver getNamespaceContext()
Get the current namespace context for the xpath.

setNamespaceContext

public void setNamespaceContext(PrefixResolver pr)
Set the current namespace context for the xpath.


Copyright © 2000 Apache XML Project. All Rights Reserved.