org.hibernate.validator.util.annotationfactory
Class AnnotationDescriptor<T extends Annotation>
java.lang.Object
org.hibernate.validator.util.annotationfactory.AnnotationDescriptor<T>
public class AnnotationDescriptor<T extends Annotation>
- extends Object
Encapsulates the data you need to create an annotation. In
particular, it stores the type of an Annotation instance
and the values of its elements.
The "elements" we're talking about are the annotation attributes,
not its targets (the term "element" is used ambiguously
in Java's annotations documentation).
- Author:
- Paolo Perrotta, Davide Marchignoli, Hardy Ferentschik
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AnnotationDescriptor
public AnnotationDescriptor(Class<T> annotationType)
AnnotationDescriptor
public AnnotationDescriptor(Class<T> annotationType,
Map<String,Object> elements)
getInstance
public static <S extends Annotation> AnnotationDescriptor<S> getInstance(Class<S> annotationType)
- Returns a new descriptor for the given annotation type.
- Type Parameters:
S - The type of the annotation.- Parameters:
annotationType - The annotation's class.
- Returns:
- A new descriptor for the given annotation type.
getInstance
public static <S extends Annotation> AnnotationDescriptor<S> getInstance(Class<S> annotationType,
Map<String,Object> elements)
- Returns a new descriptor for the given annotation type.
- Type Parameters:
S - The type of the annotation.- Parameters:
annotationType - The annotation's class.elements - A map with attribute values for the annotation to be created.
- Returns:
- A new descriptor for the given annotation type.
setValue
public void setValue(String elementName,
Object value)
valueOf
public Object valueOf(String elementName)
containsElement
public boolean containsElement(String elementName)
numberOfElements
public int numberOfElements()
type
public Class<T> type()
Copyright © 2011 Oracle Corporation. All Rights Reserved.