public class Compiler extends OpMap
MAPINDEX_LENGTH
Constructor and Description |
---|
Compiler()
Construct a Compiler instance that has a null error listener and a
null source locator.
|
Compiler(javax.xml.transform.ErrorListener errorHandler,
javax.xml.transform.SourceLocator locator,
FunctionTable fTable)
Construct a Compiler object with a specific ErrorListener and
SourceLocator where the expression is located.
|
Modifier and Type | Method and Description |
---|---|
void |
assertion(boolean b,
java.lang.String msg)
Tell the user of an assertion error, and probably throw an
exception.
|
Expression |
compile(int opPos)
Execute the XPath object from a given opcode position.
|
int |
countPredicates(int opPos)
Count the number of predicates in the step.
|
void |
error(java.lang.String 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(java.lang.String msg,
java.lang.Object[] args)
Warn the user of an problem.
|
getArgLength, getArgLengthOfStep, getFirstChildPos, getFirstChildPosOfStep, getFirstPredicateOpPos, getNextOpPos, getNextOpPos, getNextStepPos, getOp, getOpMap, getPatternString, getStepLocalName, getStepNS, getStepTestType, getToken, getTokenQueue, getTokenQueueSize, setOp, toString
public Compiler(javax.xml.transform.ErrorListener errorHandler, javax.xml.transform.SourceLocator locator, FunctionTable fTable)
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, but which, if not null, must be valid over
the long haul, in other words, it will not be cloned.fTable
- The FunctionTable object where the xpath build-in
functions are stored.public Compiler()
public Expression compile(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the xpath.m_opMap array.javax.xml.transform.TransformerException
- if there is a syntax or other error.public int getLocationPathDepth()
public Expression locationPath(int opPos) throws javax.xml.transform.TransformerException
AxesWalker
children.opPos
- The current position in the m_opMap array.LocPathIterator
instance.javax.xml.transform.TransformerException
- if a error occurs creating the Expression.public Expression predicate(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.javax.xml.transform.TransformerException
- if a error occurs creating the Expression.public Expression locationPathPattern(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.StepPattern
instance.javax.xml.transform.TransformerException
- if a error occurs creating the Expression.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 javax.xml.transform.TransformerException
opPos
- The position of the first predicate the m_opMap array.Expression
instances.javax.xml.transform.TransformerException
- if a error occurs creating the Expression.public int countPredicates(int opPos) throws javax.xml.transform.TransformerException
opPos
- The position of the first predicate the m_opMap array.javax.xml.transform.TransformerException
- if a error occurs creating the Expression.public void warn(java.lang.String msg, java.lang.Object[] args) throws javax.xml.transform.TransformerException
msg
- An error msgkey that corresponds to one of the constants 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.javax.xml.transform.TransformerException
- if the current ErrorListoner determines to
throw an exception.public void assertion(boolean b, java.lang.String msg)
b
- If false, a runtime exception will be thrown.msg
- The assertion message, which should be informative.java.lang.RuntimeException
- if the b argument is false.public void error(java.lang.String msg, java.lang.Object[] args) throws javax.xml.transform.TransformerException
error
in class OpMap
msg
- An error msgkey that corresponds to one of the constants 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.javax.xml.transform.TransformerException
- if the current ErrorListoner determines to
throw an exception.public PrefixResolver getNamespaceContext()
public void setNamespaceContext(PrefixResolver pr)
pr
- The resolver for prefixes in the XPath expression.Copyright ? 2006 Apache XML Project. All Rights Reserved.