com.isti.util
Class HtmlUtilFns

java.lang.Object
  extended by com.isti.util.HtmlUtilFns
All Implemented Interfaces:
HtmlConstants

public class HtmlUtilFns
extends java.lang.Object
implements HtmlConstants

Class HtmlUtilFns contains various static HTML utility methods.


Field Summary
static java.lang.String HTML_START_TAG
          HTML start tag, any HTML strings should start with this.
 
Fields inherited from interface com.isti.util.HtmlConstants
ANCHOR_ELEMENT, BOLD_ELEMENT, COLOR_ATTRIBUTE, FONT_ELEMENT, HORIZONTAL_RULE_ELEMENT, HREF_ATTRIBUTE, HTML_ELEMENT, LINE_BREAK_ELEMENT, PARAGRAPH_ELEMENT, WORD_BREAK_ELEMENT
 
Method Summary
static java.lang.String createHref(java.lang.String url, java.lang.String s)
          Create the HREF text.
static java.lang.String createTag(java.lang.String element)
          Create the tag text.
static java.lang.String createTag(java.lang.String element, java.lang.String s)
          Create the tag text.
static java.lang.String createTag(java.lang.String element, java.lang.String s, java.lang.String attributeText)
          Create the tag text.
static java.lang.String createTag(java.lang.String element, java.lang.String s, java.lang.String[] attributeTextArray)
          Create the tag text.
static java.lang.String getColorAttributeText(java.awt.Color color)
          Gets the font color text.
static java.lang.String getFontText(java.lang.String s, java.awt.Color color)
          Gets the font text for the specified color.
static java.lang.String getHtmlText(java.lang.String s)
          Gets the html text by adding the HTML elements if needed.
static java.lang.String getNameValueText(java.lang.String name, java.lang.String value)
          Get the name value text.
static java.lang.String getQuotedText(java.lang.String s)
          Get the quoted text.
static java.lang.String[] getStringArray(java.lang.String s)
          Gets the string array with the specified string.
static java.lang.String getText(java.lang.String s, java.lang.String element)
          Gets the text with the specified element.
static java.lang.String getText(java.lang.String s, java.lang.String element, java.lang.String attributeText)
          Gets the text with the specified element.
static boolean isClosingTagOptional(java.lang.String element)
          Determines if the closing tag is optional for the specified element.
static boolean startsWithHtml(java.lang.String s)
          Determines if the text starts with the HTML start tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTML_START_TAG

public static final java.lang.String HTML_START_TAG
HTML start tag, any HTML strings should start with this.

Method Detail

createHref

public static java.lang.String createHref(java.lang.String url,
                                          java.lang.String s)
Create the HREF text.

Parameters:
url - the URL.
s - the text or null if none.
Returns:
the HREF text.

createTag

public static java.lang.String createTag(java.lang.String element)
Create the tag text.

Parameters:
element - the element (such as BOLD_ELEMENT) or null if none.
Returns:
the tag text or null if none.

createTag

public static java.lang.String createTag(java.lang.String element,
                                         java.lang.String s)
Create the tag text.

Parameters:
element - the element (such as BOLD_ELEMENT) or null if none.
s - the text or null if none.
Returns:
the tag text or null if none.

createTag

public static java.lang.String createTag(java.lang.String element,
                                         java.lang.String s,
                                         java.lang.String attributeText)
Create the tag text.

Parameters:
element - the element (such as BOLD_ELEMENT) or null if none.
s - the text or null if none.
attributeText - the attribute text or null if none.
Returns:
the tag text or null if none.

createTag

public static java.lang.String createTag(java.lang.String element,
                                         java.lang.String s,
                                         java.lang.String[] attributeTextArray)
Create the tag text.

Parameters:
element - the element (such as BOLD_ELEMENT) or null if none.
s - the text or null if none.
attributeTextArray - the attribute text array or null if none.
Returns:
the tag text or null if none.

getColorAttributeText

public static java.lang.String getColorAttributeText(java.awt.Color color)
Gets the font color text.

Parameters:
color - the color or null if none.
Returns:
the font color text or null if none.

getFontText

public static java.lang.String getFontText(java.lang.String s,
                                           java.awt.Color color)
Gets the font text for the specified color.

Parameters:
s - the text or null if none.
color - the color or null if none.
Returns:
the font text.

getHtmlText

public static java.lang.String getHtmlText(java.lang.String s)
Gets the html text by adding the HTML elements if needed.

Parameters:
s - the text or null if none.
Returns:
the html text or null if none.

getNameValueText

public static java.lang.String getNameValueText(java.lang.String name,
                                                java.lang.String value)
Get the name value text.

Parameters:
name - the name.
value - the value.
Returns:
the name value text.

getQuotedText

public static java.lang.String getQuotedText(java.lang.String s)
Get the quoted text.

Parameters:
s - the text.
Returns:
the quoted text.

getStringArray

public static java.lang.String[] getStringArray(java.lang.String s)
Gets the string array with the specified string.

Parameters:
s - the string or null if none.
Returns:
the string array or null if none.

getText

public static java.lang.String getText(java.lang.String s,
                                       java.lang.String element)
Gets the text with the specified element.

Parameters:
s - the text or null if none.
element - the element (such as BOLD_ELEMENT) or null if none.
Returns:
the text with the specified element text.

getText

public static java.lang.String getText(java.lang.String s,
                                       java.lang.String element,
                                       java.lang.String attributeText)
Gets the text with the specified element.

Parameters:
s - the text or null if none.
element - the element (such as BOLD_ELEMENT) or null if none.
attributeText - the attribute text or null if none.
Returns:
the text with the specified element text.

isClosingTagOptional

public static boolean isClosingTagOptional(java.lang.String element)
Determines if the closing tag is optional for the specified element.

Parameters:
element - the element (such as BOLD_ELEMENT) or null if none.
Returns:
true if the closing tag is optional, false otherwise.

startsWithHtml

public static boolean startsWithHtml(java.lang.String s)
Determines if the text starts with the HTML start tag.

Parameters:
s - the text.
Returns:
true if the text starts with the HTML start tag, false otherwise.