Package org.springframework.roo.classpath.details

Examples of org.springframework.roo.classpath.details.MethodMetadataBuilder


                        + entityName
                        + " o\", "
                        + destination.getSimpleTypeName()
                        + ".class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList();");

        final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
                getId(), Modifier.PUBLIC | Modifier.STATIC, methodName,
                returnType,
                AnnotatedJavaType.convertFromJavaTypes(parameterTypes),
                parameterNames, bodyBuilder);
        methodBuilder.setAnnotations(annotations);
        return methodBuilder.build();
    }
View Full Code Here


        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("return " + ENTITY_MANAGER_METHOD_NAME
            + "().createQuery(jpaQuery, " + destination.getSimpleTypeName() + ".class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList();");

        final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
                getId(), Modifier.PUBLIC | Modifier.STATIC, methodName,
                returnType,
                AnnotatedJavaType.convertFromJavaTypes(parameterTypes),
                parameterNames, bodyBuilder);
        methodBuilder.setAnnotations(annotations);
        return methodBuilder.build();
    }
View Full Code Here

    /**
     * @return the flush method (never returns null)
     */
    private MethodMetadataBuilder getFlushMethod() {
        if (parent != null) {
            final MethodMetadataBuilder found = parent.getFlushMethod();
            if (found != null) {
                return found;
            }
        }
        if ("".equals(crudAnnotationValues.getFlushMethod())) {
View Full Code Here

    /**
     * @return the persist method (may return null)
     */
    private MethodMetadataBuilder getPersistMethod() {
        if (parent != null) {
            final MethodMetadataBuilder found = parent.getPersistMethod();
            if (found != null) {
                return found;
            }
        }
        if ("".equals(crudAnnotationValues.getPersistMethod())) {
View Full Code Here

        // Create some method content to get people started
        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder
                .appendFormalLine("System.out.println(\"JMS message received: \" + message);");
        methods.add(new MethodMetadataBuilder(declaredByMetadataId, PUBLIC,
                new JavaSymbolName("onMessage"), JavaType.VOID_PRIMITIVE,
                AnnotatedJavaType.convertFromJavaTypes(parameterTypes),
                parameterNames, bodyBuilder));

        final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
View Full Code Here

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder.appendFormalLine(fieldName
                + ".convertAndSend(messageObject);");

        final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
                declaredByMetadataId, PUBLIC,
                new JavaSymbolName("sendMessage"), JavaType.VOID_PRIMITIVE,
                AnnotatedJavaType.convertFromJavaTypes(parameterTypes),
                parameterNames, bodyBuilder);
        if (asynchronous) {
            methodBuilder.addAnnotation(new AnnotationMetadataBuilder(ASYNC));
        }
        return methodBuilder;
    }
View Full Code Here

    /**
     * @return the remove method (may return null)
     */
    private MethodMetadataBuilder getRemoveMethod() {
        if (parent != null) {
            final MethodMetadataBuilder found = parent.getRemoveMethod();
            if (found != null) {
                return found;
            }
        }
        if ("".equals(crudAnnotationValues.getRemoveMethod())) {
View Full Code Here

        bodyBuilder
                .appendFormalLine("if (em == null) throw new IllegalStateException(\"Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)\");");
        bodyBuilder.appendFormalLine("return em;");
        final int modifier = Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL;

        final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
                getId(), modifier, methodName, returnType,
                AnnotatedJavaType.convertFromJavaTypes(parameterTypes),
                new ArrayList<JavaSymbolName>(), bodyBuilder);
        builder.addMethod(methodBuilder);
        entityManagerMethod = methodBuilder.build();
    }
View Full Code Here

        bodyBuilder.appendFormalLine("return " + ENTITY_MANAGER_METHOD_NAME
                + "().find(" + returnType.getSimpleTypeName() + ".class, "
                + idFieldName + ");");

        final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
                getId(), Modifier.PUBLIC | Modifier.STATIC, methodName,
                returnType,
                AnnotatedJavaType.convertFromJavaTypes(parameterType),
                parameterNames, bodyBuilder);
        methodBuilder.setAnnotations(annotations);
        builder.addMethod(methodBuilder);
        findMethod = methodBuilder.build();
    }
View Full Code Here

          .appendFormalLine("uiModel.addAttribute(\"dependencies\", dependencies);");
    }
    bodyBuilder.appendFormalLine("return \"" + controllerPath
        + "/create\";");

    final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
        getId(), Modifier.PUBLIC, methodName, STRING,
        AnnotatedJavaType.convertFromJavaTypes(parameterTypes),
        parameterNames, bodyBuilder);
    methodBuilder.setAnnotations(annotations);
    return methodBuilder;
  }
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.details.MethodMetadataBuilder

Copyright © 2018 www.massapicom. 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.