Package org.springframework.roo.classpath.itd

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


    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
        + "/update\";");
    bodyBuilder.indentRemove();
View Full Code Here


        // Create method
        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder.appendFormalLine("init();");
        bodyBuilder.appendFormalLine("if (" + INDEX_VAR + " < 0) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(INDEX_VAR + " = 0;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("if (" + INDEX_VAR + " > ("
                + getDataFieldName().getSymbolName() + ".size() - 1)) {");
View Full Code Here

        bodyBuilder.appendFormalLine(INDEX_VAR + " = 0;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("if (" + INDEX_VAR + " > ("
                + getDataFieldName().getSymbolName() + ".size() - 1)) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(INDEX_VAR + " = "
                + getDataFieldName().getSymbolName() + ".size() - 1;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine(entity.getSimpleTypeName() + " " + OBJ_VAR
View Full Code Here

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

        bodyBuilder.appendFormalLine("if (page != null || size != null) {");
        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("int sizeNo = size == null ? 10 : size.intValue();");
        bodyBuilder
                .appendFormalLine("final int firstResult = page == null ? 0 : (page.intValue() - 1) * sizeNo;");
        String methodParamsString = methodParams.toString();
View Full Code Here

                + methodParamsString + ") / sizeNo;");
        bodyBuilder
                .appendFormalLine("uiModel.addAttribute(\"maxPages\", (int) ((nrOfPages > (int) nrOfPages || nrOfPages == 0.0) ? nrOfPages + 1 : nrOfPages));");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("} else {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("uiModel.addAttribute(\""
                + javaTypeMetadataHolder.getPlural().toLowerCase()
                + "\", "
                + getShortName(formBackingType)
                + "."
View Full Code Here

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        if (fieldType.equals(BIG_DECIMAL)) {
            bodyBuilder.appendFormalLine("if (" + fieldName + ".compareTo(new "
                    + BIG_DECIMAL.getSimpleTypeName() + "(\"" + maxValue
                    + "\")) == 1) {");
            bodyBuilder.indent();
            bodyBuilder.appendFormalLine(fieldName + " = new "
                    + BIG_DECIMAL.getSimpleTypeName() + "(\"" + maxValue
                    + "\");");
        }
        else {
View Full Code Here

                    + "\");");
        }
        else {
            bodyBuilder.appendFormalLine("if (" + fieldName + " > "
                    + maxValue.doubleValue() + suffix + ") {");
            bodyBuilder.indent();
            bodyBuilder.appendFormalLine(fieldName + " = "
                    + maxValue.doubleValue() + suffix + ";");
        }

        bodyBuilder.indentRemove();
View Full Code Here

        idType, targetType);

    final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
    bodyBuilder.appendFormalLine("return new "
        + converterJavaType.getNameIncludingTypeParameters() + "() {");
    bodyBuilder.indent();
    bodyBuilder.appendFormalLine("public "
        + targetType.getFullyQualifiedTypeName() + " convert(" + idType
        + " id) {");
    bodyBuilder.indent();
    bodyBuilder.appendFormalLine("return " + findMethod.getMethodCall()
View Full Code Here

        + converterJavaType.getNameIncludingTypeParameters() + "() {");
    bodyBuilder.indent();
    bodyBuilder.appendFormalLine("public "
        + targetType.getFullyQualifiedTypeName() + " convert(" + idType
        + " id) {");
    bodyBuilder.indent();
    bodyBuilder.appendFormalLine("return " + findMethod.getMethodCall()
        + ";");
    bodyBuilder.indentRemove();
    bodyBuilder.appendFormalLine("}");
    bodyBuilder.indentRemove();
View Full Code Here

      final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
      bodyBuilder.appendFormalLine("return new "
          + converterJavaType.getNameIncludingTypeParameters()
          + "() {");
      bodyBuilder.indent();
      bodyBuilder.appendFormalLine("public String convert("
          + embeddableType.getSimpleTypeName() + " " + targetTypeName
          + ") {");
      bodyBuilder.indent();
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.