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

## com.mindprod.entities
Class InsertEntities

    java.lang.Object
      com.mindprod.entities.InsertEntities

Direct Known Subclasses:
  InsertFileEntities

    public class InsertEntities

extends java.lang.Object

Inserts HTML entities such as " into a String replacing the single character equivalents.

Entities are coded inline in a giant case.

Since:
  2005
Version:
  2.9 2010-01-29 - export XHTML entities (currently same as HTML-4 entities).
Author:
  Roedy Green, Canadian Mind Products
See Also:
  `InsertEntities()`, `#InsertFileEntities`, `#StripEntities`, `#StripFileEntities`

Constructor Summary
`InsertEntities()`

Method Summary
`static java.lang.String` | `charToHTMLEntity(char c)` convert a single char to its equivalent HTML entity.
`static java.lang.String` | `charToXMLEntity(char c)` convert a single char to its equivalent XML entity.
`static java.lang.String` | `insertEntities(java.lang.String text)` Deprecated. use insertHTMLEntities or insertXMLEntities
`static java.lang.String` | `insertHTMLEntities(java.lang.String text)` Converts text to HTML by quoting dangerous characters.
`static java.lang.String` | `insertNbsp(java.lang.String text)` Deprecated. use insertHTML entities
`static java.lang.String` | `insertXMLEntities(java.lang.String text)` Converts text to XML by quoting dangerous characters.

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

Constructor Detail

### InsertEntities

    public InsertEntities()

Method Detail

### charToHTMLEntity

    public static java.lang.String charToHTMLEntity(char c)

  convert a single char to its equivalent HTML entity. Ordinary chars are not changed. 160 -> weird chars -> &#nnn; form

  Parameters:
    `c` - Char to convert
  Returns:
    equivalent string e.g. &, null means leave char as is.

### charToXMLEntity

    public static java.lang.String charToXMLEntity(char c)

  convert a single char to its equivalent XML entity. Ordinary chars are not changed. 160 -> weird chars -> &#nnn; form

  Parameters:
    `c` - Char to convert
  Returns:
    equivalent string e.g. &, null means leave char as is.

### insertEntities

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

  Deprecated. use insertHTMLEntities or insertXMLEntities

  Converts text to HTML by quoting dangerous characters. Text must not already contain entities. e.g. " ==> " < ==> < ordinary text passes unchanged. Does not convert space to

  Parameters:
    `text` - raw text to be processed. Must not be null.
  Returns:
    translated HTML text, or null if input is null.

### insertHTMLEntities

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

  Converts text to HTML by quoting dangerous characters. Text must not already contain entities. e.g. " ==> " < ==> < ordinary text passes unchanged. Does not convert space to

  Parameters:
    `text` - raw text to be processed. Must not be null.
  Returns:
    translated HTML text, or null if input is null.

### insertNbsp

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

  Deprecated. use insertHTML entities

  converts all spaces to , including leading, embedded and trailing spaces.

  Parameters:
    `text` - Text to convert
  Returns:
    Text with spaces converted to entities. Null input gives null output.

### insertXMLEntities

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

  Converts text to XML by quoting dangerous characters. Text must not already contain entities. e.g. " ==> " < ==> < ordinary text passes unchanged. Does not convert space to

  Parameters:
    `text` - raw text to be processed. Must not be null.
  Returns:
    translated XML text, or null if input is null.

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