public interface FormatterStep
Modifier and Type | Interface and Description |
---|---|
static class |
FormatterStep.FileIndependent
A FormatterStep which doesn't depend on the input file.
|
Modifier and Type | Method and Description |
---|---|
static FormatterStep |
create(String name,
Throwing.Function<String,String> formatter)
Creates a FormatterStep from the given function.
|
static FormatterStep |
createLazy(String name,
Throwing.Supplier<Throwing.Function<String,String>> formatterSupplier)
Creates a FormatterStep lazily from the given formatterSupplier function.
|
default FormatterStep |
filterByFile(Predicate<File> filter)
Returns a new FormatterStep which will only apply its changes
to files which pass the given filter.
|
String |
format(String raw,
File file)
Returns a formatted version of the given content.
|
String |
getName()
The name of the step, for debugging purposes.
|
String getName()
String format(String raw, File file) throws Throwable
raw
- File's content, guaranteed to have unix-style newlines ('\n')file
- the File which is being formattedThrowable
default FormatterStep filterByFile(Predicate<File> filter)
static FormatterStep create(String name, Throwing.Function<String,String> formatter)
static FormatterStep createLazy(String name, Throwing.Supplier<Throwing.Function<String,String>> formatterSupplier)