chemaxon.util
Class HTMLUtil

java.lang.Object
  extended by chemaxon.util.HTMLUtil

public final class HTMLUtil
extends java.lang.Object

Utility class for string conversions in HTML / JavaScript.

Since:
Marvin 4.1
Version:
5.0 04/05/2007
Author:
Nora Mate, Tamas Vertse

Constructor Summary
HTMLUtil()
           
 
Method Summary
static java.lang.String convertBase64Gzip2Text(java.lang.String str)
          Converts gzip compressed data with base64 encoding to text.
static java.lang.String convertForJavaScript(java.lang.String input)
          Converts a string to a format that can be used as a value of JavaScript variable in an HTML page.
static java.lang.String replaceString(java.lang.String input, java.lang.String query, java.lang.String replacement)
          Deprecated. as of Marvin 5.0, replaced by chemaxon.util.StringUtil.replaceAll(String,String,String)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLUtil

public HTMLUtil()
Method Detail

replaceString

public static java.lang.String replaceString(java.lang.String input,
                                             java.lang.String query,
                                             java.lang.String replacement)
Deprecated. as of Marvin 5.0, replaced by chemaxon.util.StringUtil.replaceAll(String,String,String)

Replaces the occurences of a string with another one in a third string. For example, useful for inserting molfiles into script generated HTML pages.

Parameters:
input - original string
query - string to be replaced
replacement - string that will replace all occurences of the query string
Returns:
the modified string.

convertForJavaScript

public static java.lang.String convertForJavaScript(java.lang.String input)
Converts a string to a format that can be used as a value of JavaScript variable in an HTML page. Converts line separators to UNIX style and replaces new line characters with a backslash and an "n" character.

Parameters:
input - original string containing line terminators
Returns:
the modified string.

convertBase64Gzip2Text

public static java.lang.String convertBase64Gzip2Text(java.lang.String str)
Converts gzip compressed data with base64 encoding to text.

Parameters:
str - encoded data
Returns:
decoded data. If the data is not encoded, returns with the input value.