Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## echopointng.util
Class HtmlKit

    java.lang.Object
      echopointng.util.HtmlKit

    public class HtmlKit

extends java.lang.Object

Encodes text strings into HTML.

Field Summary
`static int` | `NEWLINE_REMOVE`
`static int` | `NEWLINE_TO_BR`
`static int` | `NEWLINE_TO_SPACE`
`static int` | `NEWLINE_TRANSPARENT`

Method Summary
`static java.lang.String` | `encode(java.lang.String text)` Encodes a string of text into HTML by replacing less than, greater than, ampersand, and quotation mark characters with their HTML escaped equivalents.
`static java.lang.String` | `encode(java.lang.String text, int newLinePolicy)` Encodes a string of text into HTML by replacing less than, greater than, ampersand, and quotation mark characters with their HTML escaped equivalents.
`static org.w3c.dom.Node[]` | `encodeNewLines(org.w3c.dom.Document document, java.lang.String text, int newLinePolicy)` Encodes a string of text into DOM Nodes by taking new lines and replacing them aoccording to the policy provided.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NEWLINE_TRANSPARENT

    public static final int NEWLINE_TRANSPARENT

See Also:
  Constant Field Values

### NEWLINE_TO_SPACE

    public static final int NEWLINE_TO_SPACE

See Also:
  Constant Field Values

### NEWLINE_TO_BR

    public static final int NEWLINE_TO_BR

See Also:
  Constant Field Values

### NEWLINE_REMOVE

    public static final int NEWLINE_REMOVE

See Also:
  Constant Field Values

Method Detail

### encode

    public static java.lang.String encode(java.lang.String text)

  Encodes a string of text into HTML by replacing less than, greater than, ampersand, and quotation mark characters with their HTML escaped equivalents. Groups of spaces are replaced with alternating spaces and non-breaking space characters.

  Parameters:
    `text` - The text to be encoded into HTML.
  Returns:
    The text, converted to HTML. Newlines will be left intact, NOT translated to <br> tags.

### encode

    public static java.lang.String encode(java.lang.String text,
                                          int newLinePolicy)

  Encodes a string of text into HTML by replacing less than, greater than, ampersand, and quotation mark characters with their HTML escaped equivalents. Groups of spaces are replaced with alternating spaces and non-breaking space characters.

  Parameters:
    `text` - The text to be encoded into HTML.
    `newLinePolicy` - The policy for handling newline characters, one of the following values:
    - NEWLINE_TRANSPARENT - Leave newline characters intact.
    - NEWLINE_TO_SPACE - Convert newlines to spaces.
    - NEWLINE_TO_BR - Convert newlines to <br> tags.
    - NEWLINE_REMOVE - Remove newlines entirely.
  Returns:
    The text, converted to HTML.

### encodeNewLines

    public static org.w3c.dom.Node[] encodeNewLines(org.w3c.dom.Document document,
                                                    java.lang.String text,
                                                    int newLinePolicy)

  Encodes a string of text into DOM Nodes by taking new lines and replacing them aoccording to the policy provided.

  Parameters:
    `text` - The text to be encoded into DOM Nodes.
    `newLinePolicy` - The policy for handling newline characters, one of the following values:
    - NEWLINE_TRANSPARENT - Leave newline characters intact.
    - NEWLINE_TO_SPACE - Convert newlines to spaces.
    - NEWLINE_TO_BR - Convert newlines to <br> tags.
    - NEWLINE_REMOVE - Remove newlines entirely.
  Returns:
    The text, converted to an array of DOM Nodes.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD