de.dfki.util.xmlrpc.conversion
Interface ParameterConverter<T,XML_REP_T>

Type Parameters:
T - The (user-specific) parameter type
XML_REP_T - It's XML-RPC representation.
All Known Implementing Classes:
ClassConverter, EnumConverter, FileConverter, NoSeparateParameterConverter, URLConverter, XmlRpcBeanConverter

public interface ParameterConverter<T,XML_REP_T>

Controls instance transformation from a type T to it's XML-RPC representation and vice versa. NOTE: Parameter converters are allowed to return null-instances of the parameter type and null-instances can be passed as argument for the toXmlRpc(Object) method but toXmlRpc(Object) must always return a non-null value.

Author:
lauer

Method Summary
 T createFrom(XML_REP_T xmlRpcRepresentation)
          Creates an instance of parameter type T.
 XmlRpc.Type getXmlRpcRepresentationType()
           
 XML_REP_T toXmlRpc(T param)
          Transforms a parameter into it's XML-RPC representation.
 

Method Detail

createFrom

T createFrom(XML_REP_T xmlRpcRepresentation)
             throws TypeConversionException
Creates an instance of parameter type T.

Parameters:
xmlRpcRepresentation - The structure transfered via XML-RPC.
Returns:
The new instance. May also be null.
Throws:
TypeConversionException

toXmlRpc

XML_REP_T toXmlRpc(T param)
                   throws TypeConversionException
Transforms a parameter into it's XML-RPC representation.

Parameters:
param - The parameter to convert. May be null.
Returns:
A XML-RPC representation (must not be null).
Throws:
TypeConversionException

getXmlRpcRepresentationType

XmlRpc.Type getXmlRpcRepresentationType()
Returns:
The XML-RPC type the converter uses as XML-RPC representation.


Copyright © 2012. All Rights Reserved.