org.apache.myfaces.shared_tomahawk.renderkit.html.util
Class HTMLEncoder

java.lang.Object
  extended by org.apache.myfaces.shared_tomahawk.renderkit.html.util.HTMLEncoder

public abstract class HTMLEncoder
extends Object

Converts Strings so that they can be used within HTML-Code.


Constructor Summary
HTMLEncoder()
           
 
Method Summary
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 encodeURIAtributte(String string, String characterEncoding)
          Encode an URI, escaping or percent-encoding all required characters and following the rules mentioned on RFC 3986.
static void encodeURIAtributte(Writer writer, String string, String characterEncoding)
          Encode an URI, escaping or percent-encoding all required characters and following the rules mentioned on RFC 3986.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLEncoder

public HTMLEncoder()
Method Detail

encode

public static String encode(String string)
Variant of encode(java.lang.String) where encodeNewline is false and encodeNbsp is true.


encode

public static String encode(String string,
                            boolean encodeNewline)
Variant of encode(java.lang.String) where encodeNbsp is true.


encode

public static String encode(String string,
                            boolean encodeNewline,
                            boolean encodeSubsequentBlanksToNbsp)
Variant of encode(java.lang.String) where encodeNbsp and encodeNonLatin are true


encode

public 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.

Parameters:
string - the string to convert
encodeNewline - if true newline characters are converted to <br>'s
encodeSubsequentBlanksToNbsp - if true subsequent blanks are converted to &nbsp;'s
encodeNonLatin - if true encode non-latin characters as numeric character references

encode

public static void encode(Writer writer,
                          String string)
                   throws IOException
Variant of encode(java.lang.String) where encodeNewline is false and encodeNbsp is true.

Throws:
IOException

encode

public static void encode(Writer writer,
                          String string,
                          boolean encodeNewline)
                   throws IOException
Variant of encode(java.lang.String) where encodeNbsp is true.

Throws:
IOException

encode

public static void encode(Writer writer,
                          String string,
                          boolean encodeNewline,
                          boolean encodeSubsequentBlanksToNbsp)
                   throws IOException
Variant of encode(java.lang.String) where encodeNbsp and encodeNonLatin are true

Throws:
IOException

encode

public static void encode(Writer writer,
                          String string,
                          boolean encodeNewline,
                          boolean encodeSubsequentBlanksToNbsp,
                          boolean encodeNonLatin)
                   throws IOException
Throws:
IOException

encode

public static void encode(char[] string,
                          int offset,
                          int length,
                          Writer writer)
                   throws IOException
Variant of encode(java.lang.String) where encodeNewline is false and encodeNbsp is true.

Throws:
IOException

encode

public static void encode(char[] string,
                          int offset,
                          int length,
                          boolean encodeNewline,
                          Writer writer)
                   throws IOException
Variant of encode(java.lang.String) where encodeNbsp is true.

Throws:
IOException

encode

public static void encode(char[] string,
                          int offset,
                          int length,
                          boolean encodeNewline,
                          boolean encodeSubsequentBlanksToNbsp,
                          Writer writer)
                   throws IOException
Variant of encode(java.lang.String) where encodeNbsp and encodeNonLatin are true

Throws:
IOException

encode

public static void encode(char[] string,
                          int offset,
                          int length,
                          boolean encodeNewline,
                          boolean encodeSubsequentBlanksToNbsp,
                          boolean encodeNonLatin,
                          Writer writer)
                   throws IOException
Encodes the given string, so that it can be used within a html page.

Parameters:
string - the string to convert
encodeNewline - if true newline characters are converted to <br>'s
encodeSubsequentBlanksToNbsp - if true subsequent blanks are converted to &nbsp;'s
encodeNonLatin - if true encode non-latin characters as numeric character references
Throws:
IOException

encodeURIAtributte

public static String encodeURIAtributte(String string,
                                        String characterEncoding)
                                 throws IOException
Encode an URI, escaping or percent-encoding all required characters and following the rules mentioned on RFC 3986.

Parameters:
string -
encodeNonLatin -
Returns:
Throws:
IOException

encodeURIAtributte

public static void encodeURIAtributte(Writer writer,
                                      String string,
                                      String characterEncoding)
                               throws IOException
Encode an URI, escaping or percent-encoding all required characters and following the rules mentioned on RFC 3986.

Parameters:
string -
encodeNonLatin -
Throws:
IOException


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.