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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a code block using the specified formatted String and the specified arguments.voidAdd aCodeBlockusing the specified callback.voidadd(org.springframework.javapoet.CodeBlock code) Add the specifiedCodeBlock.org.springframework.javapoet.CodeBlockReturn aCodeBlockthat 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 aCodeBlockusing 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 aCodeBlockthat joins the different blocks registered in this instance with the specified delimiter.- Parameters:
delimiter- the delimiter to use (not null)- Returns:
- a
CodeBlockjoining the blocks of this instance with the specifieddelimiter - See Also:
-
CodeBlock.join(Iterable, String)
-