Package org.springframework.roo.classpath.itd

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


        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("jpaQuery = jpaQuery + \" ORDER BY \" + sortFieldName;");
        bodyBuilder.appendFormalLine("if (\"ASC\".equalsIgnoreCase(sortOrder) || \"DESC\".equalsIgnoreCase(sortOrder)) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("jpaQuery = jpaQuery + \" \" + sortOrder;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("return " + ENTITY_MANAGER_METHOD_NAME
            + "().createQuery(jpaQuery, " + destination.getSimpleTypeName() + ".class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList();");
View Full Code Here


        bodyBuilder.appendFormalLine("if (\"ASC\".equalsIgnoreCase(sortOrder) || \"DESC\".equalsIgnoreCase(sortOrder)) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("jpaQuery = jpaQuery + \" \" + sortOrder;");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        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(
View Full Code Here

        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("throw new IllegalStateException(\"Find entries implementation for '"
                        + entity.getSimpleTypeName()
                        + "' illegally returned null\");");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("if (!" + dataField + ".isEmpty()) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("return;");
        bodyBuilder.indentRemove();
View Full Code Here

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

                            .appendFormalLine("throw new UnsupportedOperationException();");
                    bodyBuilder.indentRemove();
                    bodyBuilder.appendFormalLine("}");
                }
            }
            bodyBuilder.indentRemove();
            bodyBuilder.appendFormalLine("}."
                    + getEntityManagerField().getFieldName().getSymbolName()
                    + ";");
        }
        else {
View Full Code Here

      String dependentTypeName = fieldNamesList.get(fieldPosition)
          .getFieldName().getSymbolName();
      bodyBuilder.appendFormalLine("dependencies.add(new String[] { \""
          + dependentTypeName + "\", \""
          + dependentType.getControllerPath() + "\" });");
      bodyBuilder.indentRemove();
      bodyBuilder.appendFormalLine("}");

      fieldPosition++;
    }
    if (listAdded) {
View Full Code Here

        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<"
                + entity.getSimpleTypeName() + ">();");
        bodyBuilder.appendFormalLine("for (int i = 0; i < " + quantity
View Full Code Here

    bodyBuilder.indent();
    bodyBuilder.appendFormalLine("populateEditForm(uiModel, " + entityName
        + ");");
    bodyBuilder.appendFormalLine("return \"" + controllerPath
        + "/create\";");
    bodyBuilder.indentRemove();
    bodyBuilder.appendFormalLine("}");
    bodyBuilder.appendFormalLine("uiModel.asMap().clear();");
    bodyBuilder.appendFormalLine(persistMethod.getMethodCall() + ";");
    bodyBuilder.appendFormalLine("return \"redirect:/"
        + controllerPath
View Full Code Here

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

        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();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder
                .appendFormalLine("throw new IllegalStateException(msg.toString(), e);");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
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.