-
-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
review feat(role): field annotation with a role #1368
Conversation
CtExpression<A> assignment; | ||
|
||
@SpoonProperty(clazz = CtTypeReference.class, name = SpoonProperty.PropertyName.TYPE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CtTypedElement
I did not understood the purpose. What can profit from that? The mapping of fields to correct property names, might make sense. But may be optional solution would be to rename fields, whose name do not fit to their property name. Then we might have simple rule: field name == property name (I have not checked if it is possible in all cases) The mapping of property to interface |
Did I understood well, that this PR is a step on the way to the meta model of spoon model? In such case I suggest something like this: C1) we need a I1) These property descriptors might be accessible as attribute of SpoonProperty.PropertyName enum. For example |
yes
Yes, this will be implemented as additional information in the to-be-renamed SpoonProperty.PropertyName enumeration (=I1)
Yes, this is the final goal
Runtime support is welcome in subsequent PRs
Yes, we aim at this too.
Welcome in subsequent PR. It seems we're on the same wavelength. |
per our discussion:
contract: all non-final fields must be annotated with @MetamodelPropertyField (checkable with architecture test) todo: remove the |
93d9385
to
40c3ef8
Compare
I updated this PR but I cannot create the contract because of these fields: private CtTypeReference<Void> voidType;
transient Factory factory;
protected CtElement parent;
SourcePosition position = SourcePosition.NOPOSITION;
Map<String, Object> metadata;
private CtMethod<T> valueOfMethod; |
@monperrus Done for me |
|
||
@Test | ||
/** | ||
* contract: all all non-final fields must be annotated with {@link spoon.reflect.annotations.MetamodelPropertyField} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix comment
It should be great to have a test to check if there is a getter/setter in one interface of the class for all field with a MetamodelPopertyRole. |
0b417bb
to
cb915a5
Compare
Done |
cb915a5
to
f25e3b2
Compare
for each field of spoon defines for which interface it is the property
This PR is not finish I would like to have your feedback.