|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weblogic.apache.xpath.compiler.OpMap | +--weblogic.apache.xpath.compiler.Compiler
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.
This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.
Fields inherited from class weblogic.apache.xpath.compiler.OpMap |
m_currentPattern,
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(javax.xml.transform.ErrorListener errorHandler,
javax.xml.transform.SourceLocator locator)
Construct a Compiler object with a specific ErrorListener and SourceLocator where the expression is located. |
Method Summary | |
protected Expression |
and(int opPos)
Compile an 'and' operation. |
protected Expression |
arg(int opPos)
Compile a function argument. |
void |
assert(boolean b,
java.lang.String msg)
Tell the user of an assertion error, and probably throw an exception. |
protected Expression |
bool(int opPos)
Compile a 'boolean(...)' operation. |
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. |
protected Expression |
div(int opPos)
Compile a 'div' operation. |
protected Expression |
equals(int opPos)
Compile a '=' operation. |
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. |
protected Expression |
group(int opPos)
Compile an expression group. |
protected Expression |
gt(int opPos)
Compile a '>' operation. |
protected Expression |
gte(int opPos)
Compile a '>=' operation. |
protected Expression |
literal(int opPos)
Compile a literal string value. |
Expression |
locationPath(int opPos)
Compile a location path. |
Expression |
locationPathPattern(int opPos)
Compile a location match pattern unit expression. |
protected Expression |
lt(int opPos)
Compile a '<' operation. |
protected Expression |
lte(int opPos)
Compile a '<=' operation. |
protected Expression |
matchPattern(int opPos)
Compile an entire match pattern expression. |
protected Expression |
minus(int opPos)
Compile a '-' operation. |
protected Expression |
mod(int opPos)
Compile a 'mod' operation. |
protected Expression |
mult(int opPos)
Compile a '*' operation. |
protected Expression |
neg(int opPos)
Compile a unary '-' operation. |
protected Expression |
notequals(int opPos)
Compile a '!=' operation. |
protected Expression |
number(int opPos)
Compile a 'number(...)' operation. |
protected Expression |
numberlit(int opPos)
Compile a literal number value. |
protected Expression |
or(int opPos)
Compile an 'or' operation. |
protected Expression |
plus(int opPos)
Compile a '+' operation. |
Expression |
predicate(int opPos)
Compile a location step predicate expression. |
void |
setNamespaceContext(PrefixResolver pr)
Set the current namespace context for the xpath. |
protected StepPattern |
stepPattern(int opPos,
int stepCount,
StepPattern ancestorPattern)
Compile a step pattern unit expression, used for both location paths and match patterns. |
protected Expression |
string(int opPos)
Compile a 'string(...)' operation. |
protected Expression |
union(int opPos)
Compile a location path union. |
protected Expression |
variable(int opPos)
Compile a variable reference. |
void |
warn(int msg,
java.lang.Object[] args)
Warn the user of an problem. |
Methods inherited from class weblogic.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 |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Compiler(javax.xml.transform.ErrorListener errorHandler, javax.xml.transform.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 javax.xml.transform.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.protected Expression or(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Or
instance.protected Expression and(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.And
instance.protected Expression notequals(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.NotEquals
instance.protected Expression equals(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Equals
instance.protected Expression lte(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Lte
instance.protected Expression lt(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Lt
instance.protected Expression gte(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Gte
instance.protected Expression gt(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Gt
instance.protected Expression plus(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Plus
instance.protected Expression minus(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Minus
instance.protected Expression mult(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Mult
instance.protected Expression div(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Div
instance.protected Expression mod(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Mod
instance.protected Expression neg(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Neg
instance.protected Expression string(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.String
instance.protected Expression bool(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Bool
instance.protected Expression number(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Number
instance.protected Expression literal(int opPos)
opPos
- The current position in the m_opMap array.XString
instance.protected Expression numberlit(int opPos)
opPos
- The current position in the m_opMap array.XNumber
instance.protected Expression variable(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.Variable
instance.protected Expression group(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.protected Expression arg(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.protected Expression union(int opPos) throws javax.xml.transform.TransformerException
LocPathIterator
children.
opPos
- The current position in the m_opMap array.UnionPathIterator
instance.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.public Expression predicate(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.protected Expression matchPattern(int opPos) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.UnionPattern
instance.public Expression locationPathPattern(int opPos) throws javax.xml.transform.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.protected StepPattern stepPattern(int opPos, int stepCount, StepPattern ancestorPattern) throws javax.xml.transform.TransformerException
opPos
- The current position in the m_opMap array.stepCount
- The number of steps to expect.ancestorPattern
- The owning StepPattern, which may be null.StepPattern
instance.public Expression[] getCompiledPredicates(int opPos) throws javax.xml.transform.TransformerException
opPos
- The position of the first predicate the m_opMap array.Expression
instances.public int countPredicates(int opPos) throws javax.xml.transform.TransformerException
opPos
- The position of the first predicate the m_opMap array.public void warn(int msg, java.lang.Object[] args) throws javax.xml.transform.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 javax.xml.transform.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.
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs61 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |