org.hibersap.conversion
Class BooleanConverter

java.lang.Object
  extended by org.hibersap.conversion.BooleanConverter
All Implemented Interfaces:
Serializable, Converter

public class BooleanConverter
extends Object
implements Converter

Converts between Java boolean and SAP CHAR type. A Java value of true will be converted to "X", A Java value of false will be converted to an empty String and vice versa.

Author:
Carsten Erker
See Also:
Serialized Form

Constructor Summary
BooleanConverter()
           
 
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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanConverter

public BooleanConverter()
Method Detail

convertToJava

public 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.

Specified by:
convertToJava in interface Converter
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

public 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.

Specified by:
convertToSap in interface Converter
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.