Examples of publicMethod()


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

  private Statement generateComparatorFor(final MetaClass MC_annotationClass, final Collection<MetaMethod> methods) {
    final MetaClass MC_annoComparator = parameterizedAs(AnnotationComparator.class, typeParametersOf(MC_annotationClass));

    final AnonymousClassStructureBuilder clsBuilder = ObjectBuilder.newInstanceOf(MC_annoComparator).extend();
    final MethodBlockBuilder<AnonymousClassStructureBuilder> isEqualBuilder = clsBuilder
        .publicMethod(boolean.class, "isEqual",
            Parameter.of(MC_annotationClass, "a1"), Parameter.of(MC_annotationClass, "a2"))
        .annotatedWith(new Override() {
          @Override
          public Class<? extends Annotation> annotationType() {
View Full Code Here

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

    AnonymousClassStructureBuilder entityTypeSubclass =
        Stmt.newObject(MetaClassFactory.get(ErraiEntityType.class, new ParameterizedEntityType(et.getJavaType())))
            .extend();

    entityTypeSubclass.publicMethod(et.getJavaType(), "newInstance")
        .append(Stmt.nestedCall(Stmt.newObject(et.getJavaType())).returnValue())
        .finish();

    generateLifecycleEventDeliveryMethods(met, entityTypeSubclass, globalListeners);
View Full Code Here

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

   */
  private ObjectBuilder generateNewInstanceOfPageImpl(MetaClass pageClass, String pageName) {
    AnonymousClassStructureBuilder pageImplBuilder = ObjectBuilder.newInstanceOf(
            MetaClassFactory.parameterizedAs(PageNode.class, MetaClassFactory.typeParametersOf(pageClass))).extend();

    pageImplBuilder
        .publicMethod(String.class, "name")
            .append(Stmt.loadLiteral(pageName).returnValue()).finish()
        .publicMethod(Class.class, "contentType")
            .append(Stmt.loadLiteral(pageClass).returnValue()).finish()
        .publicMethod(void.class, "produceContent", Parameter.of(CreationalCallback.class, "callback"))
View Full Code Here

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

   */
  private ObjectBuilder generateNewInstanceOfPageImpl(MetaClass pageClass, String pageName) {
    AnonymousClassStructureBuilder pageImplBuilder = ObjectBuilder.newInstanceOf(
            MetaClassFactory.parameterizedAs(PageNode.class, MetaClassFactory.typeParametersOf(pageClass))).extend();

    pageImplBuilder
        .publicMethod(String.class, "name")
            .append(Stmt.loadLiteral(pageName).returnValue()).finish()
        .publicMethod(Class.class, "contentType")
            .append(Stmt.loadLiteral(pageClass).returnValue()).finish()
        .publicMethod(pageClass, "content")
View Full Code Here

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

                .newObject(parameterizedAs(Marshaller.class, typeParametersOf(toMap))).extend();

        final MetaClass arrayType = toMap.asArrayOf(1);
        classStructureBuilder.privateField("EMPTY_ARRAY", arrayType).initializesWith(Stmt.newArray(toMap, 0)).finish();

        classStructureBuilder.publicMethod(arrayType, "getEmptyArray")
            .append(Stmt.loadClassMember("EMPTY_ARRAY").returnValue())
            .finish();

        classStructureBuilder.publicOverridesMethod("getTypeHandled")
            .append(Stmt.load(toMap).returnValue())
View Full Code Here

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

    AnonymousClassStructureBuilder entityTypeSubclass =
            Stmt.newObject(MetaClassFactory.get(ErraiEntityType.class, new ParameterizedEntityType(et.getJavaType())))
            .extend();

    entityTypeSubclass.publicMethod(et.getJavaType(), "newInstance")
    .append(Stmt.nestedCall(Stmt.newObject(et.getJavaType())).returnValue())
    .finish();

    generateLifecycleEventDeliveryMethods(met, entityTypeSubclass);
View Full Code Here

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

   */
  private ObjectBuilder generateNewInstanceOfPageImpl(MetaClass pageClass, String pageName) {
    AnonymousClassStructureBuilder pageImplBuilder = ObjectBuilder.newInstanceOf(
            MetaClassFactory.parameterizedAs(PageNode.class, MetaClassFactory.typeParametersOf(pageClass))).extend();

    pageImplBuilder
        .publicMethod(String.class, "name")
            .append(Stmt.loadLiteral(pageName).returnValue()).finish()
        .publicMethod(Class.class, "contentType")
            .append(Stmt.loadLiteral(pageClass).returnValue()).finish()
        .publicMethod(void.class, "produceContent", Parameter.of(CreationalCallback.class, "callback"))
View Full Code Here

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

   */
  private ObjectBuilder generateNewInstanceOfPageImpl(MetaClass pageClass, String pageName) {
    AnonymousClassStructureBuilder pageImplBuilder = ObjectBuilder.newInstanceOf(
            MetaClassFactory.parameterizedAs(PageNode.class, MetaClassFactory.typeParametersOf(pageClass))).extend();

    pageImplBuilder
        .publicMethod(String.class, "name")
            .append(Stmt.loadLiteral(pageName).returnValue()).finish()
        .publicMethod(Class.class, "contentType")
            .append(Stmt.loadLiteral(pageClass).returnValue()).finish()
        .publicMethod(void.class, "produceContent", Parameter.of(CreationalCallback.class, "callback"))
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());
     
      // Put method body into conditional, executed only after initialization
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
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.