Package org.fusesource.jansi
Class HtmlAnsiOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.fusesource.jansi.AnsiOutputStream
-
- org.fusesource.jansi.HtmlAnsiOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class HtmlAnsiOutputStream extends AnsiOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]ANSI_COLOR_MAPprivate static byte[]BYTES_AMPprivate static byte[]BYTES_GTprivate static byte[]BYTES_LTprivate static byte[]BYTES_QUOTprivate java.util.List<java.lang.String>closingAttributesprivate booleanconcealOn-
Fields inherited from class org.fusesource.jansi.AnsiOutputStream
ATTRIBUTE_BLINK_FAST, ATTRIBUTE_BLINK_OFF, ATTRIBUTE_BLINK_SLOW, ATTRIBUTE_CONCEAL_OFF, ATTRIBUTE_CONCEAL_ON, ATTRIBUTE_INTENSITY_BOLD, ATTRIBUTE_INTENSITY_FAINT, ATTRIBUTE_INTENSITY_NORMAL, ATTRIBUTE_ITALIC, ATTRIBUTE_NEGATIVE_Off, ATTRIBUTE_NEGATIVE_OFF, ATTRIBUTE_NEGATIVE_ON, ATTRIBUTE_UNDERLINE, ATTRIBUTE_UNDERLINE_DOUBLE, ATTRIBUTE_UNDERLINE_OFF, BLACK, BLUE, CYAN, ERASE_LINE, ERASE_LINE_TO_BEGINING, ERASE_LINE_TO_END, ERASE_SCREEN, ERASE_SCREEN_TO_BEGINING, ERASE_SCREEN_TO_END, GREEN, MAGENTA, RED, RESET_CODE, REST_CODE, state, WHITE, YELLOW
-
-
Constructor Summary
Constructors Constructor Description HtmlAnsiOutputStream(java.io.OutputStream os)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private voidcloseAttributes()protected voidprocessAttributeRest()processSGR 0corresponding toReset / Normalprotected voidprocessSetAttribute(int attribute)processSGRother than0(reset),30-39(foreground),40-49(background),90-97(foreground high intensity) or100-107(background high intensity)protected voidprocessSetBackgroundColor(int color, boolean bright)processSGR 40-47orSGR 100-107corresponding toSet background coloreither in normal mode or high intensity.protected voidprocessSetForegroundColor(int color, boolean bright)processSGR 30-37orSGR 90-97corresponding toSet text color (foreground)either in normal mode or high intensity.voidwrite(int data)private voidwrite(java.lang.String s)private voidwriteAttribute(java.lang.String s)voidwriteLine(byte[] buf, int offset, int len)-
Methods inherited from class org.fusesource.jansi.AnsiOutputStream
processChangeIconName, processChangeIconNameAndWindowTitle, processChangeWindowTitle, processCharsetSelect, processCursorDown, processCursorDownLine, processCursorLeft, processCursorRight, processCursorTo, processCursorToColumn, processCursorUp, processCursorUpLine, processDefaultBackgroundColor, processDefaultTextColor, processDeleteLine, processEraseLine, processEraseScreen, processInsertLine, processRestoreCursorPosition, processSaveCursorPosition, processScrollDown, processScrollUp, processSetBackgroundColor, processSetBackgroundColorExt, processSetBackgroundColorExt, processSetForegroundColor, processSetForegroundColorExt, processSetForegroundColorExt, processUnknownExtension, processUnknownOperatingSystemCommand
-
-
-
-
Field Detail
-
concealOn
private boolean concealOn
-
ANSI_COLOR_MAP
private static final java.lang.String[] ANSI_COLOR_MAP
-
BYTES_QUOT
private static final byte[] BYTES_QUOT
-
BYTES_AMP
private static final byte[] BYTES_AMP
-
BYTES_LT
private static final byte[] BYTES_LT
-
BYTES_GT
private static final byte[] BYTES_GT
-
closingAttributes
private final java.util.List<java.lang.String> closingAttributes
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classAnsiOutputStream- Throws:
java.io.IOException
-
write
private void write(java.lang.String s) throws java.io.IOException- Throws:
java.io.IOException
-
writeAttribute
private void writeAttribute(java.lang.String s) throws java.io.IOException- Throws:
java.io.IOException
-
closeAttributes
private void closeAttributes() throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(int data) throws java.io.IOExceptionDescription copied from class:AnsiOutputStream- Overrides:
writein classAnsiOutputStream- Throws:
java.io.IOException
-
writeLine
public void writeLine(byte[] buf, int offset, int len) throws java.io.IOException- Throws:
java.io.IOException
-
processSetAttribute
protected void processSetAttribute(int attribute) throws java.io.IOExceptionDescription copied from class:AnsiOutputStreamprocessSGRother than0(reset),30-39(foreground),40-49(background),90-97(foreground high intensity) or100-107(background high intensity)- Overrides:
processSetAttributein classAnsiOutputStream- Parameters:
attribute- attribute- Throws:
java.io.IOException- IOException- See Also:
AnsiOutputStream.processAttributeRest(),AnsiOutputStream.processSetForegroundColor(int),AnsiOutputStream.processSetForegroundColor(int, boolean),AnsiOutputStream.processSetForegroundColorExt(int),AnsiOutputStream.processSetForegroundColorExt(int, int, int),AnsiOutputStream.processDefaultTextColor(),AnsiOutputStream.processDefaultBackgroundColor()
-
processAttributeRest
protected void processAttributeRest() throws java.io.IOExceptionDescription copied from class:AnsiOutputStreamprocessSGR 0corresponding toReset / Normal- Overrides:
processAttributeRestin classAnsiOutputStream- Throws:
java.io.IOException- IOException
-
processSetForegroundColor
protected void processSetForegroundColor(int color, boolean bright) throws java.io.IOExceptionDescription copied from class:AnsiOutputStreamprocessSGR 30-37orSGR 90-97corresponding toSet text color (foreground)either in normal mode or high intensity.- Overrides:
processSetForegroundColorin classAnsiOutputStream- Parameters:
color- the text colorbright- is high intensity?- Throws:
java.io.IOException- IOException
-
processSetBackgroundColor
protected void processSetBackgroundColor(int color, boolean bright) throws java.io.IOExceptionDescription copied from class:AnsiOutputStreamprocessSGR 40-47orSGR 100-107corresponding toSet background coloreither in normal mode or high intensity.- Overrides:
processSetBackgroundColorin classAnsiOutputStream- Parameters:
color- the background colorbright- is high intensity?- Throws:
java.io.IOException- IOException
-
-