com.novell.xsl.extensions
Class BadExpression

java.lang.Object
  extended bycom.novell.xsl.extensions.BadExpression
All Implemented Interfaces:
Expression

public class BadExpression
extends Object
implements Expression

Expression object used to wrap an error message so the error message isn't reported unless the expression is evaluated.

This is primarily useful for XSLT forwards-compatible parsing.


Constructor Summary
BadExpression(String message)
          Construct a BadExpression instance with the passed error message.
 
Method Summary
 void dump(PrintWriter writer, int indent)
          Print the expression in a readable form for debugging.
 ExpressionValue evaluate(Node contextNode, ExpressionContext context)
          Evaluate the expression with repect to the passed context This will always throw an XPathEvaluationException
 Class getResultType()
          Return the Class object describing the result type of the expression.
 boolean isConstant()
          Return true if the expression is a constant value.
 void registerForReset(XPathResetRegistrar registrar)
          Register this expression or any subexpression that implements XPathResetCache with an object that wants to call resetCache()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BadExpression

public BadExpression(String message)
Construct a BadExpression instance with the passed error message.

Parameters:
message - The message that will be reported if this expression is instantiated.
Method Detail

evaluate

public ExpressionValue evaluate(Node contextNode,
                                ExpressionContext context)
                         throws XPathEvaluationException
Evaluate the expression with repect to the passed context This will always throw an XPathEvaluationException

Specified by:
evaluate in interface Expression
Parameters:
contextNode - context node for expression evaluation
context - expression context for expression evaluation
Returns:
result of evaluating expression
Throws:
XPathEvaluationException

isConstant

public boolean isConstant()
Return true if the expression is a constant value.

Specified by:
isConstant in interface Expression
Returns:
True is expression is constant, false otherwise.

getResultType

public Class getResultType()
Return the Class object describing the result type of the expression.

Specified by:
getResultType in interface Expression
Returns:
A Class object.

registerForReset

public void registerForReset(XPathResetRegistrar registrar)
Register this expression or any subexpression that implements XPathResetCache with an object that wants to call resetCache()

Specified by:
registerForReset in interface Expression

dump

public void dump(PrintWriter writer,
                 int indent)
Print the expression in a readable form for debugging.

Specified by:
dump in interface Expression
Parameters:
writer - The output device.
indent - Number of tabs to indent the result.