public class AlignmentInColumnsHelper
extends java.lang.Object
'align in columns'
processing.
'Align in columns'
here means format the code like below:
class Test { private int iii = 1; private double d = 2; }I.e. components of two lines are aligned to each other in columns. This class is not singleton but it's thread-safe and provides single-point-of-usage field
INSTANCE
.
Thread-safe.Modifier and Type | Field and Description |
---|---|
static AlignmentInColumnsHelper |
INSTANCE
Single-point-of-usage field.
|
Constructor and Description |
---|
AlignmentInColumnsHelper() |
Modifier and Type | Method and Description |
---|---|
boolean |
useDifferentVarDeclarationAlignment(ASTNode node,
AlignmentInColumnsConfig config,
int blankLinesToBeKeptOnReformat)
Allows to answer if given node should be aligned to the previous node of the same type according to the given alignment config
assuming that given node is a variable declaration.
|
public static final AlignmentInColumnsHelper INSTANCE
public boolean useDifferentVarDeclarationAlignment(ASTNode node, AlignmentInColumnsConfig config, int blankLinesToBeKeptOnReformat)
node
- target node which alignment strategy is to be definedconfig
- alignment config to use for processingblankLinesToBeKeptOnReformat
- corresponding KEEP_LINE_IN_* formatting settingtrue
if given node should be aligned to the previous one; false
otherwise