public class JavaWrapManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static JavaWrapManager |
INSTANCE
Single-point-of-usage field.
|
Constructor and Description |
---|
JavaWrapManager()
Creates new
JavaWrapManager object with default wrapping services. |
JavaWrapManager(JavaChildWrapArranger childWrapArranger,
JavaChildBlockWrapFactory childBlockWrapFactory) |
Modifier and Type | Method and Description |
---|---|
Wrap |
arrangeChildWrap(ASTNode child,
ASTNode parent,
CommonCodeStyleSettings settings,
JavaCodeStyleSettings javaSettings,
Wrap suggestedWrap,
AbstractJavaBlock reservedWrapsProvider)
Tries to define the wrap to use for the
block for the given 'child' node. |
Wrap |
createChildBlockWrap(ASTBlock block,
CommonCodeStyleSettings settings,
ReservedWrapsProvider reservedWrapsProvider)
Creates
wrap to be used with the children blocks of the the given block. |
public static final JavaWrapManager INSTANCE
public JavaWrapManager()
JavaWrapManager
object with default wrapping services.public JavaWrapManager(JavaChildWrapArranger childWrapArranger, JavaChildBlockWrapFactory childBlockWrapFactory)
public Wrap arrangeChildWrap(ASTNode child, ASTNode parent, CommonCodeStyleSettings settings, JavaCodeStyleSettings javaSettings, Wrap suggestedWrap, AbstractJavaBlock reservedWrapsProvider)
block
for the given 'child'
node. It's assumed that
given 'child'
node is descendant (direct or indirect) of the given 'parent'
node.
I.e. 'parent'
node defines usage context for the 'child'
node.child
- child node which wrap
is to be definedparent
- direct or indirect parent of the given 'child'
node. Defines usage context
of 'child'
node processingsettings
- code style settings to use during wrap definitionsuggestedWrap
- wrap suggested to use by clients of current class. I.e. those clients offer wrap to
use based on their information about current processing state. However, it's possible
that they don't know details of fine-grained wrap definition algorithm encapsulated
at the current class. Hence, this method takes suggested wrap into consideration but
is not required to use it all the time node based on the given parametersreservedWrapsProvider
- reserved 'element type -> wrap instance'
mappings provider. Note: this
argument is considered to be a part of legacy heritage and is intended to be removed as
soon as formatting code refactoring is done'child'
node if it's possible to define the one;
null
otherwisepublic Wrap createChildBlockWrap(ASTBlock block, CommonCodeStyleSettings settings, ReservedWrapsProvider reservedWrapsProvider)
wrap
to be used with the children blocks of the the given block.block
- target block which sub-blocks should use wrap created by the current methodsettings
- code formatting settings to consider during wrap constructionreservedWrapsProvider
- reserved 'element type -> wrap instance'
mappings provider. Note: this
argument is considered to be a part of legacy heritage and is intended to be removed as
soon as formatting code refactoring is done