Package org.springframework.roo.classpath.itd

Examples of org.springframework.roo.classpath.itd.InvocableMemberBodyBuilder.indent()


        bodyBuilder.appendFormalLine("int from = 0;");
        bodyBuilder.appendFormalLine("int to = " + quantity + ";");
        bodyBuilder.appendFormalLine(dataField + " = "
                + findEntriesMethod.getMethodCall() + ";");
        bodyBuilder.appendFormalLine("if (" + dataField + " == null) {");
        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("throw new IllegalStateException(\"Find entries implementation for '"
                        + entity.getSimpleTypeName()
                        + "' illegally returned null\");");
        bodyBuilder.indentRemove();
View Full Code Here


            bodyBuilder.appendFormalLine(ENTITY_MANAGER
                    .getNameIncludingTypeParameters(false,
                            builder.getImportRegistrationResolver())
                    + " em = new " + destination.getSimpleTypeName() + "() {");
            // Handle any abstract methods in this class
            bodyBuilder.indent();
            for (final MethodMetadata method : governorTypeDetails.getMethods()) {
                if (Modifier.isAbstract(method.getModifier())) {
                    final StringBuilder params = new StringBuilder();
                    int i = -1;
                    final List<AnnotatedJavaType> types = method
View Full Code Here

                            + " "
                            + method.getReturnType()
                                    .getNameIncludingTypeParameters() + " "
                            + method.getMethodName().getSymbolName() + "("
                            + params.toString() + ") {");
                    bodyBuilder.indent();
                    bodyBuilder
                            .appendFormalLine("throw new UnsupportedOperationException();");
                    bodyBuilder.indentRemove();
                    bodyBuilder.appendFormalLine("}");
                }
View Full Code Here

      }
      builder.getImportRegistrationResolver().addImport(
          dependentType.getJavaType());
      bodyBuilder.appendFormalLine("if ("
          + countMethod.getMethodCall() + " == 0) {");
      bodyBuilder.indent();

      countMethod.copyAdditionsTo(builder, governorTypeDetails);

      // Adding string array which has the fieldName at position 0 and the
      // path at position 1
View Full Code Here

                        + entity.getSimpleTypeName()
                        + "' illegally returned null\");");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("if (!" + dataField + ".isEmpty()) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("return;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("");
        bodyBuilder.appendFormalLine(dataField + " = new ArrayList<"
View Full Code Here

    final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
    annotations.add(requestMapping);

    final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
    bodyBuilder.appendFormalLine("if (bindingResult.hasErrors()) {");
    bodyBuilder.indent();
    bodyBuilder.appendFormalLine("populateEditForm(uiModel, " + entityName
        + ");");
    bodyBuilder.appendFormalLine("return \"" + controllerPath
        + "/create\";");
    bodyBuilder.indentRemove();
View Full Code Here

        bodyBuilder.appendFormalLine("");
        bodyBuilder.appendFormalLine(dataField + " = new ArrayList<"
                + entity.getSimpleTypeName() + ">();");
        bodyBuilder.appendFormalLine("for (int i = 0; i < " + quantity
                + "; i++) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(entity.getSimpleTypeName() + " " + OBJ_VAR
                + " = "
                + newTransientEntityMethod.getMethodName().getSymbolName()
                + "(i);");
        bodyBuilder.appendFormalLine("try {");
View Full Code Here

        bodyBuilder.appendFormalLine(entity.getSimpleTypeName() + " " + OBJ_VAR
                + " = "
                + newTransientEntityMethod.getMethodName().getSymbolName()
                + "(i);");
        bodyBuilder.appendFormalLine("try {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(persistMethod.getMethodCall() + ";");
        bodyBuilder.indentRemove();
        bodyBuilder
                .appendFormalLine("} catch (final ConstraintViolationException e) {");
        bodyBuilder.indent();
View Full Code Here

        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(persistMethod.getMethodCall() + ";");
        bodyBuilder.indentRemove();
        bodyBuilder
                .appendFormalLine("} catch (final ConstraintViolationException e) {");
        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("final StringBuilder msg = new StringBuilder();");
        bodyBuilder
                .appendFormalLine("for (Iterator<ConstraintViolation<?>> iter = e.getConstraintViolations().iterator(); iter.hasNext();) {");
        bodyBuilder.indent();
View Full Code Here

        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("final StringBuilder msg = new StringBuilder();");
        bodyBuilder
                .appendFormalLine("for (Iterator<ConstraintViolation<?>> iter = e.getConstraintViolations().iterator(); iter.hasNext();) {");
        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("final ConstraintViolation<?> cv = iter.next();");
        bodyBuilder
                .appendFormalLine("msg.append(\"[\").append(cv.getRootBean().getClass().getName()).append(\".\").append(cv.getPropertyPath()).append(\": \").append(cv.getMessage()).append(\" (invalid value = \").append(cv.getInvalidValue()).append(\")\").append(\"]\");");
        bodyBuilder.indentRemove();
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.