com.taggercat.util
Class Text

java.lang.Object
  extended by com.taggercat.util.Text

public class Text
extends java.lang.Object

This class contains general text utility functions, such as parsing, and conversion methods. All methods in this class are static.

 

Field Summary
static int DSN_TERM
          the index of the the DSN in DSN.ROW_ID.FIELD_NAME string
static int FIELDNAME_TERM
          the index of the the FIELD NAME in DSN.ROW_ID.FIELD_NAME string
static java.util.Map<java.lang.String,java.lang.Integer> namedScopes
           
static int ROWID_TERM
          the index of the the ROW ID as in DSN.ROW_ID.FIELD_NAME string
 
Constructor Summary
Text()
           
 
Method Summary
static void addAttribute(java.lang.StringBuilder sb, java.lang.String attributeName, java.lang.String value)
          Wraps the attribute value in quotes, and adds it to the buffer.
static void appendQuotedString(java.lang.StringBuffer sb, java.lang.String s)
           
static void appendQuotedString(java.lang.StringBuffer sb, java.lang.String s, java.lang.String comma)
           
static java.lang.Object byteArrayToObject(byte[] objByteArray)
           
static java.lang.String convertCRLFToHRMLBreak(java.lang.String text)
           
static java.lang.String convertJavaToJSCalFormatPattern(java.lang.String javaFormatPattern)
          Converts any characters in the Java Date-Time format pattern to the equivalent one for the JS calendar control.
static java.lang.String convertJSPToAlias(java.lang.String jspfileName)
           
static java.lang.String convertNameToCaption(java.lang.String name)
           
static java.util.List<java.lang.String> delimitedStringToList(java.lang.String delimitedString)
          Converts the delimited string into a list.
static java.util.Map<java.lang.String,java.lang.String> delimitedStringToMap(java.lang.String delimitedString)
          Converts the delimited string into a map.
static java.lang.String encryptPassword(java.lang.String password)
          Provides One-Way encryption, you can test if the same password is being used, but you can't be easily* un-encrypt it.
static boolean equalStrings(java.lang.String s1, java.lang.String s2)
          Null safe string equals.
static java.lang.String escapeHTML(java.lang.String text)
          Escape HTML chars in the text string
static java.lang.String escapeQuotes(java.lang.String src)
          Escapes any double quote with a leading slash \.
static java.lang.String escapeRegExChars(java.lang.String raw)
          Escape any regular expression chars in the source text
static java.lang.String escapeSingleQuotes(java.lang.String str)
          Escape single quotes in a string with a leading backslash.
static java.lang.String escapeSQL(java.lang.String str)
          Escape single quotes in a SQL strings with a double single quotes.
static java.lang.String escapeXML(java.lang.String text)
          Escape XML chars in the text string
static java.lang.String expandExpressions(java.lang.String expString, com.taggercat.el.ELPropertyResolver elProperrtResolver, com.taggercat.el.ELContext elContext)
          This method parses, and replaces embedded expressions from the string with their corresponding expression results.
static java.lang.String expandIndexedPlaceholders(java.lang.String expString, java.util.List<?> values)
          Expand indexed placeholders with their corresponding values.
static java.lang.String expandIndexedPlaceholders(java.lang.String expString, java.util.List<?> values, boolean retainMissingPlaceholders)
          Expand indexed placeholders with their corresponding values.
static java.lang.String expandIndexedPlaceholders(java.lang.String expString, java.lang.String[] values)
          Expand indexed placeholders with their corresponding values.
static java.lang.String expandIndexedPlaceholders(java.lang.String expString, java.lang.String[] values, boolean retainMissingPlaceholders)
          Expand indexed placeholders with their corresponding values.
static java.lang.String expandNamedPlaceholders(java.lang.String expString, java.util.Map<java.lang.String,java.lang.Object> values)
          Expand named placeholders with their corresponding values from the map.
static java.lang.String expandNamedPlaceholders(java.lang.String expString, java.util.Map<java.lang.String,java.lang.Object> values, boolean retainMissingPlaceholders)
          Expand named placeholders with their corresponding values from the map.
static java.lang.String expandNamedPlaceholdersWithBean(java.lang.String expString, java.lang.Object beanContext, boolean retainMissingPlaceholders)
          Expand named placeholders with their corresponding values from a bean instance.
static java.lang.String getCheckBoxValue(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)
          This method returns the request value of a checkbox item.
static java.lang.String getControllerPath()
          Returns the path to the controller servlet ( including the context if one is being used).
