private FieldProperty property;
public String getJavaCode(Object bean, ImportRewrite imports) {
if (bean instanceof Component) {
Component comp = (Component) bean;
WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(comp);
if (adapter != 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(property.getFieldName() + "=");
if (typeAdapter != null && typeAdapter.getCodegen() != null) {
if (value == null) {