Humboldt Alignment Editor 2.5.0

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

java.lang.Object
  extended by eu.esdihumboldt.hale.common.align.transformation.function.impl.AbstractTransformationFunction<E>
Type Parameters:
E - the transformation engine type
All Implemented Interfaces:
TransformationFunction<E>
Direct Known Subclasses:
AbstractPropertyTransformation, AbstractTypeTransformation

public abstract class AbstractTransformationFunction<E extends TransformationEngine>
extends Object
implements TransformationFunction<E>

Transformation function base class

Author:
Simon Templer

Constructor Summary
AbstractTransformationFunction()
           
 
Method Summary
protected  void checkParameter(String parameterName, int minCount)
          Checks if a certain parameter is defined at least a given number of times.
protected  ExecutionContext getExecutionContext()
          Get the current execution context.
protected  String getOptionalParameter(String parameterName, String defaultValue)
          Get the first parameter defined with the given parameter name.
protected  String getParameterChecked(String parameterName)
          Get the first parameter defined with the given parameter name.
 com.google.common.collect.ListMultimap<String,String> getParameters()
          Get the function parameters
 void setExecutionContext(ExecutionContext executionContext)
          Set the execution context.
 void setParameters(com.google.common.collect.ListMultimap<String,String> parameters)
          Sets the parameters for the transformation.
 
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
execute
 

Constructor Detail

AbstractTransformationFunction

public AbstractTransformationFunction()
Method Detail

setParameters

public void setParameters(com.google.common.collect.ListMultimap<String,String> parameters)
Description copied from interface: TransformationFunction
Sets the parameters for the transformation.

Specified by:
setParameters in interface TransformationFunction<E extends TransformationEngine>
Parameters:
parameters - the transformation parameters
See Also:
TransformationFunction.setParameters(ListMultimap)

getParameters

public com.google.common.collect.ListMultimap<String,String> getParameters()
Get the function parameters

Returns:
the parameters, may be null if there are none

setExecutionContext

public void setExecutionContext(ExecutionContext executionContext)
Description copied from interface: TransformationFunction
Set the execution context.

Specified by:
setExecutionContext in interface TransformationFunction<E extends TransformationEngine>
Parameters:
executionContext - the execution context of the transformation process
See Also:
TransformationFunction.setExecutionContext(ExecutionContext)

getExecutionContext

protected ExecutionContext getExecutionContext()
Get the current execution context.

Returns:
the executionContext the execution context

checkParameter

protected void checkParameter(String parameterName,
                              int minCount)
                       throws TransformationException
Checks if a certain parameter is defined at least a given number of times. Throws a TransformationException otherwise.

Parameters:
parameterName - the parameter name
minCount - the minimum count the parameter must be present
Throws:
TransformationException - if the parameter doesn't exist the given number of times

getParameterChecked

protected String getParameterChecked(String parameterName)
                              throws TransformationException
Get the first parameter defined with the given parameter name. Throws a TransformationException if such a parameter doesn't exist.

Parameters:
parameterName - the parameter name
Returns:
the parameter value
Throws:
TransformationException - if a parameter with the given name doesn't exist

getOptionalParameter

protected String getOptionalParameter(String parameterName,
                                      String defaultValue)
Get the first parameter defined with the given parameter name. If no such parameter exists, the given default value is returned.

Parameters:
parameterName - the parameter name
defaultValue - the default value for the parameter
Returns:
the parameter value, or the default if none is specified

Humboldt Alignment Editor 2.5.0

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