Package org.apache.bval.jsr.util
Class AnnotationProxyBuilder<A extends Annotation>
- java.lang.Object
-
- org.apache.bval.jsr.util.AnnotationProxyBuilder<A>
-
public final class AnnotationProxyBuilder<A extends Annotation> extends Object
Description: Holds the information and creates an annotation proxy during xml parsing of validation mapping constraints.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AnnotationProxyBuilder.ConvertGroupAnnotation
static class
AnnotationProxyBuilder.ValidAnnotation
-
Constructor Summary
Constructors Constructor Description AnnotationProxyBuilder(A annot, ConcurrentMap<Class<?>,Method[]> cache)
Create a builder initially configured to create an annotation equivalent toannot
.AnnotationProxyBuilder(Class<A> annotationType, ConcurrentMap<Class<?>,Method[]> cache)
Create a new AnnotationProxyBuilder instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String elementName)
Learn whether a given element has been configured.A
createAnnotation()
Create the annotation represented by this builder.Method[]
getMethods()
Class<A>
getType()
Get the configured Annotation type.Object
getValue(String elementName)
Get the specified element value from the current configuration.boolean
isChanged()
boolean
setGroups(Class<?>[] groups)
Configure the well-known JSR303 "groups" element.boolean
setMessage(String message)
Configure the well-known JSR303 "message" element.boolean
setPayload(Class<? extends jakarta.validation.Payload>[] payload)
Configure the well-known JSR303 "payload" element.boolean
setValidationAppliesTo(jakarta.validation.ConstraintTarget constraintTarget)
Configure the well-known "validationAppliesTo" element.boolean
setValue(String elementName, Object value)
Add an element to the configuration.int
size()
Get the number of configured elements.
-
-
-
Constructor Detail
-
AnnotationProxyBuilder
AnnotationProxyBuilder(Class<A> annotationType, ConcurrentMap<Class<?>,Method[]> cache)
Create a new AnnotationProxyBuilder instance.- Parameters:
annotationType
-cache
-
-
AnnotationProxyBuilder
AnnotationProxyBuilder(A annot, ConcurrentMap<Class<?>,Method[]> cache)
Create a builder initially configured to create an annotation equivalent toannot
.- Parameters:
annot
- Annotation to be replicated.cache
-
-
-
Method Detail
-
getMethods
public Method[] getMethods()
-
setValue
public boolean setValue(String elementName, Object value)
Add an element to the configuration.- Parameters:
elementName
-value
-- Returns:
- whether any change occurred
-
getValue
public Object getValue(String elementName)
Get the specified element value from the current configuration.- Parameters:
elementName
-- Returns:
- Object value
-
contains
public boolean contains(String elementName)
Learn whether a given element has been configured.- Parameters:
elementName
-- Returns:
true
if anelementName
element is found on this annotation
-
size
public int size()
Get the number of configured elements.- Returns:
- int
-
setMessage
public boolean setMessage(String message)
Configure the well-known JSR303 "message" element.- Parameters:
message
-- Returns:
-
setGroups
public boolean setGroups(Class<?>[] groups)
Configure the well-known JSR303 "groups" element.- Parameters:
groups
-- Returns:
-
setPayload
public boolean setPayload(Class<? extends jakarta.validation.Payload>[] payload)
Configure the well-known JSR303 "payload" element.- Parameters:
payload
-- Returns:
-
setValidationAppliesTo
public boolean setValidationAppliesTo(jakarta.validation.ConstraintTarget constraintTarget)
Configure the well-known "validationAppliesTo" element.- Parameters:
constraintTarget
-
-
isChanged
public boolean isChanged()
-
createAnnotation
public A createAnnotation()
Create the annotation represented by this builder.- Returns:
Annotation
-
-