Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.cst.functions.groovy
Class GroovyTransformation

java.lang.Object
  extended by eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractTransformationFunction<E>
      extended by eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractPropertyTransformation<E>
          extended by eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractSingleTargetPropertyTransformation<TransformationEngine>
              extended by eu.esdihumboldt.cst.functions.groovy.GroovyTransformation
All Implemented Interfaces:
GroovyConstants, PropertyTransformation<TransformationEngine>, TransformationFunction<TransformationEngine>

public class GroovyTransformation
extends AbstractSingleTargetPropertyTransformation<TransformationEngine>
implements GroovyConstants

Property transformation based on a Groovy script.

Author:
Simon Templer

Field Summary
 
Fields inherited from interface eu.esdihumboldt.cst.functions.groovy.GroovyConstants
ENTITY_VARIABLE, PARAMETER_SCRIPT
 
Constructor Summary
GroovyTransformation()
           
 
Method Summary
static groovy.lang.Binding createGroovyBinding(List<PropertyValue> vars, boolean useNullForMissingBindings)
          Create a Groovy binding from the list of variables.
protected  Object evaluate(String transformationIdentifier, TransformationEngine engine, com.google.common.collect.ListMultimap<String,PropertyValue> variables, String resultName, PropertyEntityDefinition resultProperty, Map<String,String> executionParameters, TransformationLog log)
          Execute the evaluation function as configured.
 
Methods inherited from class eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractSingleTargetPropertyTransformation
evaluate
 
Methods inherited from class eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractPropertyTransformation
allowAutomatedResultConversion, execute, getResults, getTargetType, setExpectedResult, setTargetType, setVariables
 
Methods inherited from class eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractTransformationFunction
checkParameter, getExecutionContext, getOptionalParameter, getParameterChecked, getParameters, setExecutionContext, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.esdihumboldt.hale.common.align.transformation.function.TransformationFunction
setExecutionContext, setParameters
 

Constructor Detail

GroovyTransformation

public GroovyTransformation()
Method Detail

evaluate

protected Object evaluate(String transformationIdentifier,
                          TransformationEngine engine,
                          com.google.common.collect.ListMultimap<String,PropertyValue> variables,
                          String resultName,
                          PropertyEntityDefinition resultProperty,
                          Map<String,String> executionParameters,
                          TransformationLog log)
                   throws TransformationException,
                          NoResultException
Description copied from class: AbstractSingleTargetPropertyTransformation
Execute the evaluation function as configured.

Specified by:
evaluate in class AbstractSingleTargetPropertyTransformation<TransformationEngine>
Parameters:
transformationIdentifier - the transformation function identifier
engine - the transformation engine that may be used for the function execution
variables - the input variables
resultName - the name of the result
resultProperty - the property entity definition associated with the result
executionParameters - additional parameters for the execution, may be null
log - the transformation log to report any information about the execution of the transformation to
Returns:
the evaluation result
Throws:
TransformationException - if an unrecoverable error occurs during transformation
NoResultException - if the function does not yield a result
See Also:
AbstractSingleTargetPropertyTransformation.evaluate(String, TransformationEngine, ListMultimap, String, PropertyEntityDefinition, Map, TransformationLog)

createGroovyBinding

public static groovy.lang.Binding createGroovyBinding(List<PropertyValue> vars,
                                                      boolean useNullForMissingBindings)
Create a Groovy binding from the list of variables.

Parameters:
vars - the variables
useNullForMissingBindings - if the binding should provide null values for variables that are not provided in the given variable list
Returns:
the binding for use with GroovyShell

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d