de.dfki.util.xmlrpc.common
Class ApiParameter

java.lang.Object
  extended by de.dfki.util.xmlrpc.common.ApiParameter

public class ApiParameter
extends java.lang.Object

Represents a parameter (either passed to a method or returned from it). All the annotation information is retrieved an stored. This information includes annotations for the parameter and annotations for the method (return value).

Author:
lauer

Method Summary
static void checkParameterConverter(java.lang.Class<? extends ParameterConverter<?,?>> cls, XmlRpc.Type xmlRpcType)
           
static ApiParameter createCallParameterFrom(XmlRpc.Type xmlRpcType)
           
static ApiParameter createFrom(java.lang.annotation.Annotation[] parameterAnnotations, java.lang.reflect.Type apiParameterType, java.lang.Class<?> apiParameterClass)
          Collects the information about a single api parameter.
static ApiParameter createFrom(java.lang.Class<?> targetClass)
           
static ApiParameter createReturnParameter(java.lang.reflect.Method m)
          Creates a parameter description for a method return parameter.
static ApiParameter createReturnParameterFrom(XmlRpc.Type xmlRpcType)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Class<?> getApiRepresentationClass()
           
 ApiParameter getContainerContent()
           
 java.lang.Class<? extends Convertible<?>> getConvertableClass()
           
 ParameterConverter<?,?> getSeparateParameterConverter()
           
 XmlRpc.Type getXmlRpcType()
           
 boolean isArray()
           
 boolean isEnumeration(java.lang.Object value)
           
 boolean isXmlRpcCompatible()
           
static java.util.logging.Logger log()
           
 void setApiRepresentationClass(java.lang.Class<?> apiClass)
           
 void setXmlRpcCompatible(boolean isXmlRpcCompatible)
           
 void setXmlRpcType(XmlRpc.Type xmlRpcType)
           
 java.lang.String toString()
           
 boolean usesConvertable()
           
static java.lang.Class<? extends Convertible<?>> validateConvertibleClass(java.lang.Class<?> cls, XmlRpc.Type xmlRpcType)
          Checks if a class fulfills the requirements of a convertible object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

log

public static java.util.logging.Logger log()

isEnumeration

public boolean isEnumeration(java.lang.Object value)

createReturnParameter

public static ApiParameter createReturnParameter(java.lang.reflect.Method m)
                                          throws TypeConversionException
Creates a parameter description for a method return parameter.

Throws:
TypeConversionException

createFrom

public static ApiParameter createFrom(java.lang.annotation.Annotation[] parameterAnnotations,
                                      java.lang.reflect.Type apiParameterType,
                                      java.lang.Class<?> apiParameterClass)
                               throws TypeConversionException
Collects the information about a single api parameter.

Parameters:
parameterAnnotations - annotations associated with the method the parameter belongs to (may be null or empty).
apiParameterType - type information taken from the methods generic type description.
apiParameterClass - class of the parameter.
Returns:
The condensed information about the parameter.
Throws:
TypeConversionException

validateConvertibleClass

public static java.lang.Class<? extends Convertible<?>> validateConvertibleClass(java.lang.Class<?> cls,
                                                                                 XmlRpc.Type xmlRpcType)
                                                                          throws TypeConversionException
Checks if a class fulfills the requirements of a convertible object. If this is the case the class is returned as a Convertible class.

Throws:
TypeConversionException

checkParameterConverter

public static void checkParameterConverter(java.lang.Class<? extends ParameterConverter<?,?>> cls,
                                           XmlRpc.Type xmlRpcType)
                                    throws TypeConversionException
Throws:
TypeConversionException

createCallParameterFrom

public static ApiParameter createCallParameterFrom(XmlRpc.Type xmlRpcType)

createReturnParameterFrom

public static ApiParameter createReturnParameterFrom(XmlRpc.Type xmlRpcType)

createFrom

public static ApiParameter createFrom(java.lang.Class<?> targetClass)
                               throws TypeConversionException
Throws:
TypeConversionException

isArray

public boolean isArray()

getApiRepresentationClass

public java.lang.Class<?> getApiRepresentationClass()

setApiRepresentationClass

public void setApiRepresentationClass(java.lang.Class<?> apiClass)

getXmlRpcType

public XmlRpc.Type getXmlRpcType()

setXmlRpcType

public void setXmlRpcType(XmlRpc.Type xmlRpcType)

getSeparateParameterConverter

public ParameterConverter<?,?> getSeparateParameterConverter()

getConvertableClass

public java.lang.Class<? extends Convertible<?>> getConvertableClass()

isXmlRpcCompatible

public boolean isXmlRpcCompatible()

setXmlRpcCompatible

public void setXmlRpcCompatible(boolean isXmlRpcCompatible)

usesConvertable

public boolean usesConvertable()

getContainerContent

public ApiParameter getContainerContent()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.