Class IndentingWriterFactory
java.lang.Object
io.spring.initializr.generator.io.IndentingWriterFactory
A factory for
IndentingWriter
that provides customizations according to the
chosen content.- Author:
- Stephane Nicoll
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Settings customizer forIndentingWriterFactory
. -
Method Summary
Modifier and TypeMethodDescriptionstatic IndentingWriterFactory
Create aIndentingWriterFactory
with a single indenting strategy.static IndentingWriterFactory
create
(Function<Integer, String> defaultIndentingStrategy, Consumer<IndentingWriterFactory.Builder> factory) Create aIndentingWriterFactory
.createIndentingWriter
(String contentId, Writer out) Create anIndentingWriter
for the specified content and output.static IndentingWriterFactory
Create anIndentingWriterFactory
with a default indentation strategy of 4 spaces.
-
Method Details
-
createIndentingWriter
Create anIndentingWriter
for the specified content and output.- Parameters:
contentId
- the identifier of the contentout
- the output to use- Returns:
- a configured
IndentingWriter
-
withDefaultSettings
Create anIndentingWriterFactory
with a default indentation strategy of 4 spaces.- Returns:
- an
IndentingWriterFactory
with default settings
-
create
Create aIndentingWriterFactory
with a single indenting strategy.- Parameters:
defaultIndentingStrategy
- the default indenting strategy to use- Returns:
- an
IndentingWriterFactory
-
create
public static IndentingWriterFactory create(Function<Integer, String> defaultIndentingStrategy, Consumer<IndentingWriterFactory.Builder> factory) Create aIndentingWriterFactory
.- Parameters:
defaultIndentingStrategy
- the default indenting strategy to usefactory
- a consumer of the builder to apply further customizations- Returns:
- an
IndentingWriterFactory
-