public MetaPropertyInfo(MetaProperty metaProperty) { Messages messages = AppBeans.get(Messages.class); Metadata metadata = AppBeans.get(Metadata.class); this.name = metaProperty.getName(); this.attributeType = metaProperty.getType(); switch (attributeType) { case DATATYPE: Datatype<Object> datatype = metaProperty.getRange().asDatatype(); try { this.type = metadata.getDatatypes().getId(datatype); } catch (Exception e) { this.type = datatype.toString(); } break; case ASSOCIATION: case COMPOSITION: this.type = metaProperty.getRange().asClass().getName(); break; case ENUM: this.type = metaProperty.getRange().asEnumeration().getJavaClass().getName(); break; } this.cardinality = metaProperty.getRange().getCardinality(); this.readOnly = metaProperty.isReadOnly(); this.mandatory = metaProperty.isMandatory(); this.isPersistent = metadata.getTools().isPersistent(metaProperty); this.isTransient = metadata.getTools().isNotPersistent(metaProperty); this.description = messages.getTools().getPropertyCaption(metaProperty); }