static java.lang.String getDotDelimitedPropertyName(DataSource ds, TCEntity entity, java.lang.String propertyName)
          Returns the dot delimited property name eg.
static java.lang.String getDotDelimitedPropertyName(java.lang.String dsn, java.lang.String rowID, java.lang.String propertyName)
          Returns the dot delimited property name eg.
static java.lang.String getDotDelimitedTerm(int termNum, java.lang.String parameter)
          Returns a term of a dot delimited string.
static java.lang.String getExplicitDSN(java.lang.String str)
          Gets the explicit DSN from a string such as "save(customers)".
static java.lang.String getFormattedValue(java.lang.String dsn, java.lang.String propertyName, Model model, java.lang.Object obj, java.lang.String format, java.lang.String type)
          Returns the value formatted with the specified format string.
static java.text.Format getFormatter(java.util.Locale locale, java.lang.String format, java.lang.String type)
          Gets a formatter for the named type and format specifier
static java.lang.String getJSCalendarFormat(java.lang.String dsn, java.lang.String propertyName)
          Gets a format string compatible with the JS calendar control for the specified dsn and property.
static int getNamedScopeKey(java.lang.String scopeName)
           
static java.lang.String getPageName(javax.servlet.http.HttpServletRequest request)
          Gets the response page name for the current request.
static java.util.List<java.lang.String> getPropertyList(java.util.Collection<?> collection, java.lang.String propertyName)
          Returns a list of the toString() values from the named property on the instances of the items in the collection.
static java.lang.String getPropertyName(java.lang.String parameter)
          Gets property name from a parameter, where property name is assumed to be the third token in the parameter, and the parameter is delimited by '.' characters.
static java.lang.String getQualifier(java.lang.String qualifiedName)
          Returns the qualifier ( such as the package name ) from the qualified name
static java.lang.String getRandomString(int size)
          Returns a random text string of the specified size
static java.lang.String getRealClassName(java.lang.Object obj)
          Gets the real classname for the specified object that maybe a proxy
static java.lang.String getRequestAction(java.lang.String str)
          Gets the Action name from a actionName string such as "save(customers)".
static java.lang.String getRowID(java.lang.String parameter)
          Gets row ID from a parameter, where row ID is assumed to be the second token in the parameter, and the parameter is delimited by the '.' character.
static java.lang.String getStackTraceAsString(java.lang.Throwable exception)
          Converts the stack trace of a Throwable instance to a String.
static java.lang.String getUnqualifiedName(java.lang.String qualifiedName)
          Returns the unqualified property or class name
static java.lang.String getURLSansQueryString(java.lang.String url)
          Gets the url without the query string
static boolean isEmpty(java.lang.String str)
          Returns true if the string is null, or has a length == 0.
static boolean isNamedScopeKey(java.lang.String scopeName)
           
static boolean isNameInWildCardList(java.lang.String name, java.util.List<java.lang.String> list)
           
static boolean isNotEmpty(java.lang.String str)
          Returns true if the string is not null, and has a length greater than 0.
static boolean isQuoted(java.lang.String string)
          Returns true if the string is quoted.
static java.util.List<java.lang.String> lineToList(java.lang.String line)
          Converts a comma-separated string into a List
static java.util.Map<java.lang.String,java.lang.String> lineToMap(java.lang.String line)
          Converts a comma-separated string of name-value pairs of the form name1:value1,name2:value2,nameN:valueN into a map
static byte[] objectToByteArray(java.lang.Object obj)
          Converts an object to a byte array
static java.lang.String removeDoubleSlashes(java.lang.String text)
           
static java.lang.String removeExpressionComments(java.lang.String expressionString)
           
static java.lang.String RGBtoHex(int r, int g, int b)
          The name says it all.
static java.lang.String toBeanGetterName(java.lang.String basicName)
          Converts the basic method name to a getter method name.
static java.lang.String toHexString(byte[] block)
          Converts a byte array to hex string.
static java.lang.String toHexString(java.lang.String str)
          Converts a byte array to hex string.
static java.lang.String toTitleCase(java.lang.String str)
          Convert separate words to title case
static boolean wildCardMatch(java.lang.String input, java.lang.String wildcardString)
          Tests the input string for a match with the wildcardString pattern.
static java.lang.String wordWrap(java.lang.String str, int length)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DSN_TERM

public static final int DSN_TERM
the index of the the DSN in DSN.ROW_ID.FIELD_NAME string

