Ejemplo n.º 1
0
 @SuppressWarnings("unchecked")
 protected List<ValueSpecificationImpl<ClassInstance, ClassInstance, Object>> getList(
     ClassInstance<ClassInstance, ClassInstance, Object> instance, String property) {
   try {
     BootstrapSemantics semantics = createBootstrapSemantics(instance.getClassifier());
     StructureSlot slot = instance.get(semantics.getProperty(property));
     if (slot == null) {
       return new Vector();
     } else {
       return slot.getValues(null);
     }
   } catch (Exception e) {
     return new Vector<ValueSpecificationImpl<ClassInstance, ClassInstance, Object>>();
   }
 }
Ejemplo n.º 2
0
 @SuppressWarnings("unchecked")
 protected Object get(
     ClassInstance<ClassInstance, ClassInstance, Object> instance, String property) {
   BootstrapSemantics semantics = createBootstrapSemantics(instance.getClassifier());
   StructureSlot<ClassInstance, ClassInstance, Object> slot =
       instance.get(semantics.getProperty(property));
   if (slot == null) {
     return null;
   }
   ValueSpecificationImpl<ClassInstance, ClassInstance, Object> value =
       slot.getValues(null).get(0);
   if (value.asDataValue() == null) {
     return value.asInstanceValue().getInstance();
   } else {
     return value.asDataValue().getValue();
   }
 }