de.dfki.util.xmlrpc.converters
Class URLConverter

java.lang.Object
  extended by de.dfki.util.xmlrpc.converters.URLConverter
All Implemented Interfaces:
ParameterConverter<java.net.URL,java.lang.String>

public class URLConverter
extends java.lang.Object
implements ParameterConverter<java.net.URL,java.lang.String>

This parameter converter converts URLs from and to XML-RPC representation. It has to be associated with the type URL by using a ЌonverterMapping annotation in the API where parameters of type URL are used.

Author:
Andreas Lauer
See Also:
Api

Constructor Summary
URLConverter()
           
 
Method Summary
 java.net.URL createFrom(java.lang.String xmlRepresentation)
          Creates an instance of parameter type T.
 XmlRpc.Type getXmlRpcRepresentationType()
          Converter uses XML-RPC type as XML-RPC representation.
 java.lang.String toXmlRpc(java.net.URL param)
          Transforms a parameter into it's XML-RPC representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLConverter

public URLConverter()
Method Detail

getXmlRpcRepresentationType

public XmlRpc.Type getXmlRpcRepresentationType()
Converter uses XML-RPC type as XML-RPC representation.

Specified by:
getXmlRpcRepresentationType in interface ParameterConverter<java.net.URL,java.lang.String>
Returns:
The XML-RPC type the converter uses as XML-RPC representation.

createFrom

public java.net.URL createFrom(java.lang.String xmlRepresentation)
                        throws TypeConversionException
Description copied from interface: ParameterConverter
Creates an instance of parameter type T.

Specified by:
createFrom in interface ParameterConverter<java.net.URL,java.lang.String>
Parameters:
xmlRepresentation - The structure transfered via XML-RPC.
Returns:
The new instance. May also be null.
Throws:
TypeConversionException

toXmlRpc

public java.lang.String toXmlRpc(java.net.URL param)
                          throws TypeConversionException
Description copied from interface: ParameterConverter
Transforms a parameter into it's XML-RPC representation.

Specified by:
toXmlRpc in interface ParameterConverter<java.net.URL,java.lang.String>
Parameters:
param - The parameter to convert. May be null.
Returns:
A XML-RPC representation (must not be null).
Throws:
TypeConversionException


Copyright © 2012. All Rights Reserved.