Module com.github.rvesse.airline.io
Class ColorizedWriter<T>
java.lang.Object
java.io.Writer
java.io.FilterWriter
com.github.rvesse.airline.io.writers.AnsiWriter
com.github.rvesse.airline.io.writers.ColorizedWriter<T>
- Type Parameters:
T
- Color type
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
- Direct Known Subclasses:
Ansi256ColorizedWriter
,AnsiBasicColorizedWriter
,AnsiTrueColorizedWriter
An writer stream that supports colorization and basic text decorations
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WriterControlTracker
<T> protected WriterControlTracker
<BasicDecoration> protected WriterControlTracker
<T> protected WriterControlTracker
<BasicDecoration> protected WriterControlTracker
<BasicDecoration> protected WriterControlTracker
<BasicDecoration> Fields inherited from class java.io.FilterWriter
out
-
Constructor Summary
ConstructorsConstructorDescriptionColorizedWriter
(Writer writer, ControlCodeSource<T> foregroundColorSource, ControlCodeSource<T> backgroundColorSource) -
Method Summary
Modifier and TypeMethodDescriptionsetBackgroundColor
(T color) setBold
(boolean enabled) protected final ColorizedWriter
<T> setDecoration
(boolean enabled, BasicDecoration decoration, WriterControlTracker<BasicDecoration> control) setForegroundColor
(T color) setItalic
(boolean enabled) setStrikeThrough
(boolean enabled) setUnderline
(boolean enabled) Methods inherited from class com.github.rvesse.airline.io.writers.AnsiWriter
applyAll, close, registerControl, registerControls, resetAll, write, write, write
Methods inherited from class java.io.FilterWriter
flush
-
Field Details
-
foregroundControl
-
backgroundControl
-
bold
-
italic
-
underline
-
strikeThrough
-
-
Constructor Details
-
ColorizedWriter
public ColorizedWriter(Writer writer, ControlCodeSource<T> foregroundColorSource, ControlCodeSource<T> backgroundColorSource)
-
-
Method Details
-
setForegroundColor
-
resetForegroundColor
- Throws:
IOException
-
setBackgroundColor
-
resetBackgroundColor
- Throws:
IOException
-
setBold
- Throws:
IOException
-
setItalic
- Throws:
IOException
-
setUnderline
- Throws:
IOException
-
setStrikeThrough
- Throws:
IOException
-
setDecoration
protected final ColorizedWriter<T> setDecoration(boolean enabled, BasicDecoration decoration, WriterControlTracker<BasicDecoration> control) throws IOException - Throws:
IOException
-