Package org.springframework.roo.classpath.itd

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


        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

        }
        else if ("remove".equals(methodDelegateName)) {
            addTransactionalAnnotation(annotations);
            bodyBuilder.appendFormalLine("if (this." + entityManagerFieldName
                    + ".contains(this)) {");
            bodyBuilder.indent();
            bodyBuilder.appendFormalLine("this." + entityManagerFieldName
                    + ".remove(this);");
            bodyBuilder.indentRemove();
            bodyBuilder.appendFormalLine("} else {");
            bodyBuilder.indent();
View Full Code Here

            bodyBuilder.indent();
            bodyBuilder.appendFormalLine("this." + entityManagerFieldName
                    + ".remove(this);");
            bodyBuilder.indentRemove();
            bodyBuilder.appendFormalLine("} else {");
            bodyBuilder.indent();
            bodyBuilder.appendFormalLine(destination.getSimpleTypeName()
                    + " attached = " + destination.getSimpleTypeName() + "."
                    + getFindMethod().getMethodName().getSymbolName()
                    + "(this." + identifierField.getFieldName().getSymbolName()
                    + ");");
View Full Code Here

        }
       
        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder.appendFormalLine("String jpaQuery = \"SELECT o FROM " + entityName + " o\";");
        bodyBuilder.appendFormalLine("if (fieldNames4OrderClauseFilter.contains(sortFieldName)) {");
        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();
View Full Code Here

                    && sizeAnnotation.getAttribute(MAX_SYMBOL) != null) {
                final Integer maxValue = (Integer) sizeAnnotation.getAttribute(
                        MAX_SYMBOL).getValue();
                bodyBuilder.appendFormalLine("if (" + fieldName
                        + ".length() > " + maxValue + ") {");
                bodyBuilder.indent();
                if (isUnique) {
                    bodyBuilder.appendFormalLine(fieldName
                            + " = new Random().nextInt(10) + " + fieldName
                            + ".substring(1, " + maxValue + ");");
                }
View Full Code Here

        bodyBuilder.appendFormalLine("String jpaQuery = \"SELECT o FROM " + entityName + " o\";");
        bodyBuilder.appendFormalLine("if (fieldNames4OrderClauseFilter.contains(sortFieldName)) {");
        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("}");
View Full Code Here

            else if (sizeAnnotation == null && values != null) {
                if (values.containsKey("length")) {
                    final Integer lengthValue = (Integer) values.get("length");
                    bodyBuilder.appendFormalLine("if (" + fieldName
                            + ".length() > " + lengthValue + ") {");
                    bodyBuilder.indent();
                    if (isUnique) {
                        bodyBuilder.appendFormalLine(fieldName
                                + " = new Random().nextInt(10) + " + fieldName
                                + ".substring(1, " + lengthValue + ");");
                    }
View Full Code Here

        }

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder.appendFormalLine("String jpaQuery = \"SELECT o FROM " + entityName + " o\";");
        bodyBuilder.appendFormalLine("if (fieldNames4OrderClauseFilter.contains(sortFieldName)) {");
        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();
View Full Code Here

        bodyBuilder.appendFormalLine("String jpaQuery = \"SELECT o FROM " + entityName + " o\";");
        bodyBuilder.appendFormalLine("if (fieldNames4OrderClauseFilter.contains(sortFieldName)) {");
        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("}");
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.