break;
}
}
JField f = type.findField( name );
// is getter annotated, if yes use this annotation for the field
JsonProperty propName = null;
if ( entry.getValue().isAnnotationPresent(JsonProperty.class) ) {
propName = getAnnotation(entry.getValue(), JsonProperty.class);
}
// is setter annotated, if yes use this annotation for the field
JMethod m = type.findMethod("s" + entry.getValue().getName().substring(1),
new JType[]{ entry.getValue().getReturnType() });
if ( m != null && m.isAnnotationPresent(JsonProperty.class) ) {
propName = getAnnotation(m, JsonProperty.class);
}
// if have a field and an annotation from the getter/setter then use that annotation
if ( propName != null && found && !f.getName().equals(propName.value())) {
allFields.remove(f);
DummyJField dummy = new DummyJField( name, entry.getValue().getReturnType() );
dummy.setAnnotation( propName );
allFields.add(dummy);
}