org.formaria.builder.generic
Class GenericBuilderAttributeEvaluator

java.lang.Object
  extended by org.formaria.aria.evaluator.DefaultAttributeEvaluator
      extended by org.formaria.builder.generic.GenericBuilderAttributeEvaluator
All Implemented Interfaces:
AttributeEvaluator

public class GenericBuilderAttributeEvaluator
extends DefaultAttributeEvaluator

An attribute evaluator. This attribute evaluator extends the default evaluator by adding support for the ${values},${value} arguments. The evaluator also support mapping of attributes through the attribute names specified as ${attribName}.

The attributes can also be defined in classes other than the current page or classes derived from Page. The syntax for such expressions is as follows:

where mypackage is the name of the Java package containing the class MyClass. The value of referenceName is a user defined value that identifies the instance of the class. The application instantiates an instance of the class when the expression is first encountered and thereafter maintains the instance with each subsequent call retrieving the same instance of the class.

Copyright (c) Formaria Ltd., 2001-2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.


Field Summary
 
Fields inherited from class org.formaria.aria.evaluator.DefaultAttributeEvaluator
classInstances, currentProject, exceptionHandler, provider, result
 
Constructor Summary
GenericBuilderAttributeEvaluator(Project project)
          Create a new evaluator
 
Method Summary
 java.lang.Object evaluateAttribute(java.awt.Component comp, java.lang.String methodSpec, java.lang.String attribValue, XmlElement childNode)
          Invoke the specified method
 PageSupport getPage()
          Get the page that this evaluator is operating upon
protected  java.lang.Object lookupReference(java.lang.String reference)
          Lookup a reference
 void setPage(PageSupport p)
          Set the page upon which this component operates
 
Methods inherited from class org.formaria.aria.evaluator.DefaultAttributeEvaluator
evaluateAttribute, getMethodReference, getMethodReference, getObject, getResult, setCurrentProject, setExceptionHandler, setResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericBuilderAttributeEvaluator

public GenericBuilderAttributeEvaluator(Project project)
Create a new evaluator

Parameters:
currentProject - the current project
project - the current or owning project
Method Detail

evaluateAttribute

public java.lang.Object evaluateAttribute(java.awt.Component comp,
                                          java.lang.String methodSpec,
                                          java.lang.String attribValue,
                                          XmlElement childNode)
Invoke the specified method

Parameters:
attribValue - the value of the attribute.
childNode - the source xml node

getPage

public PageSupport getPage()
Get the page that this evaluator is operating upon

Returns:
the page or null if none was set

setPage

public void setPage(PageSupport p)
Set the page upon which this component operates

Parameters:
p - the page

lookupReference

protected java.lang.Object lookupReference(java.lang.String reference)
Lookup a reference

Overrides:
lookupReference in class DefaultAttributeEvaluator
Parameters:
reference - a stripped reference e.g. values - which would have been specified as ${values}
Returns:
the reference object(s) or null