HEADER

ru.biosoft.access
Interface Transformer

All Known Implementing Classes:
AbstractTransformer

public interface Transformer

Transforms DataElement from one type to another.

Version: 1.0
pending comments

Method Summary
 ClassgetInputType()
          Return class of input data element.
 ClassgetOutputType()
          Return class of output data element.
 DataCollectiongetPrimaryCollection()
          Return data collection which contain output data element.
 DataCollectiongetTransformedCollection()
          Return data collection which contain input data element.
 voidinit(DataCollection dcInput, DataCollection dcOutput)
          Initialize transformer for support optional methods.
 booleanisInputType(Class type)
          Returns is specified class accepted as input type.
 booleanisOutputType(Class type)
          Returns is specified class accepted as output type.
 DataElementtransformInput(DataElement input)
          Transform input data element to output data element.
 DataElementtransformOutput(DataElement output)
          Transform output data element to input data element.

Method Detail

getInputType

public Class getInputType()
Return class of input data element. Input data element stored in primary data collection.
Returns: Class of input data element.

getOutputType

public Class getOutputType()
Return class of output data element. Output data element stored in transformed data collection.
Returns: Class of output data element.

getPrimaryCollection

public DataCollection getPrimaryCollection()
Return data collection which contain output data element. This optional operation. If this operation not supported then null always returns.
Returns: Data collection which contain output data element or null.
See Also:
init(ru.biosoft.access.DataCollection,ru.biosoft.access.DataCollection)

getTransformedCollection

public DataCollection getTransformedCollection()
Return data collection which contain input data element. This optional operation. If this operation not supported then null always returns.
Returns: Data collection which contain input data element or null.
See Also:
init(ru.biosoft.access.DataCollection,ru.biosoft.access.DataCollection)

init

public void init(DataCollection dcInput, DataCollection dcOutput)
Initialize transformer for support optional methods.
See Also:
getPrimaryCollection(), getTransformedCollection()

isInputType

public boolean isInputType(Class type)
Returns is specified class accepted as input type.
Parameters:
type - Class for checking.
Returns: true - if type is input type, false otherwise.

isOutputType

public boolean isOutputType(Class type)
Returns is specified class accepted as output type.
Parameters:
type - Class for checking.
Returns: true - if type is output type, false otherwise.

transformInput

public DataElement transformInput(DataElement input)
throws java.lang.Exception
Transform input data element to output data element.
Returns: Transformed data element.
Throws:
Exception - If error occured.

transformOutput

public DataElement transformOutput(DataElement output)
throws java.lang.Exception
Transform output data element to input data element.
Returns: Primary data element.
Throws:
Exception - If error occured.

FOOTER

BOTTOM