private Type getGenericType(PropertyAdapter adapter) { Type genericType = null; if (adapter.getField() != null) { genericType = adapter.getField().getGenericType(); } else if (adapter.getReadMethod() != null) { genericType = adapter.getReadMethod().getGenericReturnType(); } else if (adapter.getWriteMethod() != null) { genericType = adapter.getWriteMethod().getGenericParameterTypes()[0]; } else { throw new RuntimeException("Could not find accessor for property " + adapter.getName()); } return genericType == null ? adapter.getType() : genericType; }
private void implementSetter(PropertyAdapter adapter) { if (adapter.getWriteMethod() != null) { implementSetter(adapter.getWriteMethod()); return; } if (adapter.getField() != null && adapter.isUpdate()) { implementSetter(adapter.getField()); return; } implementNoOpMethod(ConduitMethods.SET, "Expression '%s' for class %s is read-only.", expression, rootType.getName()); }