See Also:
Constant Field Values

ROWID_TERM

public static final int ROWID_TERM
the index of the the ROW ID as in DSN.ROW_ID.FIELD_NAME string

See Also:
Constant Field Values

FIELDNAME_TERM

public static final int FIELDNAME_TERM
the index of the the FIELD NAME in DSN.ROW_ID.FIELD_NAME string

See Also:
Constant Field Values

namedScopes

public static java.util.Map<java.lang.String,java.lang.Integer> namedScopes
Constructor Detail

Text

public Text()
Method Detail

getNamedScopeKey

public static int getNamedScopeKey(java.lang.String scopeName)

isNamedScopeKey

public static boolean isNamedScopeKey(java.lang.String scopeName)

addAttribute

public static void addAttribute(java.lang.StringBuilder sb,
                                java.lang.String attributeName,
                                java.lang.String value)
Wraps the attribute value in quotes, and adds it to the buffer. This method is used to add attributes to a generated tag.

Parameters:
sb - the StringBuilder to write the results into
attributeName - the attribute name to create
value - the value to set to the attribute name to

escapeHTML

public static java.lang.String escapeHTML(java.lang.String text)
Escape HTML chars in the text string

Parameters:
text -
Returns:
the string with all HTML chars escaped

escapeXML

public static java.lang.String escapeXML(java.lang.String text)
Escape XML chars in the text string

Parameters:
text -
Returns:
the string with all HTML chars escaped

escapeQuotes

public static java.lang.String escapeQuotes(java.lang.String src)
Escapes any double quote with a leading slash \. Use this method to escape any string that contains quotes, and you need to use this string within quotes. For example when creating a JavaScript variable with a JSP Tag.

Parameters:
src - the string to escape
Returns:
the string with quotes escaped

escapeSingleQuotes

public static java.lang.String escapeSingleQuotes(java.lang.String str)
Escape single quotes in a string with a leading backslash.

Parameters:
str - the string to escape
Returns:
the converted string

escapeSQL

public static java.lang.String escapeSQL(java.lang.String str)
Escape single quotes in a SQL strings with a double single quotes.

Parameters:
str - the string to escape
Returns:
the converted string

appendQuotedString

public static void appendQuotedString(java.lang.StringBuffer sb,
                                      java.lang.String s,
                                      java.lang.String comma)

appendQuotedString

public static void appendQuotedString(java.lang.StringBuffer sb,
                                      java.lang.String s)

getStackTraceAsString

public static java.lang.String getStackTraceAsString(java.lang.Throwable exception)
Converts the stack trace of a Throwable instance to a String.

Parameters:
exception - The Throwable instance.
Returns:
String representation of the Throwable instance's stack trace.

getFormattedValue

public static java.lang.String getFormattedValue(java.lang.String dsn,
                                                 java.lang.String propertyName,
                                                 Model model,
                                                 java.lang.Object obj,
                                                 java.lang.String format,
                                                 java.lang.String type)
                                          throws java.lang.Exception
Returns the value formatted with the specified format string.

Throws:
java.lang.Exception - NumberFormatException, or ParseException
Parameters:
dsn - the data source name
propertyName - the field name
model - the model object
obj - the object to be formatted
format - the format specifier
type - the field type
Returns:
the formatted value

getPageName

public static java.lang.String getPageName(javax.servlet.http.HttpServletRequest request)
Gets the response page name for the current request.

Parameters:
request - the current request
Returns:
the response page name, for example: /Orders.jsp

getDotDelimitedTerm

public static java.lang.String getDotDelimitedTerm(int termNum,
                                                   java.lang.String parameter)
Returns a term of a dot delimited string. There can be up to two dots, and thus three terms. The generally used expressions are DSN.RowID.FieldName.

Parameters:
termNum - the term number to retrieve
parameter - the dot delimited string
Returns:
the term

toBeanGetterName

public static java.lang.String toBeanGetterName(java.lang.String basicName)
Converts the basic method name to a getter method name.

Parameters:
basicName - the basic name
Returns:
the getter name

toTitleCase

public static java.lang.String toTitleCase(java.lang.String str)
Convert separate words to title case

Parameters:
str -
Returns:
the title case version

getCheckBoxValue

public static java.lang.String getCheckBoxValue(javax.servlet.http.HttpServletRequest request,
                                                java.lang.String paramName)
