public class OwHTMLHelper extends Object
Utility class for HTML creation.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Constructor and Description |
---|
OwHTMLHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
encodeJavascriptString(String in_p)
Replaces all JavaScript Special characters with their backslash based escape sequence.
|
static String |
encodeJavascriptString(String in_p,
boolean useUnicodeEscapes_p)
Replaces all JavaScript Special characters with their escape sequence.
Depending on the value of the useUnicodeEscapes_p parameter unicode escape sequences or backslash escape sequences can be used. |
static String |
encodeJavascriptVariableName(String input_p)
Replace illegal '-' char with '_' to obtain a legal JavaScript variable name.
|
static String |
encodeToSecureHTML(String sText_p)
convert the given text to a string with HTML tags and special chars for HTML display
|
static void |
writeSecureHTML(Writer w_p,
String sText_p)
write the given text and convert HTML tags and special chars
|
static void |
writeSecureHTML(Writer w_p,
String sText_p,
boolean encodeEnter_p)
write the given text and convert HTML tags and special chars
|
public static String encodeToSecureHTML(String sText_p) throws IOException
sText_p
- the text that have to be convertedIOException
public static void writeSecureHTML(Writer w_p, String sText_p) throws IOException
w_p
- writersText_p
- text to be convertedIOException
public static void writeSecureHTML(Writer w_p, String sText_p, boolean encodeEnter_p) throws IOException
w_p
- writersText_p
- text to be convertedencodeEnter_p
- flag for also encoding the ENTER char to IOException
public static String encodeJavascriptString(String in_p)
in_p
- String input to be encodedpublic static String encodeJavascriptVariableName(String input_p)
input_p
- - the input stringpublic static String encodeJavascriptString(String in_p, boolean useUnicodeEscapes_p)
in_p
- String input to be encodeduseUnicodeEscapes_p
- if true
special characters are using only
unicode escape sequencesCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.