Class HTMLUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertCharEntity(String charEntity, boolean lookupHTMLentities, Hashtable userDefinedCharEntities) Converts a char entity to the matching character or string.static StringconvertHTMLCharEntity(String charEntity) Converts an HTML char entity to the matching character or string.static StringconvertXMLCharEntity(String charEntity) Converts an XML char entity to the matching character or string.static StringencodeString(String str) Encodes the specified string to "percent-encoding" or URL encoding.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Method Details
-
convertXMLCharEntity
Converts an XML char entity to the matching character or string. This is a convenience method that uses convertCharEntity with false for lookupHTMLentities and a null userDefinedCharEntities
Parameters
charEntity: The char entity to convert (Not including the & and ;)
Returns
A string containing a single char, or the original char entity string (with & and ;) if the char entity couldn't be resolved
-
convertHTMLCharEntity
Converts an HTML char entity to the matching character or string. This is a convenience method that uses convertCharEntity with true for lookupHTMLentities and a null userDefinedCharEntities
Parameters
charEntity: The char entity to convert (Not including the & and ;)
Returns
A string containing a single char, or the original char entity string (with & and ;) if the char entity couldn't be resolved
-
convertCharEntity
public static String convertCharEntity(String charEntity, boolean lookupHTMLentities, Hashtable userDefinedCharEntities) Converts a char entity to the matching character or string. This handles both numbered and symbol char entities (The latter is done via getCharEntityCode)
Parameters
-
charEntity: The char entity to convert (Not including the & and ;) -
lookupHTMLentities: true to include the basic HTML named char entities (unicode 160-255), false otherwise -
userDefinedCharEntities: A hashtable containing (String,int) dentoing the char entity name and its unicode
Returns
A string containing a single char, or the original char entity string (with & and ;) if the char entity couldn't be resolved
-
-
encodeString
-