/** * Convert an entity/data to just an entity, * will preserve null (i.e. null in => null out) */ public static Object convertToEntity(Object object) { Object togo = null; if (object != null) { if (EntityData.class.isAssignableFrom(object.getClass())) { EntityData ed = (EntityData)object; if (ed.getData() != null) { togo = ed.getData(); } else { togo = ed; } } else { togo = object; } } return togo; }
if (entityData.getData() != null) { sb.append(" <tr><td>entity-type</td><td>"+entityData.getData().getClass().getName()+"</td></tr>\n"); sb.append( encodeData(entityData.getData(), Formats.HTML, null, null) ); sb.append(" </td></tr>\n"); } else { || entityData.getData() == null) && (EntityView.VIEW_LIST.equals(viewKey) || EntityView.VIEW_SHOW.equals(viewKey)) ) { Object entity = (entityData != null ? entityData.getData() : null); if (entity == null) { if (entityData != null && entityData.getData() != null) { if (entityData.isDataOnly()) { toEncode = entityData.getData(); if (ConstructorUtils.isClassBean(entityData.getData().getClass())) { toEncode = entityData.getData();
if (entityData.getData() != null) { sb.append(" <tr><td>entity-type</td><td>"+entityData.getData().getClass().getName()+"</td></tr>\n"); sb.append( encodeData(entityData.getData(), Formats.HTML, null, null) ); sb.append(" </td></tr>\n"); } else { || entityData.getData() == null) && (EntityView.VIEW_LIST.equals(viewKey) || EntityView.VIEW_SHOW.equals(viewKey)) ) { Object entity = (entityData != null ? entityData.getData() : null); if (entity == null) { if (entityData != null && entityData.getData() != null) { if (entityData.isDataOnly()) { toEncode = entityData.getData(); if (ConstructorUtils.isClassBean(entityData.getData().getClass())) { toEncode = entityData.getData();
Object entity = entityData.getData();
Object entity = entityData.getData();