public class MappingUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
MappingUtils.AnnotationFilter
This interface allows to select annotations out of a complete set.
|
Constructor and Description |
---|
MappingUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Class<RegistryBean> |
asRegistryBeanClass(java.lang.Class<?> pClass)
Gets the registry bean class for the given class type.
|
static <T extends java.lang.annotation.Annotation> |
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 returns the first one that matches.
|
static <T extends java.lang.annotation.Annotation> |
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.
|
public static boolean isJAXRAnnotation(java.lang.annotation.Annotation a)
a
- The Annotation
object to checktrue
if the given annotation belongs to the JAXR annotations set and false
otherwisepublic static <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<?> beanClass, java.lang.Class<T> annotationType)
T
- The type class extending Annotation
beanClass
- The bean Class
to traverseannotationType
- The Class
type for the Annotation
public static <T extends java.lang.annotation.Annotation> T getAnnotationFromHierarchy(java.lang.Class<?> beanClass, java.lang.Class<T> annotationType)
T
- The type class extending Annotation
beanClass
- The bean Class
to traverseannotationType
- The Class
type for the Annotation
public static java.lang.Class<?> getBeanInterface(java.lang.Class<?> pClass)
Bean
annotation.pClass
- The Class
hierarchy to look atClass
that has the Bean
annotation or null
if not foundpublic static java.lang.annotation.Annotation getAnnotation(RegistryBean bean, java.lang.reflect.Method getter)
bean
- The RegistryBean
objectgetter
- The Method
where the annotation should be matched withAnnotation
object or null if one is not foundpublic static java.util.List<java.lang.annotation.Annotation> getAnnotations(RegistryBean bean, java.lang.reflect.Method method)
bean
- The RegistryBean
objectmethod
- The Method
where the annotations are assignedList
of Annotation
objectspublic static java.util.List<java.lang.annotation.Annotation> getJAXRAnnotations(RegistryBean bean, java.lang.reflect.Method method)
bean
- The RegistryBean
objectmethod
- The Method
where the annotations are assignedList
of Annotation
objectspublic static java.util.List<java.lang.annotation.Annotation> getJAXRAnnotations(java.lang.Class<?> beanType, java.lang.reflect.Method method)
beanType
- The Class
type for the bean objectmethod
- The Method
where the annotations are assignedList
of Annotation
objectspublic static java.util.List<java.lang.annotation.Annotation> getAnnotations(java.lang.Class<?> pClass, java.lang.reflect.Method pMethod, MappingUtils.AnnotationFilter pFilter)
pClass
- The Class
type for the beanpMethod
- The Method
to search for annotationspFilter
- The MappingUtils.AnnotationFilter
to searchList
of Annotation
objects which match the given pFilterpublic static java.lang.Class<RegistryBean> asRegistryBeanClass(java.lang.Class<?> pClass)
pClass
- The Class
typeClass
converted to registry bean type