Package org.apache.bval.jsr
Enum ConstraintAnnotationAttributes
- java.lang.Object
-
- java.lang.Enum<ConstraintAnnotationAttributes>
-
- org.apache.bval.jsr.ConstraintAnnotationAttributes
-
- All Implemented Interfaces:
Serializable
,Comparable<ConstraintAnnotationAttributes>
public enum ConstraintAnnotationAttributes extends Enum<ConstraintAnnotationAttributes>
Defines the well-known attributes ofConstraint
annotations.- Version:
- $Rev: 1165923 $ $Date: 2011-09-06 18:07:53 -0500 (Tue, 06 Sep 2011) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ConstraintAnnotationAttributes.Worker<C extends Annotation>
-
Enum Constant Summary
Enum Constants Enum Constant Description GROUPS
"groups"MESSAGE
"message"PAYLOAD
"payload"VALIDATION_APPLIES_TO
"validationAppliesTo"VALUE
"value" for multi-valued constraints
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <C extends Annotation>
ConstraintAnnotationAttributes.Worker<C>analyze(Class<C> clazz)
<V> V
get(Map<? super String,? super V> map)
Get the value ofthis.attributeName
frommap
.String
getAttributeName()
Get the attribute name represented.Class<?>
getType()
Get the expected type of the represented attribute.boolean
isMandatory()
boolean
isValidDefaultValue(Object o)
<V> Object
put(Map<? super String,? super V> map, V value)
Putvalue
into a map withthis.attributeName
as key.String
toString()
static ConstraintAnnotationAttributes
valueOf(String name)
Returns the enum constant of this type with the specified name.static ConstraintAnnotationAttributes[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MESSAGE
public static final ConstraintAnnotationAttributes MESSAGE
"message"
-
GROUPS
public static final ConstraintAnnotationAttributes GROUPS
"groups"
-
PAYLOAD
public static final ConstraintAnnotationAttributes PAYLOAD
"payload"
-
VALIDATION_APPLIES_TO
public static final ConstraintAnnotationAttributes VALIDATION_APPLIES_TO
"validationAppliesTo"
-
VALUE
public static final ConstraintAnnotationAttributes VALUE
"value" for multi-valued constraints
-
-
Method Detail
-
values
public static ConstraintAnnotationAttributes[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ConstraintAnnotationAttributes c : ConstraintAnnotationAttributes.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConstraintAnnotationAttributes valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getType
public Class<?> getType()
Get the expected type of the represented attribute.
-
getAttributeName
public String getAttributeName()
Get the attribute name represented.- Returns:
- String
-
toString
public String toString()
- Overrides:
toString
in classEnum<ConstraintAnnotationAttributes>
-
put
public <V> Object put(Map<? super String,? super V> map, V value)
Putvalue
into a map withthis.attributeName
as key.- Type Parameters:
V
-- Parameters:
map
-value
-- Returns:
- previous value mapped to
this.attributeName
-
get
public <V> V get(Map<? super String,? super V> map)
Get the value ofthis.attributeName
frommap
.- Type Parameters:
V
-- Parameters:
map
-- Returns:
- V if you say so
-
analyze
public <C extends Annotation> ConstraintAnnotationAttributes.Worker<C> analyze(Class<C> clazz)
-
isMandatory
public boolean isMandatory()
-
isValidDefaultValue
public boolean isValidDefaultValue(Object o)
-
-