Spring Hateoas

org.springframework.hateoas.core
Class AnnotationAttribute

java.lang.Object
  extended by org.springframework.hateoas.core.AnnotationAttribute

public class AnnotationAttribute
extends Object

Simply helper to reference a dedicated attribute of an Annotation.

Author:
Oliver Gierke

Constructor Summary
AnnotationAttribute(Class<? extends Annotation> annotationType)
          Creates a new AnnotationAttribute to the value attribute of the given Annotation type.
AnnotationAttribute(Class<? extends Annotation> annotationType, String attributeName)
          Creates a new AnnotationAttribute for the given Annotation type and annotation attribute name.
 
Method Summary
 Class<? extends Annotation> getAnnotationType()
          Returns the annotation type.
 String getValueFrom(AnnotatedElement annotatedElement)
          Reads the Annotation attribute's value from the given AnnotatedElement.
 String getValueFrom(Annotation annotation)
          Returns the Annotation attribute's value from the given Annotation.
 String getValueFrom(MethodParameter parameter)
          Reads the Annotation attribute's value from the given MethodParameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationAttribute

public AnnotationAttribute(Class<? extends Annotation> annotationType)
Creates a new AnnotationAttribute to the value attribute of the given Annotation type.

Parameters:
annotationType - must not be null.

AnnotationAttribute

public AnnotationAttribute(Class<? extends Annotation> annotationType,
                           String attributeName)
Creates a new AnnotationAttribute for the given Annotation type and annotation attribute name.

Parameters:
annotationType - must not be null.
attributeName - can be null, defaults to value.
Method Detail

getAnnotationType

public Class<? extends Annotation> getAnnotationType()
Returns the annotation type.

Returns:
the annotationType

getValueFrom

public String getValueFrom(MethodParameter parameter)
Reads the Annotation attribute's value from the given MethodParameter.

Parameters:
parameter - must not be null.
Returns:

getValueFrom

public String getValueFrom(AnnotatedElement annotatedElement)
Reads the Annotation attribute's value from the given AnnotatedElement.

Parameters:
annotatedElement - must not be null.
Returns:

getValueFrom

public String getValueFrom(Annotation annotation)
Returns the Annotation attribute's value from the given Annotation.

Parameters:
annotation - must not be null.
Returns:

Spring Hateoas

Copyright © 2012-2014-2014 Pivotal, Inc.. All Rights Reserved.