public class GradlePrettyPrinter
extends java.lang.Object
PrintWriter.| Constructor and Description |
|---|
GradlePrettyPrinter(java.io.PrintWriter pWriter)
Create a new
GradlePrettyPrinter. |
| Modifier and Type | Method and Description |
|---|---|
void |
printAttribute(java.lang.String pName,
boolean pValue)
Print a line with an assignment of a boolean attribute.
|
void |
printAttribute(java.lang.String pName,
java.lang.String pValue)
Print a line with an assignment of a string attribute.
|
void |
printClosure(java.lang.String pName,
java.util.function.Consumer<GradlePrettyPrinter> pBodyAction)
Print a closure at the current indentation level and increment the level.
|
void |
printIndentedLine(java.lang.String pLine)
Print a line at the current indentation level.
|
void |
printMethodCall(java.lang.String pName,
java.lang.String pArgument,
boolean pQuote,
boolean pWithParentheses)
Print a line containing a method call with a string argument.
|
public GradlePrettyPrinter(java.io.PrintWriter pWriter)
GradlePrettyPrinter.pWriter - The writer to delegate the printing to.java.lang.NullPointerException - if pWriter is null.public void printClosure(java.lang.String pName,
java.util.function.Consumer<GradlePrettyPrinter> pBodyAction)
pName - The name of the closure, possibly null.pBodyAction - An action that when passed this instance will print the closure's body.public void printAttribute(java.lang.String pName,
java.lang.String pValue)
pName - The name of the attribute.pValue - The value of the attribute, possibly null.public void printAttribute(java.lang.String pName,
boolean pValue)
pName - The name of the attribute.pValue - The value of the attribute.public void printMethodCall(java.lang.String pName,
java.lang.String pArgument,
boolean pQuote,
boolean pWithParentheses)
name 'arg'The line is printed at the current indentation level. If the argument is null, nothing is printed.
pName - The name of the method.pArgument - The argument to the method, possibly null.pQuote - If true, the string argument will be put inside quotes.pWithParentheses - If true, the string argument will be enclosed in parentheses.public void printIndentedLine(java.lang.String pLine)
pLine - The line to print.