public class HtmlFormatHelper extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static org.apache.log4j.Logger |
logger |
static int |
TAB_WIDTH
If developers have tabs in their source code, we cannot emit them
in HTML, so will convert them to N non-breaking spaces per tab,
where N is this constant.
|
Constructor and Description |
---|
HtmlFormatHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
drainInputStream(java.io.InputStream in,
java.io.PrintWriter writer)
Since this is HTML, we'll want to encode the incoming file
according to the HTML encoding we're using, so this
implementation just delegates to
drainReader(java.io.Reader,java.io.PrintWriter) . |
static void |
drainReader(java.io.Reader in,
java.io.PrintWriter writer) |
(package private) static java.lang.String |
replace(java.lang.String original,
java.lang.String toFind,
java.lang.String replaceWith) |
static java.lang.String |
replaceCharacterEntities(java.lang.String original) |
static java.lang.String |
untabify(java.lang.String original,
int tabwidth) |
static org.apache.log4j.Logger logger
public static final int TAB_WIDTH
It is recommended that developers avoid using tabs for reasons of code portability.
public HtmlFormatHelper()
public static java.lang.String untabify(java.lang.String original, int tabwidth)
public static java.lang.String replaceCharacterEntities(java.lang.String original)
static java.lang.String replace(java.lang.String original, java.lang.String toFind, java.lang.String replaceWith)
public static void drainInputStream(java.io.InputStream in, java.io.PrintWriter writer) throws java.io.IOException
drainReader(java.io.Reader,java.io.PrintWriter)
.
For now, use the platform default encoding, but this can change later.
java.io.IOException
public static void drainReader(java.io.Reader in, java.io.PrintWriter writer) throws java.io.IOException
java.io.IOException