Package org.restlet.engine.resource
Class MethodAnnotationInfo
java.lang.Object
org.restlet.engine.resource.AnnotationInfo
org.restlet.engine.resource.MethodAnnotationInfo
Descriptor for method annotations.
- Author:
- Jerome Louvel
-
Field Summary
Fields inherited from class org.restlet.engine.resource.AnnotationInfo
annotationValue, javaClass, javaMethod, javaMethodImpl -
Constructor Summary
ConstructorsConstructorDescriptionMethodAnnotationInfo(Class<?> javaClass, Method restletMethod, Method javaMethod, String annotationValue) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates if the current object is equal to the given object.getInput()Returns the input part of the annotation value.Class<?>[]Returns the input types of the Java method.Class<?>Returns the output type of the Java method.Returns the output part of the annotation value.getQuery()Returns the optional query part of the annotation value.getRequestVariants(MetadataService metadataService, ConverterService converterService) Returns a list of request variants based on the annotation value.getResponseVariants(MetadataService metadataService, ConverterService converterService) Returns a list of response variants based on the annotation value.Returns the matching Restlet method.inthashCode()booleanisCompatible(Method restletMethod, Form queryParams, Representation requestEntity, MetadataService metadataService, ConverterService converterService) Indicates if the annotated method described is compatible with the given parameters.booleanisCompatibleRequestEntity(Representation requestEntity, MetadataService metadataService, ConverterService converterService) Indicates if the given request entity is compatible with the annotated method described.toString()Methods inherited from class org.restlet.engine.resource.AnnotationInfo
getAnnotationValue, getJavaActualType, getJavaActualType, getJavaActualType, getJavaClass, getJavaMethod, getTypeClass
-
Constructor Details
-
MethodAnnotationInfo
public MethodAnnotationInfo(Class<?> javaClass, Method restletMethod, Method javaMethod, String annotationValue) Constructor.- Parameters:
javaClass- The class or interface that hosts the annotated Java method.restletMethod- The matching Restlet method.javaMethod- The annotated Java method.annotationValue- The annotation value.
-
-
Method Details
-
equals
Indicates if the current object is equal to the given object.- Overrides:
equalsin classAnnotationInfo- Parameters:
other- The other object.- Returns:
- True if the current object includes the other.
-
getInput
Returns the input part of the annotation value.- Returns:
- The input part of the annotation value.
-
getJavaInputTypes
Returns the input types of the Java method.- Returns:
- The input types of the Java method.
-
getJavaOutputType
Returns the output type of the Java method.- Returns:
- The output type of the Java method.
-
getOutput
Returns the output part of the annotation value.- Returns:
- The output part of the annotation value.
-
getQuery
Returns the optional query part of the annotation value.- Returns:
- The optional query part of the annotation value.
-
getRequestVariants
public List<Variant> getRequestVariants(MetadataService metadataService, ConverterService converterService) throws IOException Returns a list of request variants based on the annotation value.- Parameters:
metadataService- The metadata service to use.- Returns:
- A list of request variants.
- Throws:
IOException
-
getResponseVariants
public List<Variant> getResponseVariants(MetadataService metadataService, ConverterService converterService) throws IOException Returns a list of response variants based on the annotation value.- Parameters:
metadataService- The metadata service to use.converterService- The converter service to use.- Returns:
- A list of response variants.
- Throws:
IOException
-
getRestletMethod
Returns the matching Restlet method.- Returns:
- The matching Restlet method.
-
hashCode
public int hashCode()- Overrides:
hashCodein classAnnotationInfo
-
isCompatible
public boolean isCompatible(Method restletMethod, Form queryParams, Representation requestEntity, MetadataService metadataService, ConverterService converterService) throws IOException Indicates if the annotated method described is compatible with the given parameters.- Parameters:
restletMethod- The Restlet method to match.requestEntity- Optional request entity.metadataService- The metadata service to use.converterService- The converter service to use.- Returns:
- True if the annotated method is compatible.
- Throws:
IOException
-
isCompatibleRequestEntity
public boolean isCompatibleRequestEntity(Representation requestEntity, MetadataService metadataService, ConverterService converterService) throws IOException Indicates if the given request entity is compatible with the annotated method described.- Parameters:
requestEntity- Optional request entity.metadataService- The metadata service to use.converterService- The converter service to use.- Returns:
- True if the given request entity is compatible with the annotated method described.
- Throws:
IOException
-
toString
- Overrides:
toStringin classAnnotationInfo
-