Module com.github.rvesse.airline.io
Class TroffPrinter
- java.lang.Object
-
- com.github.rvesse.airline.io.printers.TroffPrinter
-
public class TroffPrinter extends java.lang.ObjectPrinter class for generating Troff output
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTroffPrinter.BulletStyleSupported bullet styleprivate static classTroffPrinter.ListType
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBULLET_STYLE_BULLETprivate static java.lang.StringBULLET_STYLE_DASHprivate static java.lang.StringBULLET_STYLE_EM_DASHprivate static intDEFAULT_INDENTATIONprivate intindentationprivate booleaninSectionprivate intlevelprivate java.lang.StringlistGlyphprivate java.util.Stack<TroffPrinter.ListType>listsprivate booleannewlineprivate static java.lang.StringREQUEST_BREAKprivate static java.lang.StringREQUEST_FONT_BOLDprivate static java.lang.StringREQUEST_FONT_BOLD_ITALICprivate static java.lang.StringREQUEST_FONT_ITALICprivate static java.lang.StringREQUEST_FONT_ROMANprivate static java.lang.StringREQUEST_MOVE_LEFT_MARGINprivate static java.lang.StringREQUEST_PARAGRAPH_CURRENT_INDENTATIONprivate static java.lang.StringREQUEST_PARAGRAPH_NO_INDENTATIONprivate static java.lang.StringREQUEST_PARAGRAPH_TITLEDprivate static java.lang.StringREQUEST_RESET_LEFT_MARGINprivate static java.lang.StringREQUEST_TABLE_ENDprivate static java.lang.StringREQUEST_TABLE_STARTprivate java.io.PrintWriterwriter
-
Constructor Summary
Constructors Constructor Description TroffPrinter(java.io.PrintWriter writer)TroffPrinter(java.io.PrintWriter writer, int indentation, TroffPrinter.BulletStyle style)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidappendLine(java.lang.String line)private java.lang.StringasArg(java.lang.String arg)voidendList()private java.lang.Stringescape(java.lang.String line)private java.lang.StringescapeArg(java.lang.String arg)voidfinish()voidflush()voidlineBreak()voidnextBulletedListItem()voidnextNumberedListItem()voidnextPlainListItem()voidnextSection(java.lang.String sectionTitle)voidnextTitledListItem()Moves to the next titled list item without providing a title.voidnextTitledListItem(java.lang.String title)protected voidnotInList()private voidprepareLine()voidprint(java.lang.String value)voidprintBold(java.lang.String value)voidprintBoldItalic(java.lang.String value)protected voidprintBullet()voidprintItalic(java.lang.String value)voidprintln()voidprintln(java.lang.String value)protected voidprintNumberedBullet(boolean first)protected voidprintPlainBullet()voidprintTable(java.util.List<java.util.List<java.lang.String>> rows, boolean hasHeader)protected voidprintTitledBullet()voidstart(java.lang.String title, int manSection)voidstart(java.lang.String title, int manSection, java.lang.String header, java.lang.String footer, java.lang.String footerExtra)voidstartBulletedList()voidstartNumberedList()voidstartPlainList()voidstartTitledList()Starts a titled list, the next line of text printed will form the titlevoidstartTitledList(java.lang.String title)Starts a titled list with the given title
-
-
-
Field Detail
-
REQUEST_TABLE_END
private static final java.lang.String REQUEST_TABLE_END
- See Also:
- Constant Field Values
-
REQUEST_TABLE_START
private static final java.lang.String REQUEST_TABLE_START
- See Also:
- Constant Field Values
-
REQUEST_FONT_ROMAN
private static final java.lang.String REQUEST_FONT_ROMAN
- See Also:
- Constant Field Values
-
REQUEST_FONT_BOLD
private static final java.lang.String REQUEST_FONT_BOLD
- See Also:
- Constant Field Values
-
REQUEST_FONT_ITALIC
private static final java.lang.String REQUEST_FONT_ITALIC
- See Also:
- Constant Field Values
-
REQUEST_FONT_BOLD_ITALIC
private static final java.lang.String REQUEST_FONT_BOLD_ITALIC
- See Also:
- Constant Field Values
-
REQUEST_PARAGRAPH_TITLED
private static final java.lang.String REQUEST_PARAGRAPH_TITLED
- See Also:
- Constant Field Values
-
REQUEST_PARAGRAPH_CURRENT_INDENTATION
private static final java.lang.String REQUEST_PARAGRAPH_CURRENT_INDENTATION
- See Also:
- Constant Field Values
-
REQUEST_PARAGRAPH_NO_INDENTATION
private static final java.lang.String REQUEST_PARAGRAPH_NO_INDENTATION
- See Also:
- Constant Field Values
-
REQUEST_RESET_LEFT_MARGIN
private static final java.lang.String REQUEST_RESET_LEFT_MARGIN
- See Also:
- Constant Field Values
-
REQUEST_MOVE_LEFT_MARGIN
private static final java.lang.String REQUEST_MOVE_LEFT_MARGIN
- See Also:
- Constant Field Values
-
REQUEST_BREAK
private static final java.lang.String REQUEST_BREAK
- See Also:
- Constant Field Values
-
BULLET_STYLE_BULLET
private static final java.lang.String BULLET_STYLE_BULLET
- See Also:
- Constant Field Values
-
BULLET_STYLE_DASH
private static final java.lang.String BULLET_STYLE_DASH
- See Also:
- Constant Field Values
-
BULLET_STYLE_EM_DASH
private static final java.lang.String BULLET_STYLE_EM_DASH
- See Also:
- Constant Field Values
-
DEFAULT_INDENTATION
private static final int DEFAULT_INDENTATION
- See Also:
- Constant Field Values
-
writer
private final java.io.PrintWriter writer
-
level
private int level
-
newline
private boolean newline
-
inSection
private boolean inSection
-
indentation
private final int indentation
- See Also:
- Constant Field Values
-
lists
private java.util.Stack<TroffPrinter.ListType> lists
-
listGlyph
private final java.lang.String listGlyph
-
-
Constructor Detail
-
TroffPrinter
public TroffPrinter(java.io.PrintWriter writer)
-
TroffPrinter
public TroffPrinter(java.io.PrintWriter writer, int indentation, TroffPrinter.BulletStyle style)
-
-
Method Detail
-
start
public void start(java.lang.String title, int manSection)
-
start
public void start(java.lang.String title, int manSection, java.lang.String header, java.lang.String footer, java.lang.String footerExtra)
-
nextSection
public void nextSection(java.lang.String sectionTitle)
-
print
public void print(java.lang.String value)
-
println
public void println(java.lang.String value)
-
println
public void println()
-
lineBreak
public void lineBreak()
-
printBold
public void printBold(java.lang.String value)
-
printItalic
public void printItalic(java.lang.String value)
-
printBoldItalic
public void printBoldItalic(java.lang.String value)
-
appendLine
private void appendLine(java.lang.String line)
-
startBulletedList
public void startBulletedList()
-
startPlainList
public void startPlainList()
-
startNumberedList
public void startNumberedList()
-
startTitledList
public void startTitledList()
Starts a titled list, the next line of text printed will form the title
-
startTitledList
public void startTitledList(java.lang.String title)
Starts a titled list with the given title- Parameters:
title-
-
nextBulletedListItem
public void nextBulletedListItem()
-
nextPlainListItem
public void nextPlainListItem()
-
notInList
protected void notInList()
-
nextNumberedListItem
public void nextNumberedListItem()
-
nextTitledListItem
public void nextTitledListItem()
Moves to the next titled list item without providing a title. The next line of text written will therefore be treated as the title for this item.
-
nextTitledListItem
public void nextTitledListItem(java.lang.String title)
-
endList
public void endList()
-
printTable
public void printTable(java.util.List<java.util.List<java.lang.String>> rows, boolean hasHeader)
-
prepareLine
private void prepareLine()
-
printBullet
protected void printBullet()
-
printTitledBullet
protected void printTitledBullet()
-
printPlainBullet
protected void printPlainBullet()
-
printNumberedBullet
protected void printNumberedBullet(boolean first)
-
asArg
private java.lang.String asArg(java.lang.String arg)
-
escapeArg
private java.lang.String escapeArg(java.lang.String arg)
-
escape
private java.lang.String escape(java.lang.String line)
-
flush
public void flush()
-
finish
public void finish()
-
-