org.webmacro.engine
Class CrankyEvaluationExceptionHandler

java.lang.Object
  |
  +--org.webmacro.engine.CrankyEvaluationExceptionHandler
All Implemented Interfaces:
EvaluationExceptionHandler

public class CrankyEvaluationExceptionHandler
extends java.lang.Object
implements EvaluationExceptionHandler

CrankyEvaluationExceptionHandler An implementation of EvaluationExceptionHandler which throws an exception whenever it is called. This will generally cause the exception to be displayed to the user -- useful for debugging.

Since:
0.96
Author:
Brian Goetz

Constructor Summary
CrankyEvaluationExceptionHandler()
           
CrankyEvaluationExceptionHandler(Broker b)
           
 
Method Summary
 java.lang.String errorString(java.lang.String errorText)
           
 void evaluate(Variable variable, Context context, java.lang.Exception problem)
          When an exception is detected in the process of evaluating a variable reference, this method is consulted.
 java.lang.String expand(Variable variable, Context context, java.lang.Exception problem)
          When an exception is detected in the process of expanding (writing) a variable reference, this method is consulted.
 void init(Broker b, Settings config)
          Initialize the EEH
 java.lang.String warningString(java.lang.String warningText)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrankyEvaluationExceptionHandler

public CrankyEvaluationExceptionHandler()

CrankyEvaluationExceptionHandler

public CrankyEvaluationExceptionHandler(Broker b)
Method Detail

init

public void init(Broker b,
                 Settings config)
Description copied from interface: EvaluationExceptionHandler
Initialize the EEH
Specified by:
init in interface EvaluationExceptionHandler

evaluate

public void evaluate(Variable variable,
                     Context context,
                     java.lang.Exception problem)
              throws PropertyException
Description copied from interface: EvaluationExceptionHandler
When an exception is detected in the process of evaluating a variable reference, this method is consulted. It either returns, in which case the caller is supposed to supply a default value (like null), or will throw.
Specified by:
evaluate in interface EvaluationExceptionHandler

expand

public java.lang.String expand(Variable variable,
                               Context context,
                               java.lang.Exception problem)
                        throws PropertyException
Description copied from interface: EvaluationExceptionHandler
When an exception is detected in the process of expanding (writing) a variable reference, this method is consulted. It either throws an exception, or it returns a String which can be written to the output in place of the property expansion.
Specified by:
expand in interface EvaluationExceptionHandler

warningString

public java.lang.String warningString(java.lang.String warningText)
                               throws PropertyException
Specified by:
warningString in interface EvaluationExceptionHandler

errorString

public java.lang.String errorString(java.lang.String errorText)
                             throws PropertyException
Specified by:
errorString in interface EvaluationExceptionHandler