Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.align.transformation.function.impl
Class AbstractPropertyTransformation<E extends TransformationEngine>

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>
Type Parameters:
E - the transformation engine type
All Implemented Interfaces:
PropertyTransformation<E>, TransformationFunction<E>
Direct Known Subclasses:
AbstractSingleTargetPropertyTransformation

public abstract class AbstractPropertyTransformation<E extends TransformationEngine>
extends AbstractTransformationFunction<E>
implements PropertyTransformation<E>

Base class for implementing PropertyTransformations

Author:
Simon Templer

Constructor Summary
AbstractPropertyTransformation()
           
 
Method Summary
 boolean allowAutomatedResultConversion()
          Automatic result conversion allowed by default.
protected abstract  com.google.common.collect.ListMultimap<String,Object> evaluate(String transformationIdentifier, E engine, com.google.common.collect.ListMultimap<String,PropertyValue> variables, com.google.common.collect.ListMultimap<String,PropertyEntityDefinition> resultNames, Map<String,String> executionParameters, TransformationLog log)
          Execute the evaluation function as configured.
 void execute(String transformationIdentifier, E engine, Map<String,String> executionParameters, TransformationLog log)
          Execute the function as configured.
 com.google.common.collect.ListMultimap<String,Object> getResults()
          Get the TransformationFunction.execute(String, TransformationEngine, Map, TransformationLog)ion results.
protected  TypeDefinition getTargetType()
          Get the target type of the instance that is to be populated with the function result.
 void setExpectedResult(com.google.common.collect.ListMultimap<String,PropertyEntityDefinition> resultNames)
          Set the expected result names.
 void setTargetType(TypeDefinition targetType)
          Set the target type of the created instance that is to be populated with the function result.
 void setVariables(com.google.common.collect.ListMultimap<String,PropertyValue> variables)
          Set the property values serving as variables for the function.
 
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

AbstractPropertyTransformation

public AbstractPropertyTransformation()
Method Detail

setTargetType

public void setTargetType(TypeDefinition targetType)
Description copied from interface: PropertyTransformation
Set the target type of the created instance that is to be populated with the function result.

Specified by:
setTargetType in interface PropertyTransformation<E extends TransformationEngine>
Parameters:
targetType - the type of the target instance
See Also:
PropertyTransformation.setTargetType(TypeDefinition)

getTargetType

protected TypeDefinition getTargetType()
Get the target type of the instance that is to be populated with the function result.

Returns:
the target instance type

setVariables

public void setVariables(com.google.common.collect.ListMultimap<String,PropertyValue> variables)
Description copied from interface: PropertyTransformation
Set the property values serving as variables for the function.

Specified by:
setVariables in interface PropertyTransformation<E extends TransformationEngine>
Parameters:
variables - the property values, variable names are mapped to property values
See Also:
PropertyTransformation.setVariables(ListMultimap)

getResults

public com.google.common.collect.ListMultimap<String,Object> getResults()
Description copied from interface: PropertyTransformation
Get the TransformationFunction.execute(String, TransformationEngine, Map, TransformationLog)ion results.

Specified by:
getResults in interface PropertyTransformation<E extends TransformationEngine>
Returns:
the execution results, result names are mapped to result values
See Also:
PropertyTransformation.getResults()

setExpectedResult

public void setExpectedResult(com.google.common.collect.ListMultimap<String,PropertyEntityDefinition> resultNames)
Description copied from interface: PropertyTransformation
Set the expected result names.

Specified by:
setExpectedResult in interface PropertyTransformation<E extends TransformationEngine>
Parameters:
resultNames - the names of the expected results associated with the corresponding entity definition
See Also:
PropertyTransformation.setExpectedResult(ListMultimap)

execute

public void execute(String transformationIdentifier,
                    E engine,
                    Map<String,String> executionParameters,
                    TransformationLog log)
             throws TransformationException
Description copied from interface: TransformationFunction
Execute the function as configured.

Specified by:
execute in interface TransformationFunction<E extends TransformationEngine>
Parameters:
transformationIdentifier - the transformation function identifier
engine - the transformation engine that may be used for the function execution
executionParameters - additional parameters for the execution, may be null
log - the transformation log to report any information about the execution of the transformation to
Throws:
TransformationException - if an unrecoverable error occurs during transformation
See Also:
TransformationFunction.execute(String, TransformationEngine, Map, TransformationLog)

evaluate

protected abstract com.google.common.collect.ListMultimap<String,Object> evaluate(String transformationIdentifier,
                                                                                  E engine,
                                                                                  com.google.common.collect.ListMultimap<String,PropertyValue> variables,
                                                                                  com.google.common.collect.ListMultimap<String,PropertyEntityDefinition> resultNames,
                                                                                  Map<String,String> executionParameters,
                                                                                  TransformationLog log)
                                                                           throws TransformationException
Execute the evaluation function as configured.

Parameters:
transformationIdentifier - the transformation function identifier
engine - the transformation engine that may be used for the function execution
variables - the input variables
resultNames - the expected results (names associated with the corresponding entity definitions)
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

allowAutomatedResultConversion

public boolean allowAutomatedResultConversion()
Automatic result conversion allowed by default. Override to change this behavior.

Specified by:
allowAutomatedResultConversion in interface PropertyTransformation<E extends TransformationEngine>
Returns:
if automated conversion of the result values is allowed
See Also:
PropertyTransformation.allowAutomatedResultConversion()

Humboldt Alignment Editor 2.5.0

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