DependencyFormatter

data class DependencyFormatter(isMergeDuplicateLevels: Boolean, initProcessorCount: Int, startProcessorCount: Int, nameProcessorCount: Int, endProcessorCount: Int, capitalizationPredicateCount: Int)

A formatter used to format dependency as path. The final result is DependencyFormatter.toPath.

Formatting order:

1. Process all 'onStart {}' in sequence:
onStart(raw): String
|
V
onStart(input): String
|
V
.......

2. Process all 'onEachName {}' in sequence:
onEachName(name): String
|
. // Use separators '.' splicing
|
V
onEachName(name): String
|
V
.......

3. Process all 'onEnd {}' in sequence:
onEnd(path): String
|
V
onEnd(output): String
|
V
.......

Author

凛 (https://github.com/RinOrz)

Constructors

DependencyFormatter
Link copied to clipboard
fun DependencyFormatter(isMergeDuplicateLevels: Boolean = true, initProcessorCount: Int = 0, startProcessorCount: Int = 0, nameProcessorCount: Int = 0, endProcessorCount: Int = 0, capitalizationPredicateCount: Int = 0)

Types

Companion
Link copied to clipboard
object Companion

Functions

isCapitalize
Link copied to clipboard
fun isCapitalize(predicate: (name: String) -> Boolean)

If the predicate is true, the name of the corresponding dependency will be capitalized.

mergeDuplicateLevels
Link copied to clipboard
fun mergeDuplicateLevels()

Merges duplicate path levels.

notCapitalize
Link copied to clipboard
fun notCapitalize(predicate: (name: String) -> Boolean)

If the predicate is false, the name of the corresponding dependency will be capitalized.

onEachName
Link copied to clipboard
fun onEachName(processor: FormatProcessor)

Adds a processor to processes each name part of the dependency.

onEnd
Link copied to clipboard
fun onEnd(processor: FormatProcessor)

Adds a processor to processes the toPath formatted path.

onInit
Link copied to clipboard
fun onInit(processor: FormatProcessor)

Adds a processor to processes the input before calling toPath.

onStart
Link copied to clipboard
fun onStart(processor: FormatProcessor)

Adds a processor to processes the input at the beginning of calling toPath.

Properties

isMergeDuplicateLevels
Link copied to clipboard
var isMergeDuplicateLevels: Boolean = true

Whether to merge duplicate path levels.