Examples of MethodBody


Examples of com.strobel.assembler.metadata.MethodBody

        VerifyArgument.notNull(output, "output");
        VerifyArgument.notNull(options, "options");

        writeMethodHeader(method, output);

        final MethodBody body = method.getBody();

        if (body == null) {
            output.writeDelimiter(";");
            output.writeLine();
            return;
View Full Code Here

Examples of com.strobel.assembler.metadata.MethodBody

    @SuppressWarnings("ConstantConditions")
    private List<Node> findConditions(final Set<ControlFlowNode> scopeNodes, final ControlFlowNode entryNode) {
        final List<Node> result = new ArrayList<>();
        final Set<ControlFlowNode> scope = new HashSet<>(scopeNodes);
        final Stack<ControlFlowNode> agenda = new Stack<>();
        final MethodBody methodBody = _context.getCurrentMethod().getBody();
        final InstructionCollection instructions = methodBody.getInstructions();

        agenda.push(entryNode);

        while (!agenda.isEmpty()) {
            final ControlFlowNode node = agenda.pop();
View Full Code Here

Examples of com.strobel.assembler.metadata.MethodBody

        VerifyArgument.notNull(output, "output");
        VerifyArgument.notNull(options, "options");

        writeMethodHeader(method, output);

        final MethodBody body = method.getBody();

        if (body == null) {
            output.writeDelimiter(";");
            output.writeLine();
            return;
View Full Code Here

Examples of org.ajax4jsf.builder.model.MethodBody

   
    javaClass.addAnnotation(Deprecated.class);
   
    JavaMethod accessor = new JavaMethod("getCount", int.class);
    accessor.setMethodBody(
        new MethodBody(accessor) {
          @Override
          public String toCode() {
            return "return count;";
          }
        }
      );
    accessor.getModifiers().add(JavaModifier.PUBLIC);
    accessor.getModifiers().add(JavaModifier.FINAL);
    javaClass.addMethod(accessor);
   
    JavaMethod mutator = new JavaMethod("setCount",
        new Argument("i", int.class));
    mutator.setMethodBody(
        new MethodBody(mutator) {
          @Override
          public String toCode() {
            return "count = i;";
          }
        }
View Full Code Here

Examples of org.ajax4jsf.builder.model.MethodBody

  }
 
  private JavaMethod getComponentFamilyMethod(ComponentBean componentBean) {
    JavaMethod javaMethod = new JavaMethod("getFamily", String.class);
    javaMethod.addModifier(JavaModifier.PUBLIC);
    javaMethod.setMethodBody(new MethodBody() {
      @Override
      public String toCode() {
        return "return COMPONENT_FAMILY;";
      }
    });
View Full Code Here

Examples of org.ajax4jsf.builder.model.MethodBody

      new JavaMethod("saveState",
          Object.class,
          arg("context", FacesContext.class));
    method.addModifier(JavaModifier.PUBLIC);
    method.addAnnotation(Override.class);
    method.setMethodBody(new MethodBody() {
      @Override
      public String toCode() {
        return "return super.saveState(context);";
      }
    });
View Full Code Here

Examples of org.ajax4jsf.builder.model.MethodBody

 
  private JavaMethod getConstructor(ComponentBean componentBean, JavaClass javaClass) {
    final RendererBean renderer = componentBean.getRenderer();
    JavaMethod method = new JavaConstructor(javaClass);
    method.addModifier(JavaModifier.PUBLIC);
    method.setMethodBody(new MethodBody(method) {
      @Override
      public String toCode() {
        if (renderer != null) {
          return "setRendererType(\"" + renderer.getName() + "\");";
        }
View Full Code Here

Examples of org.ajax4jsf.builder.model.MethodBody

    field2.addModifier(JavaModifier.PRIVATE);
    if (propertyBean.isTransient()) {
        field2.addModifier(JavaModifier.TRANSIENT);
    }
    JavaMethod accessor = getAccessor(configuration, propertyBean, field);
    MethodBody accessorMethodBody;
   
    try {
      if (propertyBean.isEl()) {
        accessorMethodBody = new PrimitiveELPropertyAccessorMethodBody(configuration, field, field2, propertyBean);
      } else {
View Full Code Here

Examples of org.ajax4jsf.builder.model.MethodBody

        new ELPropertyAccessorMethodBody(config, propertyBean, field);
     
      accessor.setMethodBody(propertyAccessorMethodBody);
     
    } catch (GeneratorException e) {
      accessor.setMethodBody(new MethodBody());
      e.printStackTrace();
    }
   
    return accessor;
  }
View Full Code Here

Examples of org.ajax4jsf.builder.model.MethodBody

 
  protected JavaMethod getAccessor(JSFGeneratorConfiguration configuration, PropertyBean propertyBean, final JavaField field) {
    JavaMethod accessor =
      new JavaMethod(propertyBean.getGetterName(), field.getType());
   
    accessor.setMethodBody(new MethodBody() {
      @Override
      public String toCode() {
        return "return " + field.getName() + ";";
      }
    });
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.