Class AnnotationAttribute
java.lang.Object
org.springframework.hateoas.server.core.AnnotationAttribute
Simply helper to reference a dedicated attribute of an
Annotation.- Author:
- Oliver Gierke
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationAttribute(Class<? extends Annotation> annotationType) AnnotationAttribute(Class<? extends Annotation> annotationType, String attributeName) Creates a newAnnotationAttributefor the givenAnnotationtype and annotation attribute name. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Annotation>Returns the annotation type.getValueFrom(Annotation annotation) Returns theAnnotationattribute's value from the givenAnnotation.getValueFrom(MethodParameter parameter) Reads theAnnotationattribute's value from the givenMethodParameter.
-
Constructor Details
-
AnnotationAttribute
- Parameters:
annotationType- must not be null.
-
AnnotationAttribute
public AnnotationAttribute(Class<? extends Annotation> annotationType, @Nullable String attributeName) Creates a newAnnotationAttributefor the givenAnnotationtype and annotation attribute name.- Parameters:
annotationType- must not be null.attributeName- can be null, defaults tovalue.
-
-
Method Details
-
getAnnotationType
Returns the annotation type.- Returns:
- the annotationType
-
getValueFrom
Reads theAnnotationattribute's value from the givenMethodParameter.- Parameters:
parameter- must not be null.- Returns:
-
getValueFrom
Returns theAnnotationattribute's value from the givenAnnotation.- Parameters:
annotation- must not be null.- Returns:
-