[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] Manipulate java resources via resource model

Yes, Member is the interface Dali uses to manipulate annotations in Java source code.
We use implementations of AnnotationAdapter and Declaration
AnnotationAdapter to
add, remove, and change annotations on a member (type, field, or method).
These adapters are public while the implementations are still internal; but you can look
at the implementations to see how we manipulate annotations ourselves.

Ask, if something is not clear, and I will try to remember how it works. :)

Brian

Dimitrov, Dimiter wrote:
Manipulate java resources via resource model

Hello,

In our work with new JPA model, we have necessity to manipulate java entity class, adding new fields and annotations. We could do this via JDT API, but I’m wondering whether will be possible to do this via java resource model? I mean if we have reference to JavaResourcePersistentType (respectively to its fields and properties) could we manipulate them? For instance is it possible to add relation one to one on attribute with name attribute? I hope that the presented API provide such opportunities, because I noticed method getMember() (for type, field or property), which returns Member. From own side Member (in accordance with Java Doc) offers manipulating of annotations on members. Is this manipulation provides modifying (reflected in the code), or it is read-only?

Any help, information or hint will be appreciated.