de.dfki.util.xmlrpc.conversion
Interface TypeConverter

All Known Implementing Classes:
EnhancedTypeConverter, StandardXmlRpcTypeConverter

public interface TypeConverter

Interface for performing type and instance conversions from user-specific types to XML-RPC compliant types and vice versa. Type converters use the XmlRpc annotation to determine what XML-RPC type corresponds to a user-specific type and what factory actually creates instances of the user-specific type as well as XML-RPC representations of user-specific instances.

Author:
lauer

Method Summary
 boolean areCompatible(XmlRpc.Type xmlRpcType, java.lang.Object instance)
          Checks, whether an instance is compliant to a specific XML-RPC type.
 java.lang.Object convertToUserRepresentation(ApiParameter apiParam, java.lang.Object parameterInXmlRpcRep)
          Converts the given object from a generic XML-RPC representation into the required user-representation.
 java.lang.Object convertToXmlRpcRepresentation(ApiParameter apiParam, java.lang.Object parameterInUserRep)
          Converts the given object into its generic XML-RPC representation.
 

Method Detail

areCompatible

boolean areCompatible(XmlRpc.Type xmlRpcType,
                      java.lang.Object instance)
Checks, whether an instance is compliant to a specific XML-RPC type.


convertToUserRepresentation

java.lang.Object convertToUserRepresentation(ApiParameter apiParam,
                                             java.lang.Object parameterInXmlRpcRep)
                                             throws TypeConversionException
Converts the given object from a generic XML-RPC representation into the required user-representation.

Throws:
TypeConversionException

convertToXmlRpcRepresentation

java.lang.Object convertToXmlRpcRepresentation(ApiParameter apiParam,
                                               java.lang.Object parameterInUserRep)
                                               throws TypeConversionException
Converts the given object into its generic XML-RPC representation.

Throws:
TypeConversionException - if a conversion was not possible (wrong type, no valid constructor, wrong factory).


Copyright © 2012. All Rights Reserved.