Пример #1
0
  protected IVariable[] getFields() throws DebugException {
    List<FeatureFieldDescription> features = getFieldDescriptors();
    if (features.size() == 0) {
      return null;
    }

    IVariable[] variables = new IVariable[features.size()];
    MitraStackFrame stackFrame = variable.getStackFrame();
    MetamodelManager manager = ((MitraDebugTarget) getDebugTarget()).getMetamodelManager();
    PseudoFeatureAccessPath<MObject> path;
    Type actualType = interpreterValue.getActualType();
    for (int i = 0; i < variables.length; i++) {

      FeatureFieldDescription featureDescription = features.get(i);

      path = new PseudoFeatureAccessPath<MObject>(actualType);
      path.add(new FeaturePathItem<MObject>(null, featureDescription));

      String strName = featureDescription.getName();

      MObject value = manager.getFeature(interpreterValue, path);
      MitraVariable mitraVariable = new MitraVariable(stackFrame, strName);
      MitraValue mitraValue =
          new MitraValue((MitraDebugTarget) getDebugTarget(), mitraVariable, value);
      mitraVariable.setValue(mitraValue);

      variables[i] = mitraVariable;
    }
    return variables;
  }
Пример #2
0
  protected List<FeatureFieldDescription> getFieldDescriptors() {
    if (interpreterValue == null || interpreterValue.getValue() == null) {
      return Collections.emptyList();
    }

    MetamodelManager manager = ((MitraDebugTarget) getDebugTarget()).getMetamodelManager();

    IMetamodel metamodel = manager.getMetamodel(interpreterValue.getActualType());
    return metamodel.getAllFeatureFieldsDescriptions(interpreterValue.getActualType(), true, false);
  }