Liferay 6.2-ce-ga5

com.liferay.portal.util
Class HtmlImpl

java.lang.Object
  extended by com.liferay.portal.util.HtmlImpl
All Implemented Interfaces:
Html

public class HtmlImpl
extends Object
implements Html


Field Summary
static int ESCAPE_MODE_ATTRIBUTE
           
static int ESCAPE_MODE_CSS
           
static int ESCAPE_MODE_JS
           
static int ESCAPE_MODE_TEXT
           
static int ESCAPE_MODE_URL
           
 
Constructor Summary
HtmlImpl()
           
 
Method Summary
 String escape(String text)
          Escapes the text so that it is safe to use in an HTML context.
 String escape(String text, int type)
           
 String escapeAttribute(String attribute)
           
 String escapeCSS(String css)
           
 String escapeHREF(String href)
           
 String escapeJS(String js)
           
 String escapeURL(String url)
           
 String escapeXPath(String xPath)
           
 String escapeXPathAttribute(String xPathAttribute)
           
 String extractText(String html)
           
 String fromInputSafe(String text)
           
 String getAUICompatibleId(String text)
           
protected  boolean isTag(char[] tag, String text, int pos)
           
 String render(String html)
          Deprecated. 
 String replaceMsWordCharacters(String text)
           
 String replaceNewLine(String text)
           
 String stripBetween(String text, String tag)
           
 String stripComments(String text)
           
 String stripHtml(String text)
           
protected  int stripTag(char[] tag, String text, int pos)
           
 String toInputSafe(String text)
           
 String unescape(String text)
           
 String unescapeCDATA(String text)
           
 String wordBreak(String text, int columns)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESCAPE_MODE_ATTRIBUTE

public static final int ESCAPE_MODE_ATTRIBUTE
See Also:
Constant Field Values

ESCAPE_MODE_CSS

public static final int ESCAPE_MODE_CSS
See Also:
Constant Field Values

ESCAPE_MODE_JS

public static final int ESCAPE_MODE_JS
See Also:
Constant Field Values

ESCAPE_MODE_TEXT

public static final int ESCAPE_MODE_TEXT
See Also:
Constant Field Values

ESCAPE_MODE_URL

public static final int ESCAPE_MODE_URL
See Also:
Constant Field Values
Constructor Detail

HtmlImpl

public HtmlImpl()
Method Detail

escape

public String escape(String text)
Escapes the text so that it is safe to use in an HTML context.

Specified by:
escape in interface Html
Parameters:
text - the text to escape
Returns:
the escaped HTML text, or null if the text is null

escape

public String escape(String text,
                     int type)
Specified by:
escape in interface Html

escapeAttribute

public String escapeAttribute(String attribute)
Specified by:
escapeAttribute in interface Html

escapeCSS

public String escapeCSS(String css)
Specified by:
escapeCSS in interface Html

escapeHREF

public String escapeHREF(String href)
Specified by:
escapeHREF in interface Html

escapeJS

public String escapeJS(String js)
Specified by:
escapeJS in interface Html

escapeURL

public String escapeURL(String url)
Specified by:
escapeURL in interface Html

escapeXPath

public String escapeXPath(String xPath)
Specified by:
escapeXPath in interface Html

escapeXPathAttribute

public String escapeXPathAttribute(String xPathAttribute)
Specified by:
escapeXPathAttribute in interface Html

extractText

public String extractText(String html)
Specified by:
extractText in interface Html

fromInputSafe

public String fromInputSafe(String text)
Specified by:
fromInputSafe in interface Html

getAUICompatibleId

public String getAUICompatibleId(String text)
Specified by:
getAUICompatibleId in interface Html

render

@Deprecated
public String render(String html)
Deprecated. 

Specified by:
render in interface Html

replaceMsWordCharacters

public String replaceMsWordCharacters(String text)
Specified by:
replaceMsWordCharacters in interface Html

replaceNewLine

public String replaceNewLine(String text)
Specified by:
replaceNewLine in interface Html

stripBetween

public String stripBetween(String text,
                           String tag)
Specified by:
stripBetween in interface Html

stripComments

public String stripComments(String text)
Specified by:
stripComments in interface Html

stripHtml

public String stripHtml(String text)
Specified by:
stripHtml in interface Html

toInputSafe

public String toInputSafe(String text)
Specified by:
toInputSafe in interface Html

unescape

public String unescape(String text)
Specified by:
unescape in interface Html

unescapeCDATA

public String unescapeCDATA(String text)
Specified by:
unescapeCDATA in interface Html

wordBreak

public String wordBreak(String text,
                        int columns)
Specified by:
wordBreak in interface Html

isTag

protected boolean isTag(char[] tag,
                        String text,
                        int pos)

stripTag

protected int stripTag(char[] tag,
                       String text,
                       int pos)

Liferay 6.2-ce-ga5