public abstract class HTMLEncoder extends Object
Constructor and Description |
---|
HTMLEncoder() |
Modifier and Type | Method and Description |
---|---|
static void |
encode(char[] string,
int offset,
int length,
boolean encodeNewline,
boolean encodeSubsequentBlanksToNbsp,
boolean encodeNonLatin,
Writer writer)
Encodes the given string, so that it can be used within a html page.
|
static void |
encode(char[] string,
int offset,
int length,
boolean encodeNewline,
boolean encodeSubsequentBlanksToNbsp,
Writer writer)
Variant of
encode(java.lang.String) where encodeNbsp and encodeNonLatin are true |
static void |
encode(char[] string,
int offset,
int length,
boolean encodeNewline,
Writer writer)
Variant of
encode(java.lang.String) where encodeNbsp is true. |
static void |
encode(char[] string,
int offset,
int length,
Writer writer)
Variant of
encode(java.lang.String) where encodeNewline is false and encodeNbsp is true. |
static String |
encode(String string)
Variant of
encode(java.lang.String) where encodeNewline is false and encodeNbsp is true. |
static String |
encode(String string,
boolean encodeNewline)
Variant of
encode(java.lang.String) where encodeNbsp is true. |
static String |
encode(String string,
boolean encodeNewline,
boolean encodeSubsequentBlanksToNbsp)
Variant of
encode(java.lang.String) where encodeNbsp and encodeNonLatin are true |
static String |
encode(String string,
boolean encodeNewline,
boolean encodeSubsequentBlanksToNbsp,
boolean encodeNonLatin)
Encodes the given string, so that it can be used within a html page.
|
static void |
encode(Writer writer,
String string)
Variant of
encode(java.lang.String) where encodeNewline is false and encodeNbsp is true. |
static void |
encode(Writer writer,
String string,
boolean encodeNewline)
Variant of
encode(java.lang.String) where encodeNbsp is true. |
static void |
encode(Writer writer,
String string,
boolean encodeNewline,
boolean encodeSubsequentBlanksToNbsp)
Variant of
encode(java.lang.String) where encodeNbsp and encodeNonLatin are true |
static void |
encode(Writer writer,
String string,
boolean encodeNewline,
boolean encodeSubsequentBlanksToNbsp,
boolean encodeNonLatin) |
static String |
encodeURIAttribute(String string,
String characterEncoding)
Encode an URI, escaping or percent-encoding all required characters and
following the rules mentioned on RFC 3986.
|
static void |
encodeURIAttribute(Writer writer,
String string,
String characterEncoding)
Encode an URI, escaping or percent-encoding all required characters and
following the rules mentioned on RFC 3986.
|
public static String encode(String string)
encode(java.lang.String)
where encodeNewline is false and encodeNbsp is true.public static String encode(String string, boolean encodeNewline)
encode(java.lang.String)
where encodeNbsp is true.public static String encode(String string, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp)
encode(java.lang.String)
where encodeNbsp and encodeNonLatin are truepublic static String encode(String string, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp, boolean encodeNonLatin)
string
- the string to convertencodeNewline
- if true newline characters are converted to <br>'sencodeSubsequentBlanksToNbsp
- if true subsequent blanks are converted to 'sencodeNonLatin
- if true encode non-latin characters as numeric character referencespublic static void encode(Writer writer, String string) throws IOException
encode(java.lang.String)
where encodeNewline is false and encodeNbsp is true.IOException
public static void encode(Writer writer, String string, boolean encodeNewline) throws IOException
encode(java.lang.String)
where encodeNbsp is true.IOException
public static void encode(Writer writer, String string, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp) throws IOException
encode(java.lang.String)
where encodeNbsp and encodeNonLatin are trueIOException
public static void encode(Writer writer, String string, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp, boolean encodeNonLatin) throws IOException
IOException
public static void encode(char[] string, int offset, int length, Writer writer) throws IOException
encode(java.lang.String)
where encodeNewline is false and encodeNbsp is true.IOException
public static void encode(char[] string, int offset, int length, boolean encodeNewline, Writer writer) throws IOException
encode(java.lang.String)
where encodeNbsp is true.IOException
public static void encode(char[] string, int offset, int length, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp, Writer writer) throws IOException
encode(java.lang.String)
where encodeNbsp and encodeNonLatin are trueIOException
public static void encode(char[] string, int offset, int length, boolean encodeNewline, boolean encodeSubsequentBlanksToNbsp, boolean encodeNonLatin, Writer writer) throws IOException
string
- the string to convertencodeNewline
- if true newline characters are converted to <br>'sencodeSubsequentBlanksToNbsp
- if true subsequent blanks are converted to 'sencodeNonLatin
- if true encode non-latin characters as numeric character referencesIOException
public static String encodeURIAttribute(String string, String characterEncoding) throws IOException
string
- encodeNonLatin
- IOException
public static void encodeURIAttribute(Writer writer, String string, String characterEncoding) throws IOException
string
- encodeNonLatin
- IOException
Copyright © 2020 The Apache Software Foundation. All rights reserved.