|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AnnotationMemberTypes
AnnotationMemberTypes defines a set of annotations meant to used on annotation members to specify additional syntatic and semantic behaviour or constraints.
J2SE 5 annotation members provide a very weak level of syntactic and semantic enforcement. Annotation members may only be a certain type (mostly primitives, arrays, plus java.lang.String and a few other classes); it is often useful to be more specific than those types permit.
Consider the following example:
public @interface LastChanged { @AnnotationMemberTypes.Date() public String date(); }
The use of @AnnotationMemberTypes.Date
means that the
value of the date
string must be a date in some standard
form.
AnnotationMemberTypes defines a set of annotations and their semantics,
but actual enforcement of those semantics is implementation dependent.
An apt
-based reference implementation is provided by
AnnotationConstraintValidator
.
AnnotationConstraintValidator
Nested Class Summary | |
---|---|
static interface |
AnnotationMemberTypes.Date
Member is a Date in the format specified (default is YYYY/MM/DD) Only valid on a member that returns String |
static interface |
AnnotationMemberTypes.Decimal
Member is a Decimal Value. |
static interface |
AnnotationMemberTypes.FilePath
Member is a File Path Compiler MUST validate that value points to a readable file. |
static interface |
AnnotationMemberTypes.Int
Member is an Integer value. |
static interface |
AnnotationMemberTypes.JndiName
Member is a JNDI name. |
static interface |
AnnotationMemberTypes.Optional
Marks a member as optional. |
static interface |
AnnotationMemberTypes.QName
Member is a QName Only valid on a member that returns String |
static interface |
AnnotationMemberTypes.Text
Member must be a String value. |
static interface |
AnnotationMemberTypes.URI
Member is a URI Only valid on a member that returns String |
static interface |
AnnotationMemberTypes.URL
Member is a URL Only valid on a member that returns String |
static interface |
AnnotationMemberTypes.URN
Member is a URN Only valid on a member that returns String |
static interface |
AnnotationMemberTypes.XML
Member contains well formed XML Only valid on a member that returns String |
Field Summary | |
---|---|
static byte |
OPTIONAL_BYTE
|
static char |
OPTIONAL_CHAR
|
static double |
OPTIONAL_DOUBLE
|
static float |
OPTIONAL_FLOAT
|
static int |
OPTIONAL_INT
|
static long |
OPTIONAL_LONG
|
static short |
OPTIONAL_SHORT
|
static String |
OPTIONAL_STRING
|
Field Detail |
---|
static final String OPTIONAL_STRING
static final double OPTIONAL_DOUBLE
static final float OPTIONAL_FLOAT
static final int OPTIONAL_INT
static final long OPTIONAL_LONG
static final short OPTIONAL_SHORT
static final char OPTIONAL_CHAR
static final byte OPTIONAL_BYTE
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |