Class AnnotationApplier<A extends Annotation,B>
- Type Parameters:
A- The annotation that this applier reads from.B- The builder class to apply the annotation to.
- Direct Known Subclasses:
BeanAnnotation.Applier,BeancAnnotation.Applier,BeanConfigAnnotation.Applier,BeanIgnoreAnnotation.Applier,BeanpAnnotation.Applier,ContentAnnotation.Applier,CsvAnnotation.Apply,CsvConfigAnnotation.ParserApply,CsvConfigAnnotation.SerializerApply,ExampleAnnotation.Applier,FormDataAnnotation.Applier,HeaderAnnotation.Applier,HtmlAnnotation.Apply,HtmlConfigAnnotation.ParserApply,HtmlConfigAnnotation.SerializerApply,HtmlDocConfigAnnotation.SerializerApply,HtmlLinkAnnotation.Apply,JsonAnnotation.Apply,JsonConfigAnnotation.ParserApply,JsonConfigAnnotation.SerializerApply,JsonSchemaConfigAnnotation.Apply,MarshalledAnnotation.Applier,MsgPackAnnotation.Apply,MsgPackConfigAnnotation.ParserApply,MsgPackConfigAnnotation.SerializerApply,NamePropertyAnnotation.Applier,OpenApiAnnotation.Apply,OpenApiConfigAnnotation.ParserApply,OpenApiConfigAnnotation.SerializerApply,ParentPropertyAnnotation.Applier,ParserConfigAnnotation.InputStreamParserApply,ParserConfigAnnotation.ParserApply,ParserConfigAnnotation.ReaderParserApply,PathAnnotation.Applier,PathRemainderAnnotation.Applier,PlainTextAnnotation.Apply,PlainTextConfigAnnotation.ParserApply,PlainTextConfigAnnotation.SerializerApply,QueryAnnotation.Applier,RequestAnnotation.Applier,ResponseAnnotation.Applier,RestAnnotation.RestContextApply,RestAnnotation.RestOpContextApply,RestDeleteAnnotation.RestOpContextApply,RestGetAnnotation.RestOpContextApply,RestOpAnnotation.RestOpContextApply,RestOptionsAnnotation.RestOpContextApply,RestPatchAnnotation.RestOpContextApply,RestPostAnnotation.RestOpContextApply,RestPutAnnotation.RestOpContextApply,SchemaAnnotation.Apply,SerializerConfigAnnotation.OutputStreamSerializerApply,SerializerConfigAnnotation.SerializerApply,SerializerConfigAnnotation.WriterSerializerApply,SoapXmlAnnotation.Apply,SoapXmlConfigAnnotation.SerializerApply,StatusCodeAnnotation.Applier,SwapAnnotation.Applier,UonAnnotation.Apply,UonConfigAnnotation.ParserApply,UonConfigAnnotation.SerializerApply,UriAnnotation.Applier,UrlEncodingAnnotation.Apply,UrlEncodingConfigAnnotation.ParserApply,UrlEncodingConfigAnnotation.SerializerApply,XmlAnnotation.Apply,XmlConfigAnnotation.ParserApply,XmlConfigAnnotation.SerializerApply
BeanContext.Builder) from an annotation (e.g. BeanConfig).
Used by Context.Builder.applyAnnotations(Class...) and Context.Builder.applyAnnotations(Object...) to apply
annotations to context beans.
The following code shows the general design pattern.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAnnotationApplier(Class<A> annotationClass, Class<B> builderClass, VarResolverSession varResolverSession) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidapply(AnnotationInfo<A> annotationInfo, B builder) Apply the specified annotation to the specified property store builder.Resolves the specified string and converts it to a boolean.booleanReturnstrue if this apply can be appied to the specified builder.Resolves the specified string as a comma-delimited list of strings.Resolves the specified string and converts it to a Character.Resolves the specified string and converts it to a Charset.Returns the specified class array as anOptional.Resolves the specified string and converts it to an int.Resolves the specified string as a comma-delimited list of strings.Resolves the specified string.Returns the specified string array as anOptional.Returns the specified value if it's simple name is not"void" .protected VarResolverSessionvr()Returns the var resolver session for this apply.
-
Constructor Details
-
AnnotationApplier
protected AnnotationApplier(Class<A> annotationClass, Class<B> builderClass, VarResolverSession varResolverSession) Constructor.- Parameters:
annotationClass- The annotation class.builderClass- The builder class.varResolverSession- The string resolver to use for resolving strings.
-
-
Method Details
-
apply
Apply the specified annotation to the specified property store builder.- Parameters:
annotationInfo- The annotation.builder- The property store builder.
-
bool
Resolves the specified string and converts it to a boolean.- Parameters:
in- The string containing variables to resolve.- Returns:
- The resolved boolean.
-
canApply
Returnstrue if this apply can be appied to the specified builder.- Parameters:
builder- The builder to check.- Returns:
true if this apply can be appied to the specified builder.
-
cdl
Resolves the specified string as a comma-delimited list of strings.- Parameters:
in- The CDL string containing variables to resolve.- Returns:
- An array with resolved strings.
-
character
Resolves the specified string and converts it to a Character.- Parameters:
in- The string containing variables to resolve.loc- The annotation field name.- Returns:
- The resolved Character.
-
charset
Resolves the specified string and converts it to a Charset.- Parameters:
in- The string containing variables to resolve.- Returns:
- The resolved Charset.
-
classes
Returns the specified class array as anOptional.If the array is empty, then returns
Optional.empty().- Parameters:
in- The class array.- Returns:
- The array wrapped in an
Optional.
-
integer
Resolves the specified string and converts it to an int.- Parameters:
in- The string containing variables to resolve.loc- The annotation field name.- Returns:
- The resolved int.
-
stream
Resolves the specified string as a comma-delimited list of strings.- Parameters:
in- The CDL string containing variables to resolve.- Returns:
- An array with resolved strings.
-
string
Resolves the specified string.- Parameters:
in- The string containing variables to resolve.- Returns:
- An optional containing the specified string if it exists, or
Optional.empty()if it does not.
-
strings
Returns the specified string array as anOptional.If the array is empty, then returns
Optional.empty().- Parameters:
in- The string array.- Returns:
- The array wrapped in an
Optional.
-
type
Returns the specified value if it's simple name is not"void" .- Type Parameters:
T- The value to return.- Parameters:
in- The value to return.- Returns:
- An optional containing the specified value.
-
vr
Returns the var resolver session for this apply.- Returns:
- The var resolver session for this apply.
-