What I have known are:
- annotation was added in java 5
- annotation can be using in method, class, and property
- annotation can work in RUNTIME, CLASS, SOURCE( I don't know how to work with CLASS and SOURCE, and their's features)
- annotation with retention which is RUNTIME can be implement when java program is running.
And I want to implement a annotation to have follows features:
- ensure class only being allowed to create a instance
- ensure methods only being allowed to access method in the class
- it is like as friend in c++
it is same as public and private , but more dynamicall, like
@MyAnnotation(allowMethods={xxx.doSomething})
public void getValue(){}the getValues method only can be accessed in the instance self and xxx.doSomething() method
What should I do and learn in next?
And Where can I learn about these?