@Retention(CLASS)
@Target({PARAMETER,METHOD})
@Repeatable(Properties.class)
@Documented
public @interface Property
Indicate that a method parameter value should be applied to a property (with a setter method) on the resultant
exception object.
If this annotation is placed on a method the name attribute becomes a required parameter and one default attribute needs to be set. The value of the default attribute is used to set the property on the resultant exception object.
- Author:
- David M. Lloyd, James R. Perkins
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanThe defaultbooleanvalue if this annotation is used on a method.byteThe default boolean value if this annotation is used on a method.charThe defaultbytevalue if this annotation is used on a method.Class<?> The defaultClassvalue if this annotation is used on a method.doubleThe defaultdoublevalue if this annotation is used on a method.floatThe defaultfloatvalue if this annotation is used on a method.intThe defaultintvalue if this annotation is used on a method.longThe defaultlongvalue if this annotation is used on a method.The property name.shortThe defaultshortvalue if this annotation is used on a method.The defaultStringvalue if this annotation is used on a method.
-
Element Details
-
name
String nameThe property name. If not specified, the parameter name is assumed to be the property name.This becomes a required attribute if this annotation is present on a method.
- Returns:
- the property name
- Default:
""
-
booleanValue
boolean booleanValueThe defaultbooleanvalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
false
-
byteValue
byte byteValueThe default boolean value if this annotation is used on a method.- Returns:
- the default value to use
- Default:
(byte)0x00
-
charValue
char charValueThe defaultbytevalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
'\u0000'
-
classValue
Class<?> classValueThe defaultClassvalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
java.lang.Object.class
-
doubleValue
double doubleValueThe defaultdoublevalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
0.0
-
floatValue
float floatValueThe defaultfloatvalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
0.0f
-
intValue
int intValueThe defaultintvalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
0
-
longValue
long longValueThe defaultlongvalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
0L
-
shortValue
short shortValueThe defaultshortvalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
0
-
stringValue
String stringValueThe defaultStringvalue if this annotation is used on a method.- Returns:
- the default value to use
- Default:
""
-