public class PunchPrinter 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 |
PunchPrinter.Color
Ansi color code
|
Constructor and Description |
---|
PunchPrinter()
Constructor
|
Modifier and Type | Method and Description |
---|---|
PunchPrinter |
addSubPrinter(PunchPrinter printer)
Add a sub printer.
|
static PunchPrinter |
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
|
PunchPrinter |
setErrorOutput(boolean isAnErrorOrWarning) |
PunchPrinter |
setLeftColor(PunchPrinter.Color leftColor)
Set left message color
|
PunchPrinter |
setLeftMessage(String leftMessage)
Set left message
|
PunchPrinter |
setRightColor(PunchPrinter.Color rightColor)
Set right message color
|
PunchPrinter |
setRightMessage(String rightMessage)
Set right message
|
PunchPrinter |
setSubMessage(String subMessage)
Set sub message
|
PunchPrinter |
setSubMessageColor(PunchPrinter.Color subMessageColor)
Set sub message color
|
public static PunchPrinter create()
public PunchPrinter setLeftMessage(String leftMessage)
leftMessage
- left messagepublic PunchPrinter setLeftColor(PunchPrinter.Color leftColor)
leftColor
- left colorpublic PunchPrinter setRightMessage(String rightMessage)
rightMessage
- right messagepublic PunchPrinter setErrorOutput(boolean isAnErrorOrWarning)
public PunchPrinter setRightColor(PunchPrinter.Color rightColor)
rightColor
- right colorpublic PunchPrinter setSubMessage(String subMessage)
subMessage
- sub messagepublic PunchPrinter setSubMessageColor(PunchPrinter.Color subMessageColor)
subMessageColor
- sub messagepublic PunchPrinter addSubPrinter(PunchPrinter 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 © 2023. All rights reserved.