public class Printer extends Object
<leftMessage>...................................<rightMessage>
<subMessage>
<subPrinter[0].leftMessage>.................<subPrinter[0].rightMessage>
<subPrinter[0].subMessage>
<subPrinter[1].leftMessage>.................<subPrinter[1].rightMessage>
<subPrinter[1].subMessage>
Modifier and Type | Class and Description |
---|---|
static class |
Printer.Color
Ansi color code
|
Constructor and Description |
---|
Printer()
Constructor
|
Modifier and Type | Method and Description |
---|---|
Printer |
addSubPrinter(Printer printer)
Add a sub printer.
|
static Printer |
create()
Instance provider
|
void |
print()
Print this printer with 0 offset and colors and sub printers
|
void |
print(boolean noCol)
Print this printer with 0 offset and sub printers
|
void |
print(int offset)
Print this printer with colors and sub printers
|
void |
print(int offset,
boolean noCol)
Print this printer and sub printers
|
void |
print(int offset,
boolean noCol,
boolean detail)
Print this printer to stdout (or stderr if errorOutput was set to true)
|
static void |
printException(int offset,
Exception e)
Default printing for exception
|
Printer |
setErrorOutput(boolean isAnErrorOrWarning) |
Printer |
setLeftColor(Printer.Color leftColor)
Set left message color
|
Printer |
setLeftMessage(String leftMessage)
Set left message
|
Printer |
setRightColor(Printer.Color rightColor)
Set right message color
|
Printer |
setRightMessage(String rightMessage)
Set right message
|
Printer |
setSubMessage(String subMessage)
Set sub message
|
Printer |
setSubMessageColor(Printer.Color subMessageColor)
Set sub message color
|
public static Printer create()
public Printer setLeftMessage(String leftMessage)
leftMessage
- left messagepublic Printer setLeftColor(Printer.Color leftColor)
leftColor
- left colorpublic Printer setRightMessage(String rightMessage)
rightMessage
- right messagepublic Printer setErrorOutput(boolean isAnErrorOrWarning)
public Printer setRightColor(Printer.Color rightColor)
rightColor
- right colorpublic Printer setSubMessage(String subMessage)
subMessage
- sub messagepublic Printer setSubMessageColor(Printer.Color subMessageColor)
subMessageColor
- sub messagepublic Printer addSubPrinter(Printer printer)
printer
- a printerpublic void print(int offset, boolean noCol, boolean detail)
offset
- print offsetnoCol
- no output color if truedetail
- print detailspublic void print(boolean noCol)
noCol
- no output color if truepublic void print()
public void print(int offset, boolean noCol)
offset
- print offsetnoCol
- no output color if truepublic void print(int offset)
offset
- print offsetpublic static void printException(int offset, Exception e)
offset
- number of char to shifte
- Excpetion to printCopyright © 2014–2023. All rights reserved.