BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.apache.xpath
Class Expression

java.lang.Object
  |
  +--weblogic.apache.xpath.Expression
Direct Known Subclasses:
Function, NodeTest, Operation, UnaryOperation, UnionPathIterator, UnionPattern, Variable, XObject

public abstract class Expression
extends java.lang.Object
implements java.io.Serializable

This abstract class serves as the base for all expression objects. An Expression can be executed to return a XObject, normally has a location within a document or DOM, can send error and warning events, and normally do not hold state and are meant to be immutable once construction has completed. An exception to the immutibility rule is iterators and walkers, which must be cloned in order to be used -- the original must still be immutable.

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.

See Also:
Serialized Form

Field Summary
protected  javax.xml.transform.SourceLocator m_slocator
          The location where this expression was built from.
 
Constructor Summary
Expression()
           
 
Method Summary
 void assert(boolean b, java.lang.String msg)
          Tell the user of an assertion error, and probably throw an exception.
 boolean canTraverseOutsideSubtree()
          Tell if this expression or it's subexpressions can traverse outside the current subtree.
 void error(XPathContext xctxt, int msg, java.lang.Object[] args)
          Tell the user of an error, and probably throw an exception.
abstract  XObject execute(XPathContext xctxt)
          Execute an expression in the XPath runtime context, and return the result of the expression.
 void setSourceLocator(javax.xml.transform.SourceLocator locator)
          Set the location where this expression was built from.
 void warn(XPathContext xctxt, int msg, java.lang.Object[] args)
          Warn the user of an problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_slocator

protected javax.xml.transform.SourceLocator m_slocator
The location where this expression was built from. Need for diagnostic messages. May be null.
Constructor Detail

Expression

public Expression()
Method Detail

canTraverseOutsideSubtree

public boolean canTraverseOutsideSubtree()
Tell if this expression or it's subexpressions can traverse outside the current subtree.

Returns:
true if traversal outside the context node's subtree can occur.

setSourceLocator

public void setSourceLocator(javax.xml.transform.SourceLocator locator)
Set the location where this expression was built from.

Parameters:
locator - the location where this expression was built from, may be null.

execute

public abstract XObject execute(XPathContext xctxt)
                         throws javax.xml.transform.TransformerException
Execute an expression in the XPath runtime context, and return the result of the expression.

Parameters:
xctxt - The XPath runtime context.
Returns:
The result of the expression in the form of a XObject.
Throws:
javax.xml.transform.TransformerException - if a runtime exception occurs.

warn

public void warn(XPathContext xctxt,
                 int msg,
                 java.lang.Object[] args)
          throws javax.xml.transform.TransformerException
Warn the user of an problem.

Parameters:
xctxt - The XPath runtime context.
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.
Throws:
javax.xml.transform.TransformerException - if the current ErrorListoner determines to throw an exception.

assert

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

Parameters:
b - If false, a runtime exception will be thrown.
msg - The assertion message, which should be informative.
Throws:
java.lang.RuntimeException - if the b argument is false.

error

public void error(XPathContext xctxt,
                  int msg,
                  java.lang.Object[] args)
           throws javax.xml.transform.TransformerException
Tell the user of an error, and probably throw an exception.

Parameters:
xctxt - The XPath runtime context.
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.
Throws:
javax.xml.transform.TransformerException - if the current ErrorListoner determines to throw an exception.

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.