public String getDefinedPropertyReference(OclAny source, DefinedProperty p) {
    OclAnyImpl src = (OclAnyImpl) source;
    String clsName = p.getDefinition().getContext().getReferredNamespace().getName();
    String pName = p.getName();

    Classifier t = p.getType();
    Class c = (Class) t.getDelegate();

    String argStr = "new Object[]{" + source + "}";

    String s = "((" + c.getName() + ")def(\"" + pName + "\", " + argStr + "))";
    return s;
  }
  public String getDefinedOperationReference(OclAny source, DefinedOperation op, List arguments) {
    OclAnyImpl src = (OclAnyImpl) source;
    String clsName = op.getDefinition().getContext().getReferredNamespace().getName();
    String pName = op.getName();

    Classifier t = op.getReturnType();
    Class c = (Class) t.getDelegate();

    String argStr = "new Object[]{" + source;
    Iterator i = arguments.iterator();
    while (i.hasNext()) {
      argStr += ", ";
      argStr += i.next();
    }
    argStr += "}";

    String s = "((" + c.getName() + ")def(\"" + pName + "\", " + argStr + "))";
    return s;
  }
 public Class getImplClass(Classifier cls) {
   EClass ecls = (EClass) cls.getDelegate();
   return ecls.getInstanceClass();
 }