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 classSettings customizer forIndentingWriterFactory. -
Method Summary
Modifier and TypeMethodDescriptionstatic IndentingWriterFactoryCreate aIndentingWriterFactorywith a single indenting strategy.static IndentingWriterFactorycreate(Function<Integer, String> defaultIndentingStrategy, Consumer<IndentingWriterFactory.Builder> factory) Create aIndentingWriterFactory.createIndentingWriter(String contentId, Writer out) Create anIndentingWriterfor the specified content and output.static IndentingWriterFactoryCreate anIndentingWriterFactorywith a default indentation strategy of 4 spaces.
-
Method Details
-
createIndentingWriter
Create anIndentingWriterfor the specified content and output.- Parameters:
contentId- the identifier of the contentout- the output to use- Returns:
- a configured
IndentingWriter
-
withDefaultSettings
Create anIndentingWriterFactorywith a default indentation strategy of 4 spaces.- Returns:
- an
IndentingWriterFactorywith default settings
-
create
Create aIndentingWriterFactorywith 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
-