Modifier and Type | Field and Description |
---|---|
pack-priv int | |
private static final boolean | |
private int | |
private PrefixResolver | m_currentPrefixResolver
The current prefixResolver for the execution context. |
pack-priv ErrorListener | m_errorHandler
The error listener where errors will be sent. |
private FunctionTable | m_functionTable
The FunctionTable for all xpath build-in functions |
pack-priv SourceLocator | m_locator
The source locator for the expression being compiled. |
private static long |
Access | Constructor and Description |
---|---|
public | Compiler(ErrorListener
Error listener where messages will be sent, or null
if messages should be sent to System err. errorHandler, SourceLocator 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. locator, FunctionTable The FunctionTable object where the xpath build-in
functions are stored. fTable)Construct a Compiler object with a specific ErrorListener and SourceLocator where the expression is located. |
public |
Modifier and Type | Method and Description |
---|---|
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile an 'and' operation. |
protected Expression | Returns: reference to the argument expression.The current position in the m_opMap array. opPos)Compile a function argument. |
public void | |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a 'boolean(...)' operation. |
private Expression | Returns: The result of the XPath.The current position in the xpath.m_opMap array. opPos)This method handles the actual compilation process. |
public Expression | Returns: The result of the XPath.The current position in the xpath.m_opMap array. opPos)Execute the XPath object from a given opcode position. |
private Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile an extension function. |
pack-priv Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a built-in XPath function. |
private Expression | Returns: reference tocom. instance.non-null reference to parent operation. operation, int The op map position of the parent operation. opPos)Bottle-neck compilation of an operation with left and right operands. |
private void | compilePredicates(int
The position of the first predicate the m_opMap array. opPos, Expression[] An empty pre-determined array of
predicates)com. s, that will be filled in.Compiles predicates in the step. |
private Expression | Returns: The unary argument.The parent unary operation. unary, int The position in the op map of the parent operation. opPos)Bottle-neck compilation of a unary operation. |
public int | Returns: The number of predicates for this step.The position of the first predicate the m_opMap array. opPos)Count the number of predicates in the step. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a 'div' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '=' operation. |
public void | error(String
An error msgkey that corresponds to one of the constants found
in msg, Object[] com. , which is
a key for a format string.An array of arguments represented in the format string, which
may be null. args)Overrides com. Tell the user of an error, and probably throw an exception. |
public Expression[] | Returns: reference to array ofcom. instances.The position of the first predicate the m_opMap array. opPos)Compile a zero or more predicates for a given match pattern. |
pack-priv FunctionTable | |
public int | Returns: 0 if it is a top-level path.Get the level of the location path or union being constructed. |
public PrefixResolver | Returns: The current prefix resolver, *may* be null, though hopefully not.Get the current namespace context for the xpath. |
private synchronized long | |
public int | Returns: org. bit set that tells what
to show for a given node test.the op map position for the location step. opPos)Get a |
protected Expression | Returns: reference to the contained expression.The current position in the m_opMap array. opPos)Compile an expression group. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '>' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '>=' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a literal string value. |
public Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a location path. |
public Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a location match pattern unit expression. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '<' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '<=' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile an entire match pattern expression. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '-' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a 'mod' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '*' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a unary '-' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '!=' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a 'number(...)' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a literal number value. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile an 'or' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a '+' operation. |
public Expression | Returns: the contained predicate expression.The current position in the m_opMap array. opPos)Compile a location step predicate expression. |
public void | setNamespaceContext(PrefixResolver
The resolver for prefixes in the XPath expression. pr)Set the current namespace context for the xpath. |
protected StepPattern | Returns: reference tocom. instance.The current position in the m_opMap array. opPos, int The number of steps to expect. stepCount, StepPattern The owning StepPattern, which may be null. ancestorPattern)Compile a step pattern unit expression, used for both location paths and match patterns. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a 'string(...)' operation. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a location path union. |
protected Expression | Returns: reference tocom. instance.The current position in the m_opMap array. opPos)Compile a variable reference. |
public void | warn(String
An error msgkey that corresponds to one of the constants found
in msg, Object[] com. , which is
a key for a format string.An array of arguments represented in the format string, which
may be null. args)Warn the user of an problem. |
countOp | back to summary |
---|---|
pack-priv int countOp |
DEBUG | back to summary |
---|---|
private static final boolean DEBUG |
locPathDepth | back to summary |
---|---|
private int locPathDepth |
m_currentPrefixResolver | back to summary |
---|---|
private PrefixResolver m_currentPrefixResolver The current prefixResolver for the execution context. |
m_errorHandler | back to summary |
---|---|
pack-priv ErrorListener m_errorHandler The error listener where errors will be sent. If this is null, errors and warnings will be sent to System.err. May be null. |
m_functionTable | back to summary |
---|---|
private FunctionTable m_functionTable The FunctionTable for all xpath build-in functions |
m_locator | back to summary |
---|---|
pack-priv SourceLocator m_locator The source locator for the expression being compiled. May be null. |
s_nextMethodId | back to summary |
---|---|
private static long s_nextMethodId |
Compiler | back to summary |
---|---|
public Compiler(ErrorListener errorHandler, SourceLocator locator, FunctionTable fTable) Construct a Compiler object with a specific ErrorListener and SourceLocator where the expression is located.
|
Compiler | back to summary |
---|---|
public Compiler() Construct a Compiler instance that has a null error listener and a null source locator. |
and | back to summary |
---|---|
protected Expression and(int opPos) throws TransformerException Compile an 'and' operation.
|
arg | back to summary |
---|---|
protected Expression arg(int opPos) throws TransformerException Compile a function argument.
|
assertion | back to summary |
---|---|
public void assertion(boolean b, String msg) Tell the user of an assertion error, and probably throw an exception.
|
bool | back to summary |
---|---|
protected Expression bool(int opPos) throws TransformerException Compile a 'boolean(...)' operation.
|
compile | back to summary |
---|---|
private Expression compile(int opPos) throws TransformerException This method handles the actual compilation process. It is called from the compileExpression method as well as the subsequent processes. See the note for compileExpression.
|
compileExpression | back to summary |
---|---|
public Expression compileExpression(int opPos) throws TransformerException Execute the XPath object from a given opcode position. Note that this method is added so that when StackOverflowError is caught the address space can be freed to this point allowing further activities such as reporting the error.
|
compileExtension | back to summary |
---|---|
private Expression compileExtension(int opPos) throws TransformerException Compile an extension function.
|
compileFunction | back to summary |
---|---|
pack-priv Expression compileFunction(int opPos) throws TransformerException Compile a built-in XPath function.
|
compileOperation | back to summary |
---|---|
private Expression compileOperation(Operation operation, int opPos) throws TransformerException Bottle-neck compilation of an operation with left and right operands.
|
compilePredicates | back to summary |
---|---|
private void compilePredicates(int opPos, Expression[] predicates) throws TransformerException Compiles predicates in the step.
|
compileUnary | back to summary |
---|---|
private Expression compileUnary(UnaryOperation unary, int opPos) throws TransformerException Bottle-neck compilation of a unary operation.
|
countPredicates | back to summary |
---|---|
public int countPredicates(int opPos) throws TransformerException Count the number of predicates in the step.
|
div | back to summary |
---|---|
protected Expression div(int opPos) throws TransformerException Compile a 'div' operation.
|
equals | back to summary |
---|---|
protected Expression equals(int opPos) throws TransformerException Compile a '=' operation.
|
error | back to summary |
---|---|
public void error(String msg, Object[] args) throws TransformerException Overrides com. Tell the user of an error, and probably throw an exception.
|
getCompiledPredicates | back to summary |
---|---|
public Expression[] getCompiledPredicates(int opPos) throws TransformerException Compile a zero or more predicates for a given match pattern.
|
getFunctionTable | back to summary |
---|---|
pack-priv FunctionTable getFunctionTable() Get the function table |
getLocationPathDepth | back to summary |
---|---|
public int getLocationPathDepth() Get the level of the location path or union being constructed.
|
getNamespaceContext | back to summary |
---|---|
public PrefixResolver getNamespaceContext() Get the current namespace context for the xpath.
|
getNextMethodId | back to summary |
---|---|
private synchronized long getNextMethodId() Get the next available method id |
getWhatToShow | back to summary |
---|---|
public int getWhatToShow(int opPos) Get a
|
group | back to summary |
---|---|
protected Expression group(int opPos) throws TransformerException Compile an expression group.
|
gt | back to summary |
---|---|
protected Expression gt(int opPos) throws TransformerException Compile a '>' operation.
|
gte | back to summary |
---|---|
protected Expression gte(int opPos) throws TransformerException Compile a '>=' operation.
|
literal | back to summary |
---|---|
protected Expression literal(int opPos) Compile a literal string value.
|
locationPath | back to summary |
---|---|
public Expression locationPath(int opPos) throws TransformerException Compile a location path. The LocPathIterator itself may create
|
locationPathPattern | back to summary |
---|---|
public Expression locationPathPattern(int opPos) throws TransformerException Compile a location match pattern unit expression.
|
lt | back to summary |
---|---|
protected Expression lt(int opPos) throws TransformerException Compile a '<' operation.
|
lte | back to summary |
---|---|
protected Expression lte(int opPos) throws TransformerException Compile a '<=' operation.
|
matchPattern | back to summary |
---|---|
protected Expression matchPattern(int opPos) throws TransformerException Compile an entire match pattern expression.
|
minus | back to summary |
---|---|
protected Expression minus(int opPos) throws TransformerException Compile a '-' operation.
|
mod | back to summary |
---|---|
protected Expression mod(int opPos) throws TransformerException Compile a 'mod' operation.
|
mult | back to summary |
---|---|
protected Expression mult(int opPos) throws TransformerException Compile a '*' operation.
|
neg | back to summary |
---|---|
protected Expression neg(int opPos) throws TransformerException Compile a unary '-' operation.
|
notequals | back to summary |
---|---|
protected Expression notequals(int opPos) throws TransformerException Compile a '!=' operation.
|
number | back to summary |
---|---|
protected Expression number(int opPos) throws TransformerException Compile a 'number(...)' operation.
|
numberlit | back to summary |
---|---|
protected Expression numberlit(int opPos) Compile a literal number value.
|
or | back to summary |
---|---|
protected Expression or(int opPos) throws TransformerException Compile an 'or' operation.
|
plus | back to summary |
---|---|
protected Expression plus(int opPos) throws TransformerException Compile a '+' operation.
|
predicate | back to summary |
---|---|
public Expression predicate(int opPos) throws TransformerException Compile a location step predicate expression.
|
setNamespaceContext | back to summary |
---|---|
public void setNamespaceContext(PrefixResolver pr) Set the current namespace context for the xpath.
|
stepPattern | back to summary |
---|---|
protected StepPattern stepPattern(int opPos, int stepCount, StepPattern ancestorPattern) throws TransformerException Compile a step pattern unit expression, used for both location paths and match patterns.
|
string | back to summary |
---|---|
protected Expression string(int opPos) throws TransformerException Compile a 'string(...)' operation.
|
union | back to summary |
---|---|
protected Expression union(int opPos) throws TransformerException Compile a location path union. The UnionPathIterator itself may create
|
variable | back to summary |
---|---|
protected Expression variable(int opPos) throws TransformerException Compile a variable reference.
|
warn | back to summary |
---|---|
public void warn(String msg, Object[] args) throws TransformerException Warn the user of an problem.
|