This method returns the request value of a checkbox item. Since unselected checkboxes are not submitted with the request, we usually include a second hidden form element for each check box with its value set to the negative state. Therefore, when a checkbox is selected, there will be two request parameters for the checkbox's parameter name. One "true", and one "false". If there is a "true" value, then the checkbox's state is selected, and the "false" state is ignored. However, if the checkbox is not selected, then there will only be one request parameter for the checkbox, and that is the false state.

Parameters:
request - the request object
paramName - the checkbox's parameter name
Returns:
"true" of "false" indicating the checkbox's selections state

expandExpressions

public static java.lang.String expandExpressions(java.lang.String expString,
                                                 com.taggercat.el.ELPropertyResolver elProperrtResolver,
                                                 com.taggercat.el.ELContext elContext)
                                          throws com.taggercat.el.ParseException
This method parses, and replaces embedded expressions from the string with their corresponding expression results. The input string is typically a where clause, a response page expression, etc.

The embedded expression placeholders are delimited by @{ and }.

Any number of expressions can be embedded within the input string. However, recursive sub-expression placeholders are not supported.

Throws:
com.taggercat.el.ParseException
Parameters:
expString - the string containing the expressions
elProperrtResolver - the expression term provider
Returns:
the completed where clause

isQuoted

public static boolean isQuoted(java.lang.String string)
Returns true if the string is quoted.

Parameters:
string - the string to test
Returns:
true if the string is quoted

isNotEmpty

public static boolean isNotEmpty(java.lang.String str)
Returns true if the string is not null, and has a length greater than 0.

Parameters:
str -
Returns:
true if the string is not null, and has a length greater than 0

isEmpty

public static boolean isEmpty(java.lang.String str)
Returns true if the string is null, or has a length == 0.

Parameters:
str -
Returns:
true true if the string is null, or has a length == 0

getDotDelimitedPropertyName

public static java.lang.String getDotDelimitedPropertyName(DataSource ds,
                                                           TCEntity entity,
                                                           java.lang.String propertyName)
Returns the dot delimited property name eg. Customer.3115.FirstName .

Parameters:
ds - the data source name
entity - the tcEntity
propertyName - the property Name
Returns:
the dot delimited field name.

getDotDelimitedPropertyName

public static java.lang.String getDotDelimitedPropertyName(java.lang.String dsn,
                                                           java.lang.String rowID,
                                                           java.lang.String propertyName)
Returns the dot delimited property name eg. Customer.3115.FirstName .

Parameters:
dsn - the data source name
rowID - the row ID
propertyName - the property name
Returns:
the dot delimited field name.

wildCardMatch

public static boolean wildCardMatch(java.lang.String input,
                                    java.lang.String wildcardString)
Tests the input string for a match with the wildcardString pattern. Patterns roughly follow DOS wildcard patterns, where a ? matches any character, and a * matches to the end of the string. The match is not case sensitive.

Parameters:
input - the string to test against the pattern
wildcardString - the wildcard string pattern to match
Returns:
true if the string matches the pattern

toHexString

public static java.lang.String toHexString(byte[] block)
Converts a byte array to hex string.

Parameters:
block - the bytes to convert
Returns:
the hex representation of the string

toHexString

public static java.lang.String toHexString(java.lang.String str)
Converts a byte array to hex string.

Parameters:
str - the string to convert
Returns:
the hex representation of the string

equalStrings

public static boolean equalStrings(java.lang.String s1,
                                   java.lang.String s2)
Null safe string equals.

Parameters:
s1 -
s2 -
Returns:
true if the strings are the same

getRequestAction

public static java.lang.String getRequestAction(java.lang.String str)
Gets the Action name from a actionName string such as "save(customers)".

Parameters:
str - the request name, possibly with an embedded data source name
Returns:
the request name only

getExplicitDSN

public static java.lang.String getExplicitDSN(java.lang.String str)
Gets the explicit DSN from a string such as "save(customers)".

Parameters:
str - the request name, possibly with an embedded data source name
Returns:
the embedded DSN it one exists, otherwise, null

lineToList

public static java.util.List<java.lang.String> lineToList(java.lang.String line)
Converts a comma-separated string into a List

Parameters:
line - the string of comma separated items
Returns:
List of items

lineToMap

public static java.util.Map<java.lang.String,java.lang.String> lineToMap(java.lang.String line)
Converts a comma-separated string of name-value pairs of the form name1:value1,name2:value2,nameN:valueN into a map

Parameters:
line - the string of comma separated items
Returns:
Map of name value pairs

getFormatter

