public abstract class AbstractStyledTextOutput extends Object implements StyledTextOutput, StandardOutputListener
doAppend(String), and optionally doStyleChange(org.gradle.logging.StyledTextOutput.Style).StyledTextOutput.Style| Constructor and Description |
|---|
AbstractStyledTextOutput() |
| Modifier and Type | Method and Description |
|---|---|
StyledTextOutput |
append(char c)
Appends a character using the current style.
|
StyledTextOutput |
append(CharSequence csq)
Appends a sequence of characters using the current style.
|
StyledTextOutput |
append(CharSequence csq,
int start,
int end)
Appends a sequence of characters using the current style.
|
protected abstract void |
doAppend(String text) |
protected void |
doStyleChange(StyledTextOutput.Style style) |
StyledTextOutput |
exception(Throwable throwable)
Appends the stacktrace of the given exception using the current style.
|
StyledTextOutput |
format(String pattern,
Object... args)
Appends a formatted string using the current style.
|
StyledTextOutput |
formatln(String pattern,
Object... args)
Appends a formatted string using the current style and starts a new line.
|
StyledTextOutput.Style |
getStyle() |
void |
onOutput(CharSequence output)
Called when some output is written by the logging system.
|
StyledTextOutput |
println()
Starts a new line.
|
StyledTextOutput |
println(Object text)
Appends text using the current style and starts a new line.
|
StyledTextOutput |
style(StyledTextOutput.Style style)
Switches to a new style.
|
StyledTextOutput |
text(Object text)
Appends text using the current style.
|
StyledTextOutput |
withStyle(StyledTextOutput.Style style)
Creates a copy of this output which uses the given style.
|
public StyledTextOutput append(char c)
StyledTextOutputappend in interface Appendableappend in interface StyledTextOutputc - The characterpublic StyledTextOutput append(CharSequence csq)
StyledTextOutputappend in interface Appendableappend in interface StyledTextOutputcsq - The character sequencepublic StyledTextOutput append(CharSequence csq, int start, int end)
StyledTextOutputappend in interface Appendableappend in interface StyledTextOutputcsq - The character sequencepublic StyledTextOutput format(String pattern, Object... args)
StyledTextOutputformat in interface StyledTextOutputpattern - The pattern stringargs - The args for the patternpublic StyledTextOutput println(Object text)
StyledTextOutputprintln in interface StyledTextOutputtext - The textpublic StyledTextOutput formatln(String pattern, Object... args)
StyledTextOutputformatln in interface StyledTextOutputpattern - The pattern stringargs - The args for the patternpublic void onOutput(CharSequence output)
StandardOutputListeneronOutput in interface StandardOutputListeneroutput - The text.public StyledTextOutput println()
StyledTextOutputprintln in interface StyledTextOutputpublic StyledTextOutput text(Object text)
StyledTextOutputtext in interface StyledTextOutputtext - The textpublic StyledTextOutput exception(Throwable throwable)
StyledTextOutputexception in interface StyledTextOutputthrowable - The exceptionpublic StyledTextOutput withStyle(StyledTextOutput.Style style)
StyledTextOutput
output.style(Info)
output.withStyle(Description).format("%s %s", name, description) // output in Description style
output.println(" text") // output in Info style
withStyle in interface StyledTextOutputstyle - The temporary stylepublic StyledTextOutput style(StyledTextOutput.Style style)
StyledTextOutputStyledTextOutput.Style.Normal.style in interface StyledTextOutputstyle - The style.public StyledTextOutput.Style getStyle()
protected abstract void doAppend(String text)
protected void doStyleChange(StyledTextOutput.Style style)
Copyright © 2013. All rights reserved