fr.cnes.sitools.dataset.converter.business
Class AbstractConverter

java.lang.Object
  extended by org.restlet.engine.Helper
      extended by fr.cnes.sitools.common.model.ExtensionModel<E>
          extended by fr.cnes.sitools.common.business.AbstractExtension<ConverterParameter>
              extended by fr.cnes.sitools.dataset.converter.business.AbstractConverter
All Implemented Interfaces:
IResource, Validable
Direct Known Subclasses:
ConverterChained, DateConverter, LinearConverter, LinearInOutConverter, LoggingConverter, RecordCleanupConverter, SimpleFilterConverter

public abstract class AbstractConverter
extends AbstractExtension<ConverterParameter>
implements Validable

Abstract class from which all converters must inherit.

Author:
m.marseille (AKKA Technologies)

Constructor Summary
AbstractConverter()
          Default constructor
AbstractConverter(org.restlet.Context ctx)
          Constructor with Context parameter
 
Method Summary
 void addParam(ConverterParameter param)
          Add a parameter to the Map of parameters The key to this parameter is its name
abstract  Record getConversionOf(Record rec)
          Method to process conversion, Must be overridden
 AttributeValue getInOutParam(java.lang.String name, Record rec)
          Gets the AttributeValue from the following Record corresponding to the following name
 AttributeValue getInParam(java.lang.String name, Record rec)
          Gets the AttributeValue from the following Record corresponding to the following name
 ConverterParameter getInternParam(java.lang.String name)
          Gets the ConverterParameter of type CONVERTER_PARAMETER_INTERN corresponding to the following name
 AttributeValue getOutParam(java.lang.String name, Record rec)
          Gets the AttributeValue from the following Record corresponding to the following name
 
Methods inherited from class fr.cnes.sitools.common.business.AbstractExtension
getContext, setContext
 
Methods inherited from class fr.cnes.sitools.common.model.ExtensionModel
getClassAuthor, getClassName, getClassOwner, getClassVersion, getDescription, getDescriptionAction, getId, getName, getParametersMap, setClassAuthor, setClassName, setClassOwner, setClassVersion, setDescription, setDescriptionAction, setId, setName, setParametersMap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.cnes.sitools.common.validator.Validable
getValidator
 

Constructor Detail

AbstractConverter

public AbstractConverter()
Default constructor


AbstractConverter

public AbstractConverter(org.restlet.Context ctx)
Constructor with Context parameter

Parameters:
ctx - The Context to instantiate the Converter with, contains the DataSet
Method Detail

getConversionOf

public abstract Record getConversionOf(Record rec)
                                throws java.lang.Exception
Method to process conversion, Must be overridden

Parameters:
rec - the record to be processed
Returns:
the record processed
Throws:
java.lang.Exception - when conversion fails

addParam

public final void addParam(ConverterParameter param)
Add a parameter to the Map of parameters The key to this parameter is its name

Parameters:
param - the parameter to add

getInternParam

public final ConverterParameter getInternParam(java.lang.String name)
Gets the ConverterParameter of type CONVERTER_PARAMETER_INTERN corresponding to the following name

Parameters:
name - The name of the ConverterParameter
Returns:
a ConverterParameter of type CONVERTER_PARAMETER_INTERN corresponding to the following name or null if the ConverterParameter is not found

getInParam

public final AttributeValue getInParam(java.lang.String name,
                                       Record rec)
Gets the AttributeValue from the following Record corresponding to the following name

Parameters:
name - The name of the ConverterParameter
rec - The record
Returns:
a AttributeValue corresponding to the following name and Record or null if the AttributeValue is not found

getOutParam

public final AttributeValue getOutParam(java.lang.String name,
                                        Record rec)
Gets the AttributeValue from the following Record corresponding to the following name

Parameters:
name - The name of the ConverterParameter
rec - The record
Returns:
a AttributeValue corresponding to the following name and Record or null if the AttributeValue is not found

getInOutParam

public final AttributeValue getInOutParam(java.lang.String name,
                                          Record rec)
Gets the AttributeValue from the following Record corresponding to the following name

Parameters:
name - The name of the ConverterParameter
rec - The record
Returns:
a AttributeValue corresponding to the following name and Record or null if the AttributeValue is not found


Copyright © 2010-2013 CNES. All Rights Reserved.