Skip to content

Instantly share code, notes, and snippets.

@emmanuelbernard
Created November 20, 2015 15:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save emmanuelbernard/36d401e663d41a9570f6 to your computer and use it in GitHub Desktop.
rawFields <- xClass.getDeclaredProperty("field");
rawProperties <- xClass.getDeclaredProperty("property");
// handle explicit ones first
for (Xmember m in rawFields) {
if(m.getAnnotations(AccessType.class).getType() == FIELD)) {
field.add(m);
rawFields.remove(m);
}
if(m.getAnnotations(AccessType.class).getType() == PROPERTY)) {
property.add(m);
rawFields.remove(m);
}
}
for (Xmember m in rawProperties) {
// explicit
if(m.getAnnotations(AccessType.class).getType() == FIELD)) {
field.add(m);
rawProperties.remove(m);
}
if(m.getAnnotations(AccessType.class).getType() == PROPERTY)) {
property.add(m);
rawProperties.remove(m);
}
}
// handle remaining ones based on entity access type
// explicit ones are filtered by the previous process
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment