mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
do not look for setter if no annotation is found
This commit is contained in:
+2
-2
@@ -56,8 +56,6 @@ public class ComponentProcessor {
|
|||||||
for (Method method : clazz.getMethods()) {
|
for (Method method : clazz.getMethods()) {
|
||||||
if (method.getName().startsWith("get")) {
|
if (method.getName().startsWith("get")) {
|
||||||
try {
|
try {
|
||||||
Method setter = clazz.getMethod("set" + method.getName().substring(3), method
|
|
||||||
.getReturnType());
|
|
||||||
if (method.isAnnotationPresent(EditableProperty.class)) {
|
if (method.isAnnotationPresent(EditableProperty.class)) {
|
||||||
EditableProperty annotation = method.getAnnotation(EditableProperty.class);
|
EditableProperty annotation = method.getAnnotation(EditableProperty.class);
|
||||||
String name;
|
String name;
|
||||||
@@ -66,6 +64,8 @@ public class ComponentProcessor {
|
|||||||
} else {
|
} else {
|
||||||
name = annotation.name();
|
name = annotation.name();
|
||||||
}
|
}
|
||||||
|
Method setter = clazz.getMethod("set" + method.getName().substring(3), method
|
||||||
|
.getReturnType());
|
||||||
PropertyWrapper property = new PropertyWrapper(name,
|
PropertyWrapper property = new PropertyWrapper(name,
|
||||||
method.getReturnType(), method, setter, annotation.defaultable());
|
method.getReturnType(), method, setter, annotation.defaultable());
|
||||||
properties.add(property);
|
properties.add(property);
|
||||||
|
|||||||
Reference in New Issue
Block a user