com.softwareag.centrasite.appl.framework.persistence.mapper
Class MappingUtils

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.persistence.mapper.MappingUtils

public class MappingUtils
extends java.lang.Object

Helper class for mappings.


Nested Class Summary
static interface MappingUtils.AnnotationFilter
          This interface allows to select annotations out of a complete set.
 
Constructor Summary
MappingUtils()
           
 
Method Summary
static java.lang.Class<RegistryBean> asRegistryBeanClass(java.lang.Class<?> pClass)
           
static
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<?> beanClass, java.lang.Class<T> annotationType)
          Retrieves annotation with given annotation type by traversing over all the interfaces of the bean.
static java.lang.annotation.Annotation getAnnotation(RegistryBean bean, java.lang.reflect.Method getter)
          Filters the annotations by package and return the first one that matches.
static
<T extends java.lang.annotation.Annotation>
T
getAnnotationFromHierarchy(java.lang.Class<?> beanClass, java.lang.Class<T> annotationType)
          Retrieves annotation with given annotation type by traversing over all the interfaces in the class hierarchy.
static java.util.List<java.lang.annotation.Annotation> getAnnotations(java.lang.Class<?> pClass, java.lang.reflect.Method pMethod, MappingUtils.AnnotationFilter pFilter)
          Searches for annotations on the given method, which match the given filter.
static java.util.List<java.lang.annotation.Annotation> getAnnotations(RegistryBean bean, java.lang.reflect.Method method)
          Retrieves annotations assigned to a method of a bean by traversing all its interfaces.
static java.lang.Class<?> getBeanInterface(java.lang.Class<?> pClass)
          Returns the first java interface class from the given class hierarchy that has the Bean annotation.
static java.util.List<java.lang.annotation.Annotation> getJAXRAnnotations(java.lang.Class<?> beanType, java.lang.reflect.Method method)
          Retrieves annotations assigned to a method of a bean type by traversing all its interfaces and filtering on package name.
static java.util.List<java.lang.annotation.Annotation> getJAXRAnnotations(RegistryBean bean, java.lang.reflect.Method method)
          Retrieves annotations assigned to a method of a bean by traversing all its interfaces and filtering on package name.
static boolean isJAXRAnnotation(java.lang.annotation.Annotation a)
          Helper method for checking if an annotation belongs the the JAXR annotations set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingUtils

public MappingUtils()
Method Detail

isJAXRAnnotation

public static boolean isJAXRAnnotation(java.lang.annotation.Annotation a)
Helper method for checking if an annotation belongs the the JAXR annotations set.


getAnnotation

public static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<?> beanClass,
                                                                          java.lang.Class<T> annotationType)
Retrieves annotation with given annotation type by traversing over all the interfaces of the bean.


getAnnotationFromHierarchy

public static <T extends java.lang.annotation.Annotation> T getAnnotationFromHierarchy(java.lang.Class<?> beanClass,
                                                                                       java.lang.Class<T> annotationType)
Retrieves annotation with given annotation type by traversing over all the interfaces in the class hierarchy.


getBeanInterface

public static java.lang.Class<?> getBeanInterface(java.lang.Class<?> pClass)
Returns the first java interface class from the given class hierarchy that has the Bean annotation.

Parameters:
pClass -
Returns:
Class

getAnnotation

public static java.lang.annotation.Annotation getAnnotation(RegistryBean bean,
                                                            java.lang.reflect.Method getter)
Filters the annotations by package and return the first one that matches. Currently we support only one annotation per method.


getAnnotations

public static java.util.List<java.lang.annotation.Annotation> getAnnotations(RegistryBean bean,
                                                                             java.lang.reflect.Method method)
Retrieves annotations assigned to a method of a bean by traversing all its interfaces.


getJAXRAnnotations

public static java.util.List<java.lang.annotation.Annotation> getJAXRAnnotations(RegistryBean bean,
                                                                                 java.lang.reflect.Method method)
Retrieves annotations assigned to a method of a bean by traversing all its interfaces and filtering on package name.


getJAXRAnnotations

public static java.util.List<java.lang.annotation.Annotation> getJAXRAnnotations(java.lang.Class<?> beanType,
                                                                                 java.lang.reflect.Method method)
Retrieves annotations assigned to a method of a bean type by traversing all its interfaces and filtering on package name.


getAnnotations

public static java.util.List<java.lang.annotation.Annotation> getAnnotations(java.lang.Class<?> pClass,
                                                                             java.lang.reflect.Method pMethod,
                                                                             MappingUtils.AnnotationFilter pFilter)
Searches for annotations on the given method, which match the given filter.


asRegistryBeanClass

public static java.lang.Class<RegistryBean> asRegistryBeanClass(java.lang.Class<?> pClass)
Parameters:
pClass -
Returns:
Class