public class PrettyPrinterConfiguration extends Object
PrettyPrinter
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_ENUM_CONSTANTS_TO_ALIGN_HORIZONTALLY |
Constructor and Description |
---|
PrettyPrinterConfiguration() |
Modifier and Type | Method and Description |
---|---|
String |
getEndOfLineCharacter() |
String |
getIndent() |
int |
getMaxEnumConstantsToAlignHorizontally() |
Function<PrettyPrinterConfiguration,PrettyPrintVisitor> |
getVisitorFactory() |
boolean |
isColumnAlignFirstMethodChain() |
boolean |
isColumnAlignParameters() |
boolean |
isIgnoreComments() |
boolean |
isNormalizeEolInComment()
Deprecated.
this is always on.
|
boolean |
isOrderImports() |
boolean |
isPrintComments() |
boolean |
isPrintJavadoc() |
PrettyPrinterConfiguration |
setColumnAlignFirstMethodChain(boolean columnAlignFirstMethodChain) |
PrettyPrinterConfiguration |
setColumnAlignParameters(boolean columnAlignParameters) |
PrettyPrinterConfiguration |
setEndOfLineCharacter(String endOfLineCharacter)
Set the character to append when a line should end.
|
PrettyPrinterConfiguration |
setIndent(String indent)
Set the string to use for indenting.
|
PrettyPrinterConfiguration |
setMaxEnumConstantsToAlignHorizontally(int maxEnumConstantsToAlignHorizontally)
By default enum constants get aligned like this:
|
PrettyPrinterConfiguration |
setNormalizeEolInComment(boolean normalizeEolInComment)
Deprecated.
this is always on.
|
PrettyPrinterConfiguration |
setOrderImports(boolean orderImports)
When true, orders imports by alphabetically.
|
PrettyPrinterConfiguration |
setPrintComments(boolean printComments)
When true, all comments will be printed, unless printJavadoc is false, then only line and block comments will be
printed.
|
PrettyPrinterConfiguration |
setPrintJavadoc(boolean printJavadoc)
When true, Javadoc will be printed.
|
PrettyPrinterConfiguration |
setVisitorFactory(Function<PrettyPrinterConfiguration,PrettyPrintVisitor> visitorFactory)
Set the factory that creates the PrettyPrintVisitor.
|
public static final int DEFAULT_MAX_ENUM_CONSTANTS_TO_ALIGN_HORIZONTALLY
public String getIndent()
public PrettyPrinterConfiguration setIndent(String indent)
public boolean isOrderImports()
@Deprecated public boolean isNormalizeEolInComment()
@Deprecated public PrettyPrinterConfiguration setNormalizeEolInComment(boolean normalizeEolInComment)
public boolean isPrintComments()
public boolean isIgnoreComments()
public boolean isPrintJavadoc()
public boolean isColumnAlignParameters()
public boolean isColumnAlignFirstMethodChain()
public PrettyPrinterConfiguration setPrintComments(boolean printComments)
public PrettyPrinterConfiguration setPrintJavadoc(boolean printJavadoc)
public PrettyPrinterConfiguration setColumnAlignParameters(boolean columnAlignParameters)
public PrettyPrinterConfiguration setColumnAlignFirstMethodChain(boolean columnAlignFirstMethodChain)
public Function<PrettyPrinterConfiguration,PrettyPrintVisitor> getVisitorFactory()
public PrettyPrinterConfiguration setVisitorFactory(Function<PrettyPrinterConfiguration,PrettyPrintVisitor> visitorFactory)
public String getEndOfLineCharacter()
public PrettyPrinterConfiguration setEndOfLineCharacter(String endOfLineCharacter)
public PrettyPrinterConfiguration setOrderImports(boolean orderImports)
public int getMaxEnumConstantsToAlignHorizontally()
public PrettyPrinterConfiguration setMaxEnumConstantsToAlignHorizontally(int maxEnumConstantsToAlignHorizontally)
enum X { A, B, C, D }until the amount of constants passes this value (5 by default). Then they get aligned like this:
enum X { A, B, C, D, E, F, G }Set it to a large number to always align horizontally. Set it to 1 or less to always align vertically.
Copyright © 2007–2018. All rights reserved.