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
ConstructorDescriptionAnnotationAttribute
(Class<? extends Annotation> annotationType) AnnotationAttribute
(Class<? extends Annotation> annotationType, String attributeName) Creates a newAnnotationAttribute
for the givenAnnotation
type and annotation attribute name. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends Annotation>
Returns the annotation type.getValueFrom
(Annotation annotation) Returns theAnnotation
attribute's value from the givenAnnotation
.getValueFrom
(MethodParameter parameter) Reads theAnnotation
attribute'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 newAnnotationAttribute
for the givenAnnotation
type 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 theAnnotation
attribute's value from the givenMethodParameter
.- Parameters:
parameter
- must not be null.- Returns:
-
getValueFrom
Returns theAnnotation
attribute's value from the givenAnnotation
.- Parameters:
annotation
- must not be null.- Returns:
-