Package org.openrewrite.kotlin.style
Class ImportLayoutStyle
java.lang.Object
org.openrewrite.kotlin.style.ImportLayoutStyle
- All Implemented Interfaces:
KotlinStyle,org.openrewrite.style.Style
A Java Style to define how imports are grouped and ordered. Additionally, this style provides configuration to dictate
how wildcard folding should be applied when multiple imports are in the same package or on the same, statically-imported
type.
topLevelSymbolsToUseStarImport - How many imports from the same package must be present before they should be collapsed into a star import. The default is 5.
javaStaticsAndEnumsToUseStarImport - How many java static and enum imports from the same type must be present before they should be collapsed into a star import. The default is 3.
layout - An ordered list of import groupings which define exactly how imports should be organized within a compilation unit.
packagesToFold - An ordered list of packages which are folded when 1 or more types are in use.
The import layout consist of three properties:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA block represents a grouping of imports based on matching rules.static class -
Constructor Summary
ConstructorsConstructorDescriptionImportLayoutStyle(int topLevelSymbolsToUseStarImport, int javaStaticsAndEnumsToUseStarImport, List<ImportLayoutStyle.Block> layout, List<ImportLayoutStyle.Block> packagesToFold) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openrewrite.style.Style
applyDefaults, getJacksonPolymorphicTypeTag, merge
-
Constructor Details
-
ImportLayoutStyle
public ImportLayoutStyle(int topLevelSymbolsToUseStarImport, int javaStaticsAndEnumsToUseStarImport, List<ImportLayoutStyle.Block> layout, List<ImportLayoutStyle.Block> packagesToFold)
-
-
Method Details