com.tecnick.htmlutils.htmlentities
Class HTMLEntities

java.lang.Object
  extended by com.tecnick.htmlutils.htmlentities.HTMLEntities

public class HTMLEntities
extends Object

Collection of static methods to convert special and extended characters into HTML entitities and vice versa.

Copyright (c) 2004-2005 Tecnick.com S.r.l (www.tecnick.com) Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
Project homepage: http://htmlentities.sourceforge.net
License: http://www.gnu.org/copyleft/lesser.html LGPL

Version:
1.0.004
Author:
Nicola Asuni [www.tecnick.com].

Constructor Summary
HTMLEntities()
          Initialize HTML translation maps.
 
Method Summary
static Object[][] getEntitiesTable()
          Get the html entities translation table.
static String htmlAmpersand(String str)
          Replace & characters with & HTML entities.
static String htmlAngleBrackets(String str)
          Replace < > characters with &lt; &gt; entities.
static String htmlDoubleQuotes(String str)
          Replace double quotes characters with HTML entities.
static String htmlentities(String str)
          Convert special and extended characters into HTML entitities.
static String htmlQuotes(String str)
          Replace single and double quotes characters with HTML entities.
static String htmlSingleQuotes(String str)
          Replace single quotes characters with HTML entities.
static String unhtmlAmpersand(String str)
          Replace &amp; HTML entities with & characters.
static String unhtmlAngleBrackets(String str)
          Replace &lt; &gt; entities with < > characters.
static String unhtmlDoubleQuotes(String str)
          Replace single quotes HTML entities with equivalent character.
static String unhtmlentities(String str)
          Convert HTML entities to special and extended unicode characters equivalents.
static String unhtmlQuotes(String str)
          Replace single and double quotes HTML entities with equivalent characters.
static String unhtmlSingleQuotes(String str)
          Replace single quotes HTML entities with equivalent character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLEntities

public HTMLEntities()
Initialize HTML translation maps.

Method Detail

getEntitiesTable

public static Object[][] getEntitiesTable()
Get the html entities translation table.

Returns:
translation table

htmlentities

public static String htmlentities(String str)
Convert special and extended characters into HTML entitities.

Parameters:
str - input string
Returns:
formatted string
See Also:
unhtmlentities(String)

unhtmlentities

public static String unhtmlentities(String str)
Convert HTML entities to special and extended unicode characters equivalents.

Parameters:
str - input string
Returns:
formatted string
See Also:
htmlentities(String)

htmlSingleQuotes

public static String htmlSingleQuotes(String str)
Replace single quotes characters with HTML entities.

Parameters:
str - the input string
Returns:
string with replaced single quotes

unhtmlSingleQuotes

public static String unhtmlSingleQuotes(String str)
Replace single quotes HTML entities with equivalent character.

Parameters:
str - the input string
Returns:
string with replaced single quotes

htmlDoubleQuotes

public static String htmlDoubleQuotes(String str)
Replace double quotes characters with HTML entities.

Parameters:
str - the input string
Returns:
string with replaced double quotes

unhtmlDoubleQuotes

public static String unhtmlDoubleQuotes(String str)
Replace single quotes HTML entities with equivalent character.

Parameters:
str - the input string
Returns:
string with replaced single quotes

htmlQuotes

public static String htmlQuotes(String str)
Replace single and double quotes characters with HTML entities.

Parameters:
str - the input string
Returns:
string with replaced quotes

unhtmlQuotes

public static String unhtmlQuotes(String str)
Replace single and double quotes HTML entities with equivalent characters.

Parameters:
str - the input string
Returns:
string with replaced quotes

htmlAngleBrackets

public static String htmlAngleBrackets(String str)
Replace < > characters with &lt; &gt; entities.

Parameters:
str - the input string
Returns:
string with replaced characters

unhtmlAngleBrackets

public static String unhtmlAngleBrackets(String str)
Replace &lt; &gt; entities with < > characters.

Parameters:
str - the input string
Returns:
string with replaced entities

htmlAmpersand

public static String htmlAmpersand(String str)
Replace & characters with &amp; HTML entities.

Parameters:
str - the input string
Returns:
string with replaced characters

unhtmlAmpersand

public static String unhtmlAmpersand(String str)
Replace &amp; HTML entities with & characters.

Parameters:
str - the input string
Returns:
string with replaced entities


Copyright © 2011. All Rights Reserved.