Examples of StringStatement


Examples of dk.brics.string.intermediate.StringStatement

        }
        tostring_map = new HashMap<SootClass, MLFAStatePair>();
        Map<SootClass, StringStatement> tostring_hotspot_map = jt.getToStringHotspotMap();
        for (Map.Entry<SootClass, StringStatement> tse : tostring_hotspot_map.entrySet()) {
            SootClass tsc = tse.getKey();
            StringStatement ss = tse.getValue();
            Node n = m3.get(m2.get(ss));
            if (n != null) {
                Nonterminal nt = f2g.getNonterminal(n);
                MLFAStatePair sp = gm.getMLFAStatePair(nt);
                tostring_map.put(tsc, sp);
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

      if (containingClass != null && !generatedClassVariables.contains(attrVarName)) {
        generatedClassVariables.add(attrVarName);
        containingClass.privateField(attrVarName, ErraiAttribute.class)
          .modifiers(Modifier.Final)
          .initializesWith(
                  Stmt.nestedCall(new StringStatement("entityManager.getMetamodel()", MetaClassFactory.get(ErraiMetamodel.class)))
                  .invoke("entity", Stmt.loadLiteral(lhsType))
                  .invoke("getAttribute", dotNode.getPropertyPath()))
          .finish();
      }

      // XXX need a StringStatement here because codegen can't see fields of anonymous inner classes. (ERRAI-363)
      return Stmt.nestedCall(new StringStatement(attrVarName, MetaClassFactory.get(ErraiAttribute.class)))
              .invoke("get", Stmt.loadVariable(variableName));
    }
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

      }

      // XXX using StringStatement because this gives OutOfScopeException for metamodel:
      // pmm.append(Stmt.loadClassMember("metamodel").invoke("addEntityType",
      // Variable.get(entityTypeVarName)));
      cmm.append(new StringStatement("metamodel.addEntityType(" + entityTypeVarName + ")"));
    }

    // XXX using StringStatement because this gives OutOfScopeException for metamodel:
    // pmm.append(Stmt.loadClassMember("metamodel").invoke("freeze"));
    cmm.append(new StringStatement("metamodel.freeze()"));

    cmm.append(Stmt.loadVariable("metamodel").returnValue());
    cmm.finish();
  }
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

            .initializesWith(Stmt.newObject(generatorType).withParameters(Variable.get("this")))
            .finish();

        // StringStatement is a workaround: codegen says valueGenerator is out of scope when we do
        // this properly
        return new StringStatement("return valueGenerator");

      }
      else {
        return Stmt.throw_(UnsupportedOperationException.class, "Not a generated attribute");
      }
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

        pmm.append(Stmt.loadVariable(entityTypeVarName).invoke("addAttribute", attribSnapshot));
      }

      // XXX using StringStatement because this gives OutOfScopeException for metamodel:
      // pmm.append(Stmt.loadClassMember("metamodel").invoke("addEntityType", Variable.get(entityTypeVarName)));
      pmm.append(new StringStatement("metamodel.addEntityType(" + entityTypeVarName + ")"));
    }

    // XXX using StringStatement because this gives OutOfScopeException for metamodel:
    // pmm.append(Stmt.loadClassMember("metamodel").invoke("freeze"));
    pmm.append(new StringStatement("metamodel.freeze()"));

    pmm.finish();
  }
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

        .initializesWith(Stmt.newObject(generatorType)
                .withParameters(Stmt.loadStatic(classBuilder.getClassDefinition(), "this"), Variable.get("this")))
                .finish();

        // StringStatement is a workaround: codegen says valueGenerator is out of scope when we do this properly
        return new StringStatement("return valueGenerator");

      } else {
        return Stmt.throw_(UnsupportedOperationException.class, "Not a generated attribute");
      }
    }
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

        .initializesWith(Stmt.newObject(generatorType)
                .withParameters(Stmt.loadStatic(classBuilder.getClassDefinition(), "this"), Variable.get("this")))
                .finish();

        // StringStatement is a workaround: codegen says valueGenerator is out of scope when we do this properly
        return new StringStatement("return valueGenerator");

      } else {
        return Stmt.throw_(UnsupportedOperationException.class, "Not a generated attribute");
      }
    }
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

      if (containingClass != null && !generatedClassVariables.contains(attrVarName)) {
        generatedClassVariables.add(attrVarName);
        containingClass.privateField(attrVarName, ErraiAttribute.class)
          .modifiers(Modifier.Final)
          .initializesWith(
                  Stmt.nestedCall(new StringStatement("getMetamodel()", MetaClassFactory.get(ErraiMetamodel.class)))
                  .invoke("entity", Stmt.loadLiteral(lhsType))
                  .invoke("getAttribute", dotNode.getPropertyPath()))
          .finish();
      }

      // XXX need a StringStatement here because codegen can't see fields of anonymous inner classes. (ERRAI-363)
      return Stmt.nestedCall(new StringStatement(attrVarName, MetaClassFactory.get(ErraiAttribute.class)))
              .invoke("get", Stmt.loadVariable(variableName));
    }
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

        pmm.append(Stmt.loadVariable(entityTypeVarName).invoke("addAttribute", attribSnapshot));
      }

      // XXX using StringStatement because this gives OutOfScopeException for metamodel:
      // pmm.append(Stmt.loadClassMember("metamodel").invoke("addEntityType", Variable.get(entityTypeVarName)));
      pmm.append(new StringStatement("metamodel.addEntityType(" + entityTypeVarName + ")"));
    }

    // XXX using StringStatement because this gives OutOfScopeException for metamodel:
    // pmm.append(Stmt.loadClassMember("metamodel").invoke("freeze"));
    pmm.append(new StringStatement("metamodel.freeze()"));

    pmm.finish();
  }
View Full Code Here

Examples of org.jboss.errai.codegen.StringStatement

      finalParms[i] = Parameter.of(parms[i].getType().getErased(), parms[i].getName(), true);
      parmVars.add(Stmt.loadVariable(parms[i].getName()));
    }

    Statement parameters = (intercepted) ?
        new StringStatement("getParameters()", MetaClassFactory.get(Object[].class)) :
          Stmt.newArray(Object.class).initialize(parmVars.toArray());

    BlockBuilder<?> methodBlock =
        classBuilder.publicMethod(method.getReturnType().getErased(), method.getName(), finalParms);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.