Package org.restlet.engine.resource
Class AnnotationInfo
- java.lang.Object
-
- org.restlet.engine.resource.AnnotationInfo
-
- Direct Known Subclasses:
MethodAnnotationInfo
,ThrowableAnnotationInfo
public abstract class AnnotationInfo extends java.lang.Object
Descriptor for Restlet annotations.- Author:
- Jerome Louvel
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
annotationValue
The raw annotation value.protected java.lang.Class<?>
javaClass
The class that hosts the annotated Java method.protected java.lang.reflect.Method
javaMethod
The annotated Java method.protected java.lang.reflect.Method
javaMethodImpl
The upper implementation of the annotated Java method.
-
Constructor Summary
Constructors Constructor Description AnnotationInfo(java.lang.Class<?> javaClass, java.lang.reflect.Method javaMethod, java.lang.String annotationValue)
Constructor.AnnotationInfo(java.lang.Class<?> javaClass, java.lang.String annotationValue)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
Indicates if the current variant is equal to the given object.java.lang.String
getAnnotationValue()
Returns the raw annotation value.protected java.lang.Class<?>
getJavaActualType(java.lang.Class<?> initialType, java.lang.reflect.Type genericType)
Returns the actual type for a given generic type.protected static java.lang.Class<?>
getJavaActualType(java.lang.Class<?> currentClass, java.lang.String genericTypeName)
Returns the actual type for a given generic type name.protected static java.lang.Class<?>
getJavaActualType(java.lang.reflect.Type currentType, java.lang.String genericTypeName)
Returns the actual type for a given generic type name.java.lang.Class<?>
getJavaClass()
Returns the resource interface value.java.lang.reflect.Method
getJavaMethod()
Returns the annotated Java method.protected static java.lang.Class<?>
getTypeClass(java.lang.reflect.Type type)
Returns the underlying class for a type or null.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
annotationValue
protected final java.lang.String annotationValue
The raw annotation value.
-
javaClass
protected final java.lang.Class<?> javaClass
The class that hosts the annotated Java method.
-
javaMethod
protected final java.lang.reflect.Method javaMethod
The annotated Java method.
-
javaMethodImpl
protected final java.lang.reflect.Method javaMethodImpl
The upper implementation of the annotated Java method.
-
-
Constructor Detail
-
AnnotationInfo
public AnnotationInfo(java.lang.Class<?> javaClass, java.lang.reflect.Method javaMethod, java.lang.String annotationValue)
Constructor.- Parameters:
javaClass
- The annotated Java class or parent Java class.javaMethod
- The annotated Java method.annotationValue
- The annotation value.
-
AnnotationInfo
public AnnotationInfo(java.lang.Class<?> javaClass, java.lang.String annotationValue)
Constructor.- Parameters:
javaClass
- The annotated Java class or parent Java class.annotationValue
- The annotation value.
-
-
Method Detail
-
getJavaActualType
protected static java.lang.Class<?> getJavaActualType(java.lang.Class<?> currentClass, java.lang.String genericTypeName)
Returns the actual type for a given generic type name.- Parameters:
currentClass
- The current class to walk up.genericTypeName
- The generic type name to resolve.- Returns:
- The actual type.
-
getJavaActualType
protected static java.lang.Class<?> getJavaActualType(java.lang.reflect.Type currentType, java.lang.String genericTypeName)
Returns the actual type for a given generic type name.- Parameters:
currentType
- The current type to start with.genericTypeName
- The generic type name to resolve.- Returns:
- The actual type.
-
getTypeClass
protected static java.lang.Class<?> getTypeClass(java.lang.reflect.Type type)
Returns the underlying class for a type or null.- Parameters:
type
- The generic type.- Returns:
- The underlying class
-
equals
public boolean equals(java.lang.Object other)
Indicates if the current variant is equal to the given object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
other
- The other object.- Returns:
- True if the current object is equal to the given object.
-
getAnnotationValue
public java.lang.String getAnnotationValue()
Returns the raw annotation value.- Returns:
- The raw annotation value.
-
getJavaActualType
protected java.lang.Class<?> getJavaActualType(java.lang.Class<?> initialType, java.lang.reflect.Type genericType)
Returns the actual type for a given generic type.- Parameters:
initialType
- The initial type, which may be generic.genericType
- The generic type information if any.- Returns:
- The actual type.
-
getJavaClass
public java.lang.Class<?> getJavaClass()
Returns the resource interface value.- Returns:
- The resource interface value.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getJavaMethod
public java.lang.reflect.Method getJavaMethod()
Returns the annotated Java method.- Returns:
- The annotated Java method.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-