org.hibersap.conversion
Interface Converter

All Superinterfaces:
Serializable
All Known Implementing Classes:
BooleanConverter, CharConverter, DefaultConverter

public interface Converter
extends Serializable

Implementation of a data type converter. Converts on-the-fly from SAP data type to any Java type. The corresponding field in the BAPI class can thus be independent of the SAP type. E .g., a SAP character type which represents a boolean (since ABAP does not have a boolean data type) can be converted to a Java boolean. To utilize a Converter, annotate the BAPI class field using the @Convert annotation.

Author:
Carsten Erker

Method Summary
 Object convertToJava(Object sapValue)
          Convert the SAP value, as it is returned by the underlying interfacing technology (e.g. the SAP Java Connector, JCo) to the Java data type of the corresponding BAPI class field.
 Object convertToSap(Object javaValue)
          Convert the Java value of the corresponding BAPI class field to the data type as it is expected by the underlying interfacing technology (e.g. the SAP Java Connector, JCo).
 

Method Detail

convertToJava

Object convertToJava(Object sapValue)
                     throws ConversionException
Convert the SAP value, as it is returned by the underlying interfacing technology (e.g. the SAP Java Connector, JCo) to the Java data type of the corresponding BAPI class field. Hibersap will call this method after calling the SAP function and before setting the field in the Java class.

Parameters:
sapValue - The object which is returned by the SAP interface
Returns:
The converted value
Throws:
ConversionException - if the value can not be converted

convertToSap

Object convertToSap(Object javaValue)
                    throws ConversionException
Convert the Java value of the corresponding BAPI class field to the data type as it is expected by the underlying interfacing technology (e.g. the SAP Java Connector, JCo). Hibersap will call this method before calling the SAP function.

Parameters:
javaValue - The value of the BAPI class field
Returns:
The converted value
Throws:
ConversionException - if the value can not be converted


Copyright © 2011 akquinet tech@spree GmbH. All Rights Reserved.