public static java.text.Format getFormatter(java.util.Locale locale,
                                            java.lang.String format,
                                            java.lang.String type)
Gets a formatter for the named type and format specifier

Parameters:
locale - the locale
format - the named format or format pattern
type - the type
Returns:
the formatter

expandIndexedPlaceholders

public static java.lang.String expandIndexedPlaceholders(java.lang.String expString,
                                                         java.util.List<?> values)
Expand indexed placeholders with their corresponding values. Indexed placeholders are of the form {0}, {1} ... {n}

Parameters:
expString - the string to expand
values - the placeholder values
Returns:
the expanded string

expandIndexedPlaceholders

public static java.lang.String expandIndexedPlaceholders(java.lang.String expString,
                                                         java.lang.String[] values)
Expand indexed placeholders with their corresponding values. Indexed placeholders are of the form {0}, {1} ... {n}

Parameters:
expString - the string to expand
values - the placeholder values
Returns:
the expanded string

expandIndexedPlaceholders

public static java.lang.String expandIndexedPlaceholders(java.lang.String expString,
                                                         java.lang.String[] values,
                                                         boolean retainMissingPlaceholders)
Expand indexed placeholders with their corresponding values. Indexed placeholders are of the form {0}, {1} ... {n}

Parameters:
expString - the string to expand
values - the placeholder values
retainMissingPlaceholders - set true to retain non-matched placeholders
Returns:
the expanded string

expandIndexedPlaceholders

public static java.lang.String expandIndexedPlaceholders(java.lang.String expString,
                                                         java.util.List<?> values,
                                                         boolean retainMissingPlaceholders)
Expand indexed placeholders with their corresponding values. Indexed placeholders are of the form {0}, {1} ... {n}

Parameters:
expString - the string to expand
values - the placeholder values
retainMissingPlaceholders - set true to retain non-matched placeholders
Returns:
the expanded string

expandNamedPlaceholders

public static java.lang.String expandNamedPlaceholders(java.lang.String expString,
                                                       java.util.Map<java.lang.String,java.lang.Object> values)
Expand named placeholders with their corresponding values from the map. Named placeholders are of the form {someName}, {someOtherName} ... {any char name}

Parameters:
expString - the string to expand
values - the placeholder values
Returns:
the expanded string

expandNamedPlaceholders

public static java.lang.String expandNamedPlaceholders(java.lang.String expString,
                                                       java.util.Map<java.lang.String,java.lang.Object> values,
                                                       boolean retainMissingPlaceholders)
Expand named placeholders with their corresponding values from the map. Named placeholders are of the form {someName}, {someOtherName} ... {any char name}

Parameters:
expString - the string to expand
values - the placeholder values
retainMissingPlaceholders - set true to retain non-matched placeholders
Returns:
the expanded string

expandNamedPlaceholdersWithBean

public static java.lang.String expandNamedPlaceholdersWithBean(java.lang.String expString,
                                                               java.lang.Object beanContext,
                                                               boolean retainMissingPlaceholders)
Expand named placeholders with their corresponding values from a bean instance. Named placeholders are of the form: {propertyName}, {someOtherPropertyName} ... {propertyName.nestedPropName}
For example: String str = "Hello {fullName}; your login name is: {loginName}, welcome to {tenantName}"; String message = expandNamedPlaceholdersWithBean(str, linfo, true ); Or using multiple beans. String str = "Hello {login.fullName}; your login name is: {login.loginName}, welcome to {otherBean.tenantName}"; Map<String, Object> contexts = new HashMap<String, Object>(); contexts.put("login", loginInfo); ... add your other named beans to the contexts String message = expandNamedPlaceholdersWithBean(str, contexts, true );

Parameters:
expString - the string to expand
beanContext - the bean context to get value from
retainMissingPlaceholders - set true to retain non-matched placeholders
Returns:
the expanded string

delimitedStringToList

public static java.util.List<java.lang.String> delimitedStringToList(java.lang.String delimitedString)
Converts the delimited string into a list.

Parameters:
delimitedString - delimited with comma, semicolon, or a forward slash
Returns:
the list

delimitedStringToMap

public static java.util.Map<java.lang.String,java.lang.String> delimitedStringToMap(java.lang.String delimitedString)
Converts the delimited string into a map. Where the even numbered terms are taken as the map keys, and the odd numbered terms as the map values.

Parameters:
delimitedString - delimited with comma, semi-colon, or a forward slash
Returns:
the map

getPropertyName

