objectivehtml.utils
Class HtmlUtils

java.lang.Object
  |
  +--objectivehtml.utils.HtmlUtils

public class HtmlUtils
extends java.lang.Object

This class provides html utility functions.


Constructor Summary
HtmlUtils()
           
 
Method Summary
static java.lang.Object convertFromString(java.lang.Class objClass, java.lang.String sValue)
          This method converts a String object into an wrapper object of the specified primitive class.
static java.lang.Object convertFromStrings(java.lang.Class objClass, java.lang.String[] asValue)
          This method converts an array of String objects into an array of objects of the specified primitive class.
static java.lang.String htmlSpecialChars(java.lang.String sHtml)
          This method converts special html characters into their html entity forms.
static java.lang.reflect.Method identifyMethod(java.lang.Class objClass, java.lang.String sMethod)
          This identifies the method of a specified class given the method signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlUtils

public HtmlUtils()
Method Detail

htmlSpecialChars

public static java.lang.String htmlSpecialChars(java.lang.String sHtml)

This method converts special html characters into their html entity forms. The following characters are converted:
& (ampersand) => &
" (double quote) => "
' (single quote) => '
< (less than) => &lt;
> (greater than) => &gt;

Parameters:
sHtml - The html string that needs to have special characters entitized.
Returns:
The string after all the special characters have been entitized.

identifyMethod

public static java.lang.reflect.Method identifyMethod(java.lang.Class objClass,
                                                      java.lang.String sMethod)
                                               throws java.lang.ClassNotFoundException,
                                                      java.lang.NoSuchMethodException,
                                                      java.lang.SecurityException
This identifies the method of a specified class given the method signature.
Parameters:
objClass - the class that the method belongs to
sMethod - the method signature
Returns:
a Method object representing the method
Throws:
java.lang.ClassNotFoundException - if a class cannot be found
java.lang.NoSuchMethodException - if the method cannot be found
java.lang.SecurityException - if the method cannot be accessed

convertFromString

public static java.lang.Object convertFromString(java.lang.Class objClass,
                                                 java.lang.String sValue)
                                          throws java.lang.NumberFormatException,
                                                 java.lang.ClassNotFoundException
This method converts a String object into an wrapper object of the specified primitive class.
Parameters:
objClass - the class that this object is to be converted into
sValue - the value to convert
Returns:
an object of the converted String
Throws:
java.lang.NumberFormatException - if the value cannot be parsed into a number
java.lang.ClassNotFoundException - if a class cannot be found

convertFromStrings

public static java.lang.Object convertFromStrings(java.lang.Class objClass,
                                                  java.lang.String[] asValue)
                                           throws java.lang.NumberFormatException,
                                                  java.lang.ClassNotFoundException
This method converts an array of String objects into an array of objects of the specified primitive class.
Parameters:
objClass - the class that this object is to be converted into
asValue - the values to convert
Returns:
an object of the converted String
Throws:
java.lang.NumberFormatException - if the value cannot be parsed into a number
java.lang.ClassNotFoundException - if a class cannot be found