Class XdocsTemplateSink.CustomPrintWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.PrintWriter
-
- com.puppycrawl.tools.checkstyle.site.XdocsTemplateSink.CustomPrintWriter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
- Enclosing class:
- XdocsTemplateSink
private static final class XdocsTemplateSink.CustomPrintWriter extends PrintWriter
A Custom writer that only prints Unix-style newline character.
-
-
Field Summary
Fields Modifier and Type Field Description private static Pattern
LINE_BREAK_ESCAPE
A Regex pattern to represent all kinds of newline character.private static String
NEWLINE
Unix-Style newline character.-
Fields inherited from class java.io.PrintWriter
out
-
-
Constructor Summary
Constructors Modifier Constructor Description private
CustomPrintWriter(Writer writer)
Creates a new instance of this custom writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
println()
Enforces Unix-style newline character.void
write(String line, int offset, int length)
Unifies all newline characters to Unix-Style Newline character.-
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, setError, write, write, write, write
-
Methods inherited from class java.io.Writer
nullWriter
-
-
-
-
Field Detail
-
LINE_BREAK_ESCAPE
private static final Pattern LINE_BREAK_ESCAPE
A Regex pattern to represent all kinds of newline character.
-
NEWLINE
private static final String NEWLINE
Unix-Style newline character.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CustomPrintWriter
private CustomPrintWriter(Writer writer)
Creates a new instance of this custom writer.- Parameters:
writer
- not null writer to write the result
-
-
Method Detail
-
println
public void println()
Enforces Unix-style newline character.- Overrides:
println
in classPrintWriter
-
write
public void write(String line, int offset, int length)
Unifies all newline characters to Unix-Style Newline character.- Overrides:
write
in classPrintWriter
- Parameters:
line
- text that is to be written in the output file.offset
- starting offset value for writing data.length
- total length of string to be written.
-
-