WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(comp);
String setName = property.getSetName();
if (adapter != null&&setName!=null) {
StringBuilder builder = new StringBuilder();
Class typeClass = property.getPropertyType();
TypeAdapter typeAdapter = ExtensionRegistry.getTypeAdapter(typeClass);
Object value = property.getFieldValue(bean);
if (typeAdapter != null && typeAdapter.getCodegen() != null) {
String initCode = typeAdapter.getCodegen().getInitJavaCode(value, imports);
if (initCode != null)
builder.append(initCode);
}
if (!adapter.isRoot()) {
String name = adapter.getID();
builder.append(name + ".");
}
builder.append(setName + "(");
if (typeAdapter != null && typeAdapter.getCodegen() != null) {
if (value == null) {
builder.append("null");
} else {
builder.append(typeAdapter.getCodegen().getJavaCode(value, imports));
}
} else {
builder.append(value == null ? "null" : value.toString());
}
builder.append(");\n");