org.formaria.scripts.groovy
Class GroovyEvaluator

java.lang.Object
  extended by org.formaria.scripts.groovy.GroovyEvaluator
All Implemented Interfaces:
AttributeEvaluator

Deprecated. using the GroovyScript engine instead

public class GroovyEvaluator
extends java.lang.Object
implements AttributeEvaluator

An attribute evaluator

Copyright (c) Formaria Ltd., 2008

$Revision: 2.2 $

License: see License.txt


Field Summary
protected  ExceptionHandler exceptionHandler
          Deprecated.  
protected  GroovyShell groovyShell
          Deprecated.  
protected  java.util.Hashtable referenceObjects
          Deprecated.  
protected  java.lang.Object result
          Deprecated.  
 
Constructor Summary
GroovyEvaluator()
          Deprecated.  
 
Method Summary
 java.lang.Object evaluateAttribute(java.lang.Object instance, java.lang.String attributeValue)
          Deprecated. Get the value of an attribute.
 MethodReference getMethodReference(java.lang.Object instance, java.lang.String attributeValue)
          Deprecated. Get the value of an attribute by evaluating a method reference
 MethodReference getMethodReference(java.lang.String attributeValue)
          Deprecated. Get the value of an attribute by evaluating a method reference
 java.lang.Object getResult()
          Deprecated. Explicitly get the result of an evaluation.
 void setCurrentProject(Project currentProject)
          Deprecated. Set the current project and complete any initialization that depends on the project reference/instance.
 void setExceptionHandler(ExceptionHandler eh)
          Deprecated. Set an exception handler for processing exceptions
 void setResult(java.lang.Object value)
          Deprecated. Explicitly set the result of an evaluation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

referenceObjects

protected java.util.Hashtable referenceObjects
Deprecated. 

groovyShell

protected GroovyShell groovyShell
Deprecated. 

exceptionHandler

protected ExceptionHandler exceptionHandler
Deprecated. 

result

protected java.lang.Object result
Deprecated. 
Constructor Detail

GroovyEvaluator

public GroovyEvaluator()
Deprecated. 
Method Detail

setCurrentProject

public void setCurrentProject(Project currentProject)
Deprecated. 
Set the current project and complete any initialization that depends on the project reference/instance.

Specified by:
setCurrentProject in interface AttributeEvaluator
Parameters:
project - the current or owning project

evaluateAttribute

public java.lang.Object evaluateAttribute(java.lang.Object instance,
                                          java.lang.String attributeValue)
Deprecated. 
Get the value of an attribute.

Specified by:
evaluateAttribute in interface AttributeEvaluator
Parameters:
instance - the page being loaded
attributeValue - the raw value of the attribute
Returns:
the evaluated value of the attribute

getMethodReference

public MethodReference getMethodReference(java.lang.String attributeValue)
Deprecated. 
Get the value of an attribute by evaluating a method reference

Specified by:
getMethodReference in interface AttributeEvaluator
Parameters:
attributeValue - the method name
Returns:
the method reference or null if the referenced/named method cannot be found

getMethodReference

public MethodReference getMethodReference(java.lang.Object instance,
                                          java.lang.String attributeValue)
Deprecated. 
Get the value of an attribute by evaluating a method reference

Specified by:
getMethodReference in interface AttributeEvaluator
Parameters:
instance - the current page or object that provides the methods or fields used in the evaluation
attributeValue - the method name
Returns:
the method reference or null if the referenced/named method cannot be found

setExceptionHandler

public void setExceptionHandler(ExceptionHandler eh)
Deprecated. 
Set an exception handler for processing exceptions

Specified by:
setExceptionHandler in interface AttributeEvaluator
Parameters:
eh - the exception handler

setResult

public void setResult(java.lang.Object value)
Deprecated. 
Explicitly set the result of an evaluation. This method may be used by an exception handler to override the result and set a sensible value in case of an exception

Specified by:
setResult in interface AttributeEvaluator
Parameters:
the - new result value

getResult

public java.lang.Object getResult()
Deprecated. 
Explicitly get the result of an evaluation. This method may be used by an exception handler to determine the result and set a sensible value in case of an exception

Specified by:
getResult in interface AttributeEvaluator
Returns:
the current/intermediate result value