Create Annotation
1 | (ElementType.TYPE) |
- Target and Retention is meta annotation
- Target point the annotation’s place in law[SOURCE in default]
- Retention point the annotation avaliable time
Create More
1 | (ElementType.FIELD) |
- annotation interface’s method will become ture annotation’s
property
- interface need a default value
- type support
Primary Type
Class
String
Enum
Annotation
1 | (ElementType.FIELD) |
Annotation not support inherit
use default value implements inheritage
1 | (ElementType.FIELD) |
1 | (ElementType.FIELD) |
Thinking
Alternative way
Use enumeration type to define the type in DB
but this way lose agility.Use String to describe the type you want to define
but ths way bind handler with DB, if DB changes
java need to modify and recompile.Define some annotation more, to describe what you want
this is good, but maybe a little confusion