|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xpath.compiler.OpMap | +--org.apache.xpath.compiler.Compiler
**For advanced use only** An instance of this class compiles an XPath string expression into a Expression object. This class compiles the string into a sequence of operation codes (op map) and then builds from that into an Expression tree.
Fields inherited from class org.apache.xpath.compiler.OpMap |
m_opMap,
m_tokenQueue,
m_tokenQueueSize,
MAPINDEX_LENGTH |
Constructor Summary | |
Compiler()
Construct a Compiler instance that has a null error listener and a null source locator. |
|
Compiler(ErrorListener errorHandler,
SourceLocator locator)
Construct a Compiler object with a specific ErrorListener and SourceLocator where the expression is located. |
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)
Compile a zero or more predicates for a given match pattern. |
int |
getLocationPathDepth()
Get the level of the location path or union being constructed. |
PrefixResolver |
getNamespaceContext()
Get the current namespace context for the xpath. |
int |
getWhatToShow(int opPos)
Get a NodeFilter bit set that tells what
to show for a given node test. |
Expression |
locationPath(int opPos)
Compile a location path. |
Expression |
locationPathPattern(int opPos)
Compile a location match pattern unit expression. |
Expression |
predicate(int opPos)
Compile a location step predicate expression. |
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,
getToken,
getTokenQueue,
getTokenQueueSize,
toString |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Compiler(ErrorListener errorHandler, SourceLocator locator)
errorHandler
- Error listener where messages will be sent, or null
if messages should be sent to System err.locator
- The location object where the expression lives, which
may be null.public Compiler()
Method Detail |
public Expression compile(int opPos) throws TransformerException
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.public int getLocationPathDepth()
public Expression locationPath(int opPos) throws TransformerException
AxesWalker
children.opPos
- The current position in the m_opMap array.LocPathIterator
instance.public Expression predicate(int opPos) throws TransformerException
opPos
- The current position in the m_opMap array.public Expression locationPathPattern(int opPos) throws TransformerException
opPos
- The current position in the m_opMap array.StepPattern
instance.public int getWhatToShow(int opPos)
NodeFilter
bit set that tells what
to show for a given node test.opPos
- the op map position for the location step.NodeFilter
bit set that tells what
to show for a given node test.public Expression[] getCompiledPredicates(int opPos) throws TransformerException
opPos
- The position of the first predicate the m_opMap array.Expression
instances.public int countPredicates(int opPos) throws TransformerException
opPos
- The position of the first predicate the m_opMap array.public void warn(int msg, java.lang.Object[] args) throws TransformerException
msg
- An error number that corresponds to one of the numbers found
in XPATHErrorResources
, which is
a key for a format string.args
- An array of arguments represented in the format string, which
may be null.public void assert(boolean b, java.lang.String msg)
b
- If false, a runtime exception will be thrown.msg
- The assertion message, which should be informative.public void error(int msg, java.lang.Object[] args) throws TransformerException
msg
- An error number that corresponds to one of the numbers found
in XPATHErrorResources
, which is
a key for a format string.args
- An array of arguments represented in the format string, which
may be null.public PrefixResolver getNamespaceContext()
public void setNamespaceContext(PrefixResolver pr)
pr
- The resolver for prefixes in the XPath expression.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |