Class MultiCodeBlock
java.lang.Object
org.springframework.javapoet.support.MultiCodeBlock
A
CodeBlock
wrapper for joining multiple blocks.- Since:
- 6.0
- Author:
- Stephane Nicoll
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a code block using the specified formatted String and the specified arguments.void
Add aCodeBlock
using the specified callback.void
add
(org.springframework.javapoet.CodeBlock code) Add the specifiedCodeBlock
.org.springframework.javapoet.CodeBlock
Return aCodeBlock
that joins the different blocks registered in this instance with the specified delimiter.
-
Constructor Details
-
MultiCodeBlock
public MultiCodeBlock()
-
-
Method Details
-
add
public void add(org.springframework.javapoet.CodeBlock code) Add the specifiedCodeBlock
.- Parameters:
code
- the code block to add
-
add
Add aCodeBlock
using the specified callback.- Parameters:
code
- the callback to use
-
add
Add a code block using the specified formatted String and the specified arguments.- Parameters:
code
- the codearguments
- the arguments- See Also:
-
CodeBlock.Builder.add(String, Object...)
-
join
Return aCodeBlock
that joins the different blocks registered in this instance with the specified delimiter.- Parameters:
delimiter
- the delimiter to use (not null)- Returns:
- a
CodeBlock
joining the blocks of this instance with the specifieddelimiter
- See Also:
-
CodeBlock.join(Iterable, String)
-