org.formaria.aria.evaluator
Interface AttributeEvaluator

All Known Implementing Classes:
CodeFragmentAction, DefaultAttributeEvaluator, GenericBuilderAttributeEvaluator, GroovyEvaluator

public interface AttributeEvaluator

An interface for the evaluation of expressions at design time.

Copyright (c) Formaria Ltd., 2008

$Revision: 2.1 $

License: see License.txt


Method Summary
 java.lang.Object evaluateAttribute(java.lang.Object instance, java.lang.String attributeValue)
          Get the value of an attribute.
 MethodReference getMethodReference(java.lang.Object instance, java.lang.String attributeValue)
          Get the value of an attribute by evaluating a method reference
 MethodReference getMethodReference(java.lang.String attributeValue)
          Get the method reference for the methods named in the attribute
 java.lang.Object getResult()
          Explicitly get the result of an evaluation.
 void setCurrentProject(Project project)
          Set the current project and complete any initialization that depends on the project reference/instance.
 void setExceptionHandler(ExceptionHandler eh)
          Set an exception handler for processing exceptions
 void setResult(java.lang.Object value)
          Explicitly set the result of an evaluation.
 

Method Detail

setCurrentProject

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

Parameters:
project - the current or owning project

evaluateAttribute

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

Parameters:
instance - the current page or object that provides the methods or fields used in the evaluation
attributeValue - the raw value of the attribute
Returns:
the evaluated value of the attribute

getMethodReference

MethodReference getMethodReference(java.lang.String attributeValue)
Get the method reference for the methods named in the attribute

Parameters:
attributeValue - the method name
Returns:
the method reference or null if the referenced/named method cannot be found

getMethodReference

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

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

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

Parameters:
eh - the exception handler

setResult

void setResult(java.lang.Object value)
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

Parameters:
the - new result value

getResult

java.lang.Object getResult()
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

Returns:
the current/intermediate result value