net.xoetrope.xui.evaluator
Interface XAttributeEvaluator

All Known Implementing Classes:
ScriptAttributeEvaluator, XDefaultAttributeEvaluator, XGroovyEvaluator

public interface XAttributeEvaluator

An interface for the evaluation of expressions at design time.

Copyright (c) Xoetrope Ltd., 2002-2004

$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.
 XMethodReference getMethodReference(java.lang.Object instance, java.lang.String attributeValue)
          Get the value of an attribute by evaluating a method reference
 XMethodReference 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(XProject project)
          Set the current project and complete any initialization that depends on the project reference/instance.
 void setExceptionHandler(XExceptionHandler 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(XProject 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

XMethodReference 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

XMethodReference 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(XExceptionHandler 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