org.apache.bval.jsr303.xml
Class AnnotationProxyBuilder<A extends Annotation>

java.lang.Object
  extended by org.apache.bval.jsr303.xml.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.


Constructor Summary
AnnotationProxyBuilder(A annot)
          Create a builder initially configured to create an annotation equivalent to annot.
AnnotationProxyBuilder(Class<A> annotationType)
          Create a new AnnotationProxyBuilder instance.
AnnotationProxyBuilder(Class<A> annotationType, Map<String,Object> elements)
          Create a new AnnotationProxyBuilder instance.
 
Method Summary
 boolean contains(String elementName)
          Learn whether a given element has been configured.
 A createAnnotation()
          Create the annotation represented by this builder.
 Class<A> getType()
          Get the configured Annotation type.
 Object getValue(String elementName)
          Get the specified element value from the current configuration.
 void putValue(String elementName, Object value)
          Add an element to the configuration.
 void setGroups(Class<?>[] groups)
          Configure the well-known JSR303 "groups" element.
 void setMessage(String message)
          Configure the well-known JSR303 "message" element.
 void setPayload(Class<? extends Payload>[] payload)
          Configure the well-known JSR303 "payload" element.
 int size()
          Get the number of configured elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationProxyBuilder

public AnnotationProxyBuilder(Class<A> annotationType)
Create a new AnnotationProxyBuilder instance.

Parameters:
annotationType -

AnnotationProxyBuilder

public AnnotationProxyBuilder(Class<A> annotationType,
                              Map<String,Object> elements)
Create a new AnnotationProxyBuilder instance.

Parameters:
annotationType -
elements -

AnnotationProxyBuilder

public AnnotationProxyBuilder(A annot)
Create a builder initially configured to create an annotation equivalent to annot.

Parameters:
annot - Annotation to be replicated.
Method Detail

putValue

public void putValue(String elementName,
                     Object value)
Add an element to the configuration.

Parameters:
elementName -
value -

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 an elementName element is found on this annotation

size

public int size()
Get the number of configured elements.

Returns:
int

getType

public Class<A> getType()
Get the configured Annotation type.

Returns:
Class

setMessage

public void setMessage(String message)
Configure the well-known JSR303 "message" element.

Parameters:
message -

setGroups

public void setGroups(Class<?>[] groups)
Configure the well-known JSR303 "groups" element.

Parameters:
groups -

setPayload

public void setPayload(Class<? extends Payload>[] payload)
Configure the well-known JSR303 "payload" element.

Parameters:
payload -

createAnnotation

public A createAnnotation()
Create the annotation represented by this builder.

Returns:
Annotation


Copyright © 2010-2012 Apache Software Foundation. All Rights Reserved.