de.dfki.util.xmlrpc.conversion
Class StandardXmlRpcTypeConverter

java.lang.Object
  extended by de.dfki.util.xmlrpc.conversion.StandardXmlRpcTypeConverter
All Implemented Interfaces:
TypeConverter
Direct Known Subclasses:
EnhancedTypeConverter

public class StandardXmlRpcTypeConverter
extends java.lang.Object
implements TypeConverter

Type converter doing only the standard conversion work (actually, does only type checks and passes values through)

Author:
lauer

Constructor Summary
StandardXmlRpcTypeConverter()
           
 
Method Summary
 boolean areCompatible(XmlRpc.Type t, java.lang.Object o)
          Checks, if an instance o is compliant with XML-RPC type t.
 java.lang.Object convertToUserRepresentation(ApiParameter apiParam, java.lang.Object parameterValueInXmlRpcRep)
          Converts the given object from a generic XML-RPC representation into the required user-representation.
 java.lang.Object convertToXmlRpcRepresentation(ApiParameter apiParam, java.lang.Object parameterValueInUserRep)
          Converts the given object into its generic XML-RPC representation.
 XmlRpc.Type convertToXmlRpcRepresentationClass(java.lang.Class<?> userRepClass)
           
static XmlRpc.Type mapJavaTypeToXmlRpcType(java.lang.Class<?> cls)
          Maps a java class to an XML-RPC type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardXmlRpcTypeConverter

public StandardXmlRpcTypeConverter()
Method Detail

mapJavaTypeToXmlRpcType

public static XmlRpc.Type mapJavaTypeToXmlRpcType(java.lang.Class<?> cls)
Maps a java class to an XML-RPC type.

Parameters:
cls - The class to map.
Returns:
The corresponding XML-RPC type. null, if the mapping failed.

areCompatible

public boolean areCompatible(XmlRpc.Type t,
                             java.lang.Object o)
Checks, if an instance o is compliant with XML-RPC type t.

Specified by:
areCompatible in interface TypeConverter

convertToUserRepresentation

public java.lang.Object convertToUserRepresentation(ApiParameter apiParam,
                                                    java.lang.Object parameterValueInXmlRpcRep)
                                             throws TypeConversionException
Description copied from interface: TypeConverter
Converts the given object from a generic XML-RPC representation into the required user-representation.

Specified by:
convertToUserRepresentation in interface TypeConverter
Throws:
TypeConversionException

convertToXmlRpcRepresentation

public java.lang.Object convertToXmlRpcRepresentation(ApiParameter apiParam,
                                                      java.lang.Object parameterValueInUserRep)
                                               throws TypeConversionException
Description copied from interface: TypeConverter
Converts the given object into its generic XML-RPC representation.

Specified by:
convertToXmlRpcRepresentation in interface TypeConverter
Throws:
TypeConversionException - if a conversion was not possible (wrong type, no valid constructor, wrong factory).

convertToXmlRpcRepresentationClass

public XmlRpc.Type convertToXmlRpcRepresentationClass(java.lang.Class<?> userRepClass)
                                               throws TypeConversionException
Throws:
TypeConversionException


Copyright © 2012. All Rights Reserved.