Package org.apache.juneau
Interface AnnotationProvider
- All Known Subinterfaces:
CsvMetaProvider,HtmlMetaProvider,JsonMetaProvider,JsonSchemaMetaProvider,MsgPackMetaProvider,OpenApiMetaProvider,PlainTextMetaProvider,SoapXmlMetaProvider,UonMetaProvider,UrlEncodingMetaProvider,XmlMetaProvider
- All Known Implementing Classes:
BaseHttpPartParser,BaseHttpPartSerializer,BeanContext,BeanContextable,BeanTraverseContext,ClasspathStore,Config,ConfigStore,Context,CsvParser,CsvSerializer,FileStore,HtmlDocSerializer,HtmlParser,HtmlSchemaDocSerializer,HtmlSchemaSerializer,HtmlSchemaSerializer.Readable,HtmlSchemaSerializer.Simple,HtmlSchemaSerializer.SimpleReadable,HtmlSerializer,HtmlSerializer.Sq,HtmlSerializer.SqReadable,HtmlStrippedDocSerializer,ImageParser,ImageSerializer,InputStreamParser,Json5Parser,Json5Serializer,Json5Serializer.Readable,JsonParser,JsonParser.Strict,JsonSchemaGenerator,JsonSchemaSerializer,JsonSchemaSerializer.Readable,JsonSchemaSerializer.Simple,JsonSchemaSerializer.SimpleReadable,JsonSerializer,JsonSerializer.Readable,JsonSerializer.ReadableSafe,MemoryStore,MockRestClient,MsgPackParser,MsgPackParser.Base64,MsgPackParser.SpacedHex,MsgPackSerializer,MsgPackSerializer.Base64,MsgPackSerializer.SpacedHex,OpenApiParser,OpenApiSerializer,OutputStreamSerializer,Parser,Parser.Null,ParserSet.Inherit,ParserSet.NoInherit,PlainTextParser,PlainTextSerializer,ReaderParser,RestClient,RestContext,RestOpContext,RrpcRestOpContext,Serializer,Serializer.Null,SerializerSet.Inherit,SerializerSet.NoInherit,SimplePartParser,SimplePartSerializer,SoapXmlSerializer,SqlStore,UonParser,UonParser.Decoding,UonSerializer,UonSerializer.Encoding,UonSerializer.Readable,UrlEncodingParser,UrlEncodingSerializer,UrlEncodingSerializer.Expanded,UrlEncodingSerializer.PlainText,UrlEncodingSerializer.Readable,WriterSerializer,XmlDocSerializer,XmlDocSerializer.Ns,XmlParser,XmlSerializer,XmlSerializer.Ns,XmlSerializer.NsSq,XmlSerializer.NsSqReadable,XmlSerializer.Sq,XmlSerializer.SqReadable
public interface AnnotationProvider
Interface that provides the ability to look up annotations on classes/methods/constructors/fields.
See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AnnotationProviderDefault metadata provider.static final booleanDisable annotation caching. -
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
AfirstAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter) Finds the first matching annotation on the specified class.<A extends Annotation>
AfirstAnnotation(Class<A> type, Constructor<?> onConstructor, Predicate<A> filter) Finds the first matching annotation on the specified constructor.<A extends Annotation>
AfirstAnnotation(Class<A> type, Field onField, Predicate<A> filter) Finds the first matching annotation on the specified field.<A extends Annotation>
AfirstAnnotation(Class<A> type, Method onMethod, Predicate<A> filter) Finds the first matching annotation on the specified method.<A extends Annotation>
AfirstDeclaredAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter) Finds the first matching declared annotations on the specified class.<A extends Annotation>
voidforEachAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter, Consumer<A> action) Performs an action on the matching annotations on the specified class.<A extends Annotation>
voidforEachAnnotation(Class<A> type, Constructor<?> onConstructor, Predicate<A> filter, Consumer<A> action) Performs an action on the matching annotations on the specified constructor.<A extends Annotation>
voidforEachAnnotation(Class<A> type, Field onField, Predicate<A> filter, Consumer<A> action) Performs an action on the matching annotations on the specified field.<A extends Annotation>
voidforEachAnnotation(Class<A> type, Method onMethod, Predicate<A> filter, Consumer<A> action) Performs an action on the matching annotations on the specified method.<A extends Annotation>
voidforEachDeclaredAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter, Consumer<A> action) Performs an action on the matching declared annotations on the specified class.<A extends Annotation>
AlastAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter) Finds the last matching annotation on the specified class.<A extends Annotation>
AlastAnnotation(Class<A> type, Constructor<?> onConstructor, Predicate<A> filter) Finds the last matching annotation on the specified constructor.<A extends Annotation>
AlastAnnotation(Class<A> type, Field onField, Predicate<A> filter) Finds the last matching annotation on the specified field.<A extends Annotation>
AlastAnnotation(Class<A> type, Method onMethod, Predicate<A> filter) Finds the last matching annotation on the specified method.<A extends Annotation>
AlastDeclaredAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter) Finds the last matching declared annotations on the specified class.
-
Field Details
-
DISABLE_ANNOTATION_CACHING
Disable annotation caching. -
DEFAULT
Default metadata provider.
-
-
Method Details
-
forEachAnnotation
<A extends Annotation> void forEachAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter, Consumer<A> action) Performs an action on the matching annotations on the specified class.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onClass- The class to search on.filter- A predicate to apply to the entries to determine if action should be performed. Can benull .action- An action to perform on the entry.
-
firstAnnotation
Finds the first matching annotation on the specified class.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onClass- The class to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if not found.
-
lastAnnotation
Finds the last matching annotation on the specified class.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onClass- The class to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if not found.
-
forEachDeclaredAnnotation
<A extends Annotation> void forEachDeclaredAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter, Consumer<A> action) Performs an action on the matching declared annotations on the specified class.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onClass- The class to search on.filter- A predicate to apply to the entries to determine if action should be performed. Can benull .action- An action to perform on the entry.
-
firstDeclaredAnnotation
<A extends Annotation> A firstDeclaredAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter) Finds the first matching declared annotations on the specified class.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onClass- The class to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if no annotations matched.
-
lastDeclaredAnnotation
<A extends Annotation> A lastDeclaredAnnotation(Class<A> type, Class<?> onClass, Predicate<A> filter) Finds the last matching declared annotations on the specified class.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onClass- The class to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if no annotations matched.
-
forEachAnnotation
<A extends Annotation> void forEachAnnotation(Class<A> type, Method onMethod, Predicate<A> filter, Consumer<A> action) Performs an action on the matching annotations on the specified method.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onMethod- The method to search on.filter- A predicate to apply to the entries to determine if action should be performed. Can benull .action- An action to perform on the entry.
-
firstAnnotation
Finds the first matching annotation on the specified method.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onMethod- The method to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if no annotations matched.
-
lastAnnotation
Finds the last matching annotation on the specified method.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onMethod- The method to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if no annotations matched.
-
forEachAnnotation
<A extends Annotation> void forEachAnnotation(Class<A> type, Field onField, Predicate<A> filter, Consumer<A> action) Performs an action on the matching annotations on the specified field.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onField- The field to search on.filter- A predicate to apply to the entries to determine if action should be performed. Can benull .action- An action to perform on the entry.
-
firstAnnotation
Finds the first matching annotation on the specified field.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onField- The field to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if no annotations matched.
-
lastAnnotation
Finds the last matching annotation on the specified field.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onField- The field to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if no annotations matched.
-
forEachAnnotation
<A extends Annotation> void forEachAnnotation(Class<A> type, Constructor<?> onConstructor, Predicate<A> filter, Consumer<A> action) Performs an action on the matching annotations on the specified constructor.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onConstructor- The constructor to search on.filter- A predicate to apply to the entries to determine if action should be performed. Can benull .action- An action to perform on the entry.
-
firstAnnotation
<A extends Annotation> A firstAnnotation(Class<A> type, Constructor<?> onConstructor, Predicate<A> filter) Finds the first matching annotation on the specified constructor.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onConstructor- The constructor to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if no annotations matched.
-
lastAnnotation
<A extends Annotation> A lastAnnotation(Class<A> type, Constructor<?> onConstructor, Predicate<A> filter) Finds the last matching annotation on the specified constructor.- Type Parameters:
A- The annotation type to find.- Parameters:
type- The annotation type to find.onConstructor- The constructor to search on.filter- A predicate to apply to the entries to determine if value should be used. Can benull .- Returns:
- The matched annotation, or
null if no annotations matched.
-