Package com.squareup.javapoet
Class CodeBlock.Builder
java.lang.Object
com.squareup.javapoet.CodeBlock.Builder
- Enclosing class:
CodeBlock
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddStatement
(String format, Object... args) private Object
private String
private String
private TypeName
beginControlFlow
(String controlFlow, Object... args) build()
endControlFlow
(String controlFlow, Object... args) indent()
nextControlFlow
(String controlFlow, Object... args) unindent()
-
Field Details
-
formatParts
-
args
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
add
-
argToName
-
argToLiteral
-
argToString
-
argToType
-
beginControlFlow
- Parameters:
controlFlow
- the control flow construct and its code, such as "if (foo == 5)". Shouldn't contain braces or newline characters.
-
nextControlFlow
- Parameters:
controlFlow
- the control flow construct and its code, such as "else if (foo == 10)". Shouldn't contain braces or newline characters.
-
endControlFlow
-
endControlFlow
- Parameters:
controlFlow
- the optional control flow construct and its code, such as "while(foo == 20)". Only used for "do/while" control flows.
-
addStatement
-
add
-
indent
-
unindent
-
build
-