objectivehtml.utils
Class HtmlUtils
java.lang.Object
|
+--objectivehtml.utils.HtmlUtils
- public class HtmlUtils
- extends java.lang.Object
This class provides html utility functions.
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 |
HtmlUtils
public HtmlUtils()
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) => <
> (greater than) => >
- 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 tosMethod
- the method signature- Returns:
- a Method object representing the method
- Throws:
java.lang.ClassNotFoundException
- if a class cannot be foundjava.lang.NoSuchMethodException
- if the method cannot be foundjava.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 intosValue
- the value to convert- Returns:
- an object of the converted String
- Throws:
java.lang.NumberFormatException
- if the value cannot be parsed into a numberjava.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 intoasValue
- the values to convert- Returns:
- an object of the converted String
- Throws:
java.lang.NumberFormatException
- if the value cannot be parsed into a numberjava.lang.ClassNotFoundException
- if a class cannot be found