Package org.springframework.roo.classpath.itd

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


            bodyBuilder.appendFormalLine("}");
            bodyBuilder.appendFormalLine("return " + fieldName + ";");
            break;
        case EDIT:
            bodyBuilder.appendFormalLine("if (" + fieldName + " == null) {");
            bodyBuilder.indent();
            bodyBuilder.appendFormalLine(fieldName + " = populateEditPanel();");
            bodyBuilder.indentRemove();
            bodyBuilder.appendFormalLine("}");
            bodyBuilder.appendFormalLine("return " + fieldName + ";");
            break;
View Full Code Here


        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder.appendFormalLine("String message = \"\";");
        bodyBuilder.appendFormalLine("if (" + entityName.getSymbolName() + "."
                + identifierAccessor.getMethodName().getSymbolName()
                + "() != null) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(mergeMethod.getMethodCall() + ";");
        mergeMethod.copyAdditionsTo(builder, governorTypeDetails);
        bodyBuilder
                .appendFormalLine("message = \"message_successfully_updated\";");
        bodyBuilder.indentRemove();
View Full Code Here

        mergeMethod.copyAdditionsTo(builder, governorTypeDetails);
        bodyBuilder
                .appendFormalLine("message = \"message_successfully_updated\";");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("} else {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(persistMethod.getMethodCall() + ";");
        persistMethod.copyAdditionsTo(builder, governorTypeDetails);
        bodyBuilder
                .appendFormalLine("message = \"message_successfully_created\";");
        bodyBuilder.indentRemove();
View Full Code Here

        // Create the method
        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder.appendFormalLine("if (!(" + OBJECT_NAME + " instanceof "
                + typeName + ")) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("return false;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("if (this == " + OBJECT_NAME + ") {");
        bodyBuilder.indent();
View Full Code Here

        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("return false;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("if (this == " + OBJECT_NAME + ") {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("return true;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine(typeName + " rhs = (" + typeName + ") "
                + OBJECT_NAME + ";");
View Full Code Here

                    + identifierAccessorMethod.getMethodName().getSymbolName()
                    + "());");
        }

        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

                builder.getImportRegistrationResolver().addImport(realListType);

                final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
                bodyBuilder.appendFormalLine("if ("
                        + selectedFieldName.getSymbolName() + " != null) {");
                bodyBuilder.indent();
                bodyBuilder.appendFormalLine(entityName.getSymbolName()
                        + ".set" + StringUtils.capitalize(fieldName)
                        + "(new " + realListType.getSimpleTypeName() + "<" + parameterType.getSimpleTypeName()
                        + ">(" + selectedFieldName + "));");
                bodyBuilder.indentRemove();
View Full Code Here

    bodyBuilder.appendFormalLine("}");
    bodyBuilder.appendFormalLine("this." + entityIdName + " = "
        + entityName + "." + identifierMethodName + "();");
    bodyBuilder.indentRemove();
    bodyBuilder.appendFormalLine("} else {");
    bodyBuilder.indent();
    bodyBuilder.appendFormalLine("this." + entityIdName + " = null;");
    bodyBuilder.indentRemove();
    bodyBuilder.appendFormalLine("}");
    bodyBuilder.appendFormalLine("this." + entityName + " = " + entityName
        + ";");
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.