}
}
private String mapToAsterisk(Method getter)
{
AsteriskMapping annotation;
// check annotation of getter method
annotation = getter.getAnnotation(AsteriskMapping.class);
if (annotation != null)
{
return annotation.value();
}
// check annotation of setter method
String setterName = determineSetterName(getter.getName());
try
{
Method setter = getter.getDeclaringClass().getDeclaredMethod(setterName, getter.getReturnType());
annotation = setter.getAnnotation(AsteriskMapping.class);
if (annotation != null)
{
return annotation.value();
}
}
catch (NoSuchMethodException e)
{
// ok, no setter method
}
// check annotation of field
String fieldName = determineFieldName(getter.getName());
try
{
Field field = getter.getDeclaringClass().getDeclaredField(fieldName);
annotation = field.getAnnotation(AsteriskMapping.class);
if (annotation != null)
{
return annotation.value();
}
}
catch (NoSuchFieldException e)
{
// ok, no field