/** * Prints a blank line, ensuring any indent is included before doing so. */ public InvocableMemberBodyBuilder newLine(final boolean indentBefore) { if (indentBefore) { appendIndent(); } // We use \n for consistency with JavaParser's DumpVisitor, which always // uses \n stringBuilder.append("\n"); return this; }
/** * Prints the message, after adding indents and returns to a new line. This * is the most commonly used method. */ public InvocableMemberBodyBuilder appendFormalLine(final String message) { appendIndent(); if (message != null && !"".equals(message)) { stringBuilder.append(message); } return newLine(false); }
/** * Prints the message formatted with values, after adding indents and returns to a new line. This * is the most commonly used method. * * @see String#format(String, Object...) */ public InvocableMemberBodyBuilder appendFormalLine(final String message, final Object... values) { appendIndent(); if (message != null && !"".equals(message)) { stringBuilder.append(String.format(message, values)); } return newLine(false); }
bodyBuilder.appendIndent(); StringBuilder fieldString = new StringBuilder(); fieldString.append("\"");
bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine(String.format("if (%s.%s() != null) {", formBeanParameterName, accessorMethodName)); getValueOfPairFor(this.typesFieldMaps.get(formBeanType), field.getKey()); bodyBuilder.appendIndent(); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine(String.format("query.where(%s.eq(%s.%s()));", pathFieldName, formBeanParameterName, accessorMethodName)); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine("}"); bodyBuilder.appendIndent(); final String pathType = getNameOfJavaType(QUERYDSL_PATH); bodyBuilder.append(String.format("%s<?>[] paths = new %s<?>[] {", pathType, pathType));
BeanInfoUtils.getAccessorMethodName(finderParameter.getName(), finderParameter.getType()) .getSymbolName(); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine(String.format("if (%s.%s() != null) {", formBeanParameterName, accessorMethodName)); bodyBuilder.appendIndent(); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine(String.format("searchCondition.and(%s.eq(%s.%s()));", pathFieldName, formBeanParameterName, accessorMethodName)); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine("}");
/** * Prints a blank line, ensuring any indent is included before doing so. */ public InvocableMemberBodyBuilder newLine(final boolean indentBefore) { if (indentBefore) { appendIndent(); } // We use \n for consistency with JavaParser's DumpVisitor, which always // uses \n stringBuilder.append("\n"); return this; }
bodyBuilder.appendIndent(); bodyBuilder.append("if (%s || %s", createNullExpression(entityMetadata.getCurrentIndentifierField()), bodyBuilder.appendIndent(); bodyBuilder.append("|| ( "); bodyBuilder bodyBuilder.appendIndent(); bodyBuilder.append("if (%s", createNullExpression(entityMetadata.getCurrentIndentifierField())); bodyBuilder.appendIndent(); bodyBuilder.append("|| ( "); bodyBuilder.append("%1$s.get%2$s() != null && %1$s.get%2$s().get%3$s() != null",
/** * Prints the message, after adding indents and returns to a new line. This * is the most commonly used method. */ public InvocableMemberBodyBuilder appendFormalLine(final String message) { appendIndent(); if (message != null && !"".equals(message)) { stringBuilder.append(message); } return newLine(false); }
/** * Prints the message formatted with values, after adding indents and returns to a new line. This * is the most commonly used method. * * @see String#format(String, Object...) */ public InvocableMemberBodyBuilder appendFormalLine(final String message, final Object... values) { appendIndent(); if (message != null && !"".equals(message)) { stringBuilder.append(String.format(message, values)); } return newLine(false); }
bodyBuilder.appendIndent(); StringBuilder fieldString = new StringBuilder(); fieldString.append("\"");
bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine(String.format("if (%s.%s() != null) {", formBeanParameterName, accessorMethodName)); getValueOfPairFor(this.typesFieldMaps.get(formBeanType), field.getKey()); bodyBuilder.appendIndent(); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine(String.format("query.where(%s.eq(%s.%s()));", pathFieldName, formBeanParameterName, accessorMethodName)); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine("}"); bodyBuilder.appendIndent(); final String pathType = getNameOfJavaType(QUERYDSL_PATH); bodyBuilder.append(String.format("%s<?>[] paths = new %s<?>[] {", pathType, pathType));
BeanInfoUtils.getAccessorMethodName(finderParameter.getName(), finderParameter.getType()) .getSymbolName(); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine(String.format("if (%s.%s() != null) {", formBeanParameterName, accessorMethodName)); bodyBuilder.appendIndent(); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine(String.format("searchCondition.and(%s.eq(%s.%s()));", pathFieldName, formBeanParameterName, accessorMethodName)); bodyBuilder.appendIndent(); bodyBuilder.appendFormalLine("}");
.appendFormalLine("if ( null == format || format.length() <= 0 ) {"); bodyBuilder .appendIndent() .appendFormalLine( "uiModel.addAttribute(\"error\", \"message_format_required\");"); bodyBuilder.appendIndent().appendFormalLine( "return \"".concat(annotationValues.getPath()).concat("/") .concat(reportName).concat("\";")); .appendFormalLine("Matcher matcher = pattern.matcher(format);"); bodyBuilder.appendFormalLine("if ( !matcher.matches() ) {"); bodyBuilder.appendIndent().appendFormalLine( "uiModel.addAttribute(\"error\", \"message_format_invalid\");"); bodyBuilder.appendIndent().appendFormalLine( "return \"".concat(annotationValues.getPath()).concat("/") .concat(reportName).concat("\";")); .appendIndent() .appendFormalLine( "uiModel.addAttribute(\"error\", \"message_emptyresults_noreportgeneration\");"); bodyBuilder.appendIndent().appendFormalLine( "return \"".concat(annotationValues.getPath()).concat("/") .concat(reportName).concat("\";"));