use of com.github.javaparser.printer.configuration.DefaultPrinterConfiguration in project drools by kiegroup.
the class PrintUtil method printNode.
public static String printNode(Node node) {
PrinterConfiguration prettyPrinterConfiguration = new DefaultPrinterConfiguration();
ConstraintPrintVisitor constraintPrintVisitor = new ConstraintPrintVisitor(prettyPrinterConfiguration);
node.accept(constraintPrintVisitor, null);
return constraintPrintVisitor.toString();
}
use of com.github.javaparser.printer.configuration.DefaultPrinterConfiguration in project drools by kiegroup.
the class JavaParserCompiler method createPrettyPrinter.
private static DefaultPrettyPrinter createPrettyPrinter() {
DefaultPrinterConfiguration config = new DefaultPrinterConfiguration();
config.addOption(new DefaultConfigurationOption(DefaultPrinterConfiguration.ConfigOption.COLUMN_ALIGN_PARAMETERS, true));
config.addOption(new DefaultConfigurationOption(DefaultPrinterConfiguration.ConfigOption.COLUMN_ALIGN_FIRST_METHOD_CHAIN, true));
return new DefaultPrettyPrinter(config);
}
use of com.github.javaparser.printer.configuration.DefaultPrinterConfiguration in project drools by kiegroup.
the class AbstractDTAnalysisTest method debugAnalysis.
protected static void debugAnalysis(DTAnalysis analysis) {
if (!LOG.isDebugEnabled()) {
return;
}
StringBuilder sbGaps = new StringBuilder("\nGaps:\n");
for (Hyperrectangle gap : analysis.getGaps()) {
sbGaps.append(gap.toString());
sbGaps.append("\n");
}
LOG.debug(sbGaps.toString());
DefaultPrinterConfiguration printConfig = new DefaultPrinterConfiguration();
printConfig.addOption(new DefaultConfigurationOption(DefaultPrinterConfiguration.ConfigOption.COLUMN_ALIGN_PARAMETERS, true));
printConfig.addOption(new DefaultConfigurationOption(DefaultPrinterConfiguration.ConfigOption.COLUMN_ALIGN_FIRST_METHOD_CHAIN, true));
Expression printGaps = DTAnalysisMeta.printGaps(analysis);
LOG.debug("\n" + printGaps.toString(printConfig));
StringBuilder sbOverlaps = new StringBuilder("\nOverlaps:\n");
for (Overlap overlap : analysis.getOverlaps()) {
sbOverlaps.append(overlap.toString());
sbOverlaps.append("\n");
}
LOG.debug(sbOverlaps.toString());
Expression printOverlaps = DTAnalysisMeta.printOverlaps(analysis);
LOG.debug("\n" + printOverlaps.toString(printConfig));
}
Aggregations