Package org.springframework.roo.classpath.itd

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


    final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
    bodyBuilder
        .appendFormalLine("String enc = httpServletRequest.getCharacterEncoding();");
    bodyBuilder.appendFormalLine("if (enc == null) {");
    bodyBuilder.indent();
    bodyBuilder.appendFormalLine("enc = " + getShortName(WEB_UTILS)
        + ".DEFAULT_CHARACTER_ENCODING;");
    bodyBuilder.indentRemove();
    bodyBuilder.appendFormalLine("}");
    bodyBuilder.appendFormalLine("try {");
View Full Code Here


        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder.appendFormalLine(getSimpleName(SOLR_SERVER)
                + " solrServer = solrServer();");
        bodyBuilder.appendFormalLine("try {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("solrServer.deleteById(\""
                + destination.getSimpleTypeName().toLowerCase() + "_\" + "
                + javaBeanFieldName + "."
                + identifierAccessor.getMethodName().getSymbolName() + "());");
        bodyBuilder.appendFormalLine("solrServer.commit();");
View Full Code Here

                + javaBeanFieldName + "."
                + identifierAccessor.getMethodName().getSymbolName() + "());");
        bodyBuilder.appendFormalLine("solrServer.commit();");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("} catch (Exception e) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("e.printStackTrace();");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");

        final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
View Full Code Here

                + getSimpleName(new JavaType(ArrayList.class.getName(), 0,
                        DataType.TYPE, null, sidTypeParams)) + "();");
        bodyBuilder.appendFormalLine("for (" + destination.getSimpleTypeName()
                + " " + javaBeanFieldName + " : " + beanPlural.toLowerCase()
                + ") {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(sid + " sid = new " + sid + "();");
        bodyBuilder.appendFormalLine("sid.addField(\"id\", \""
                + destination.getSimpleTypeName().toLowerCase() + "_\" + "
                + javaBeanFieldName + "." + identifierAccessor.getMethodName()
                + "());");
View Full Code Here

                + "_solrsummary_t\", " + textField.toString() + ");");
        bodyBuilder.appendFormalLine(listVar + ".add(sid);");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("try {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine(getSimpleName(SOLR_SERVER)
                + " solrServer = solrServer();");
        bodyBuilder.appendFormalLine("solrServer.add(" + listVar + ");");
        bodyBuilder.appendFormalLine("solrServer.commit();");
        bodyBuilder.indentRemove();
View Full Code Here

                + " solrServer = solrServer();");
        bodyBuilder.appendFormalLine("solrServer.add(" + listVar + ");");
        bodyBuilder.appendFormalLine("solrServer.commit();");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("} catch (Exception e) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("e.printStackTrace();");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");

        final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
View Full Code Here

        final List<JavaSymbolName> parameterNames = Arrays
                .asList(new JavaSymbolName("query"));

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
        bodyBuilder.appendFormalLine("try {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("return solrServer().query(query);");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("} catch (Exception e) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("e.printStackTrace();");
View Full Code Here

        bodyBuilder.appendFormalLine("try {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("return solrServer().query(query);");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("} catch (Exception e) {");
        bodyBuilder.indent();
        bodyBuilder.appendFormalLine("e.printStackTrace();");
        bodyBuilder.indentRemove();
        bodyBuilder.appendFormalLine("}");
        bodyBuilder.appendFormalLine("return new "
                + getSimpleName(queryResponse) + "();");
View Full Code Here

                        .getNameIncludingTypeParameters(false,
                                builder.getImportRegistrationResolver()) + "."
                + searchAnnotationValues.getSearchMethod() + "(solrQuery);");
        bodyBuilder.appendFormalLine("for (" + facetFieldSimpleName
                + " field: response.getFacetFields()) {");
        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("if (response.getResults().get(0) != null) {");
        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("Object fieldValue = response.getResults().get(0).getFieldValue(field.getName());");
View Full Code Here

        bodyBuilder.appendFormalLine("for (" + facetFieldSimpleName
                + " field: response.getFacetFields()) {");
        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("if (response.getResults().get(0) != null) {");
        bodyBuilder.indent();
        bodyBuilder
                .appendFormalLine("Object fieldValue = response.getResults().get(0).getFieldValue(field.getName());");
        bodyBuilder.appendFormalLine("if (fieldValue != null) {");
        bodyBuilder.indent();
        bodyBuilder
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.