public static java.lang.String getPropertyName(java.lang.String parameter)
Gets property name from a parameter, where property name is assumed to be the third token in the parameter, and the parameter is delimited by '.' characters.

Parameters:
parameter - Parameter from which to extract field name.
Returns:
property name, else null if parameter is null or zero length or if no third token exists in parameter.

getRowID

public static java.lang.String getRowID(java.lang.String parameter)
Gets row ID from a parameter, where row ID is assumed to be the second token in the parameter, and the parameter is delimited by the '.' character.

Parameters:
parameter - Parameter from which to extract row ID.
Returns:
row ID, else null if parameter is null or zero length, or if no second token exists in parameter.

getURLSansQueryString

public static java.lang.String getURLSansQueryString(java.lang.String url)
Gets the url without the query string

Parameters:
url -
Returns:
the url without the query string

objectToByteArray

public static byte[] objectToByteArray(java.lang.Object obj)
Converts an object to a byte array

Parameters:
obj - the Object to be converted
Returns:
byte[] converted byte array

byteArrayToObject

public static java.lang.Object byteArrayToObject(byte[] objByteArray)

convertNameToCaption

public static java.lang.String convertNameToCaption(java.lang.String name)

getQualifier

public static java.lang.String getQualifier(java.lang.String qualifiedName)
Returns the qualifier ( such as the package name ) from the qualified name

Parameters:
qualifiedName -
Returns:
the qualifier, or an empty string if there is none

getUnqualifiedName

public static java.lang.String getUnqualifiedName(java.lang.String qualifiedName)
Returns the unqualified property or class name

Parameters:
qualifiedName -
Returns:
the unqualified property or class name

getPropertyList

public static java.util.List<java.lang.String> getPropertyList(java.util.Collection<?> collection,
                                                               java.lang.String propertyName)
Returns a list of the toString() values from the named property on the instances of the items in the collection.

Parameters:
collection -
propertyName -
Returns:
a list of the toString() values from the named property on the instances of the items in the collection

getRandomString

public static java.lang.String getRandomString(int size)
Returns a random text string of the specified size

Parameters:
size - - the size
Returns:
a random text string of the specified size

wordWrap

public static java.lang.String wordWrap(java.lang.String str,
                                        int length)

getControllerPath

public static java.lang.String getControllerPath()
Returns the path to the controller servlet ( including the context if one is being used).

Returns:
the path to the controller servlet ( including the context if one is being used)

getRealClassName

public static java.lang.String getRealClassName(java.lang.Object obj)
Gets the real classname for the specified object that maybe a proxy


isNameInWildCardList

public static boolean isNameInWildCardList(java.lang.String name,
                                           java.util.List<java.lang.String> list)

encryptPassword

public static java.lang.String encryptPassword(java.lang.String password)
Provides One-Way encryption, you can test if the same password is being used, but you can't be easily* un-encrypt it. Note; that experts can decrypt it. You should consider using salted keys for better security.


removeExpressionComments

public static java.lang.String removeExpressionComments(java.lang.String expressionString)

convertCRLFToHRMLBreak

public static java.lang.String convertCRLFToHRMLBreak(java.lang.String text)

removeDoubleSlashes

public static java.lang.String removeDoubleSlashes(java.lang.String text)

convertJSPToAlias

public static java.lang.String convertJSPToAlias(java.lang.String jspfileName)

getJSCalendarFormat

public static java.lang.String getJSCalendarFormat(java.lang.String dsn,
                                                   java.lang.String propertyName)
Gets a format string compatible with the JS calendar control for the specified dsn and property. This method functions based upon the assumption that there has already been a Java formatter generated for the property.

Parameters:
dsn - the data source name
propertyName - the property name
Returns:
a format string compatible with the JS calendar control

convertJavaToJSCalFormatPattern

public static java.lang.String convertJavaToJSCalFormatPattern(java.lang.String javaFormatPattern)
Converts any characters in the Java Date-Time format pattern to the equivalent one for the JS calendar control.

Parameters:
javaFormatPattern - - the Java format string
Returns:
the format pattern used in the JS calendar

escapeRegExChars

public static java.lang.String escapeRegExChars(java.lang.String raw)
Escape any regular expression chars in the source text

Parameters:
raw - the source text
Returns:
the escaped version

RGBtoHex

public static java.lang.String RGBtoHex(int r,
                                        int g,
                                        int b)
The name says it all.

Parameters:
r -
g -
b -
Returns:
the hex representation