Package org.hcjf.utils
Class Introspection.Accessors
- java.lang.Object
-
- org.hcjf.utils.Introspection.Accessors
-
- Enclosing class:
- Introspection
public static final class Introspection.Accessors extends java.lang.ObjectThis class contains the instances of getter and setter for a specific resource
-
-
Constructor Summary
Constructors Constructor Description Accessors(java.lang.String resourceName, Introspection.Getter getter, Introspection.Setter setter)
-
Method Summary
Modifier and Type Method Description <A extends java.lang.annotation.Annotation>
AgetAnnotation(java.lang.Class<? extends A> annotationClass)Returns the instance of the annotation class associated to the accessor method, or null if the annotation doesn't exist.<A extends java.lang.annotation.Annotation>
java.util.List<A>getAnnotations(java.lang.Class<? extends A> annotationClass)Returns the list of the annotation instances associated to the invoker, or null if the annotation class is not present into the invoker.java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.List<java.lang.annotation.Annotation>>getAnnotationsMap()Return an unmodifiable map with all the annotation instances associated to the method indexed by the class of the each annotation instance.Introspection.GettergetGetter()Returns the getter instance.java.lang.StringgetResourceName()Returns the name of the resource.Introspection.SettergetSetter()Returns the setter instance.booleanisAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)Verify if exists an instance of the annotation class associated to the accessor method.
-
-
-
Constructor Detail
-
Accessors
public Accessors(java.lang.String resourceName, Introspection.Getter getter, Introspection.Setter setter)
-
-
Method Detail
-
getResourceName
public java.lang.String getResourceName()
Returns the name of the resource.- Returns:
- Resource name.
-
getGetter
public Introspection.Getter getGetter()
Returns the getter instance.- Returns:
- Getter instance.
-
getSetter
public Introspection.Setter getSetter()
Returns the setter instance.- Returns:
- Setter instance.
-
isAnnotationPresent
public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Verify if exists an instance of the annotation class associated to the accessor method.- Parameters:
annotationClass- Annotation class.- Returns:
- True if the instance exists and false in the otherwise
-
getAnnotation
public final <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<? extends A> annotationClass)
Returns the instance of the annotation class associated to the accessor method, or null if the annotation doesn't exist. This method return the first instance of the list of annotations.- Type Parameters:
A- Expected annotation type.- Parameters:
annotationClass- Annotation class.- Returns:
- Annotation instance or null.
-
getAnnotations
public final <A extends java.lang.annotation.Annotation> java.util.List<A> getAnnotations(java.lang.Class<? extends A> annotationClass)
Returns the list of the annotation instances associated to the invoker, or null if the annotation class is not present into the invoker.- Type Parameters:
A- Expected annotation type.- Parameters:
annotationClass- Annotation class.- Returns:
- Unmodifiable list of annotation instances.
-
getAnnotationsMap
public final java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.List<java.lang.annotation.Annotation>> getAnnotationsMap()
Return an unmodifiable map with all the annotation instances associated to the method indexed by the class of the each annotation instance.- Returns:
- Unmodifiable map.
-
-