Examples of publicMethod()


Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

                  .finish()
          )
          .finish();

      // implements equals()
      builder.publicMethod(boolean.class, "equals", Parameter.of(Object.class, "o"))
          .annotatedWith(OVERRIDE_ANNOTATION)
          .body()
          ._(
              If.isNull(loadVariable(proxyVar))
                  ._(throw_(IllegalStateException.class, "call to equals() on an unclosed proxy."))
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

                  .finish()
          )
          .finish();
    }
   
    builder.publicMethod(void.class, PROXY_BIND_METHOD).parameters(DefParameters.of(Parameter.of(toProxy, "proxy")))
        ._(loadVariable(proxyVar).assignValue(loadVariable("proxy")))
        // Set proxy state to initialized
        ._(loadVariable(stateVar).assignValue(true))
        .finish();
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

          method.isStatic() ||
          method.getDeclaringClass().getFullyQualifiedName().equals("java.lang.Object"))
        continue;

      DefParameters defParameters = DefParameters.from(method);
      BlockBuilder methBody = builder.publicMethod(method.getReturnType(), method.getName())
            .parameters(defParameters)
            .throws_(method.getCheckedExceptions());

      List<Parameter> parms = defParameters.getParameters();
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

      }
      methBody.finish();
    }

    // implement hashCode()
    builder.publicMethod(int.class, "hashCode").body()
            ._(
                    if_(isNull(loadVariable(proxyVar)))
                            ._(throw_(IllegalStateException.class, "call to hashCode() on an unclosed proxy."))
                            .finish()
                            .else_()
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

                            .finish()
            )
            .finish();

    // implements equals()
    builder.publicMethod(boolean.class, "equals", Parameter.of(Object.class, "o")).body()
            ._(
                    if_(isNull(loadVariable(proxyVar)))
                            ._(throw_(IllegalStateException.class, "call to equal() on an unclosed proxy."))
                            .finish()
                            .else_()
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

                            .finish()
            )
            .finish();


    builder.publicMethod(void.class, PROXY_BIND_METHOD).parameters(DefParameters.of(Parameter.of(toProxy, "proxy")))
            ._(loadVariable(proxyVar).assignValue(loadVariable("proxy"))).finish();

    return builder.getClassDefinition();
  }
}
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

      for (int i = 0; i < parameters.length; i++) {
        methodParms.add(Parameter.of(parameters[i].getType().getErased(), "a" + i));
      }

      final DefParameters defParameters = DefParameters.fromParameters(methodParms);
      final BlockBuilder methBody = builder.publicMethod(method.getReturnType(), method.getName())
          .annotatedWith(OVERRIDE_ANNOTATION)
          .parameters(defParameters)
          .throws_(method.getCheckedExceptions());

      methBody.appendAll(getAroundInvokeStatements(method));
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

      methBody.finish();
    }

    if (renderEqualsAndHash) {
      // implement hashCode()
      builder.publicMethod(int.class, "hashCode")
          .annotatedWith(OVERRIDE_ANNOTATION)
          .body()
          ._(
              If.isNull(loadVariable(proxyVar))
                  ._(throw_(IllegalStateException.class, "call to hashCode() on an unclosed proxy."))
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

                  .finish()
          )
          .finish();

      // implements equals()
      builder.publicMethod(boolean.class, "equals", Parameter.of(Object.class, "o"))
          .annotatedWith(OVERRIDE_ANNOTATION)
          .body()
          ._(
              If.isNull(loadVariable(proxyVar))
                  ._(throw_(IllegalStateException.class, "call to equals() on an unclosed proxy."))
View Full Code Here

Examples of org.jboss.errai.codegen.builder.ClassStructureBuilder.publicMethod()

                  .finish()
          )
          .finish();
    }

    builder.publicMethod(void.class, PROXY_BIND_METHOD).parameters(DefParameters.of(Parameter.of(toProxy, "proxy")))
        ._(loadVariable(proxyVar).assignValue(loadVariable("proxy"))).finish();

    return builder.getClassDefinition();
  }
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.