|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ail.core.Functions
public class Functions
Utility function class.
| Constructor Summary | |
|---|---|
Functions()
|
|
| Method Summary | |
|---|---|
static java.net.URL |
absoluteConfigureUrl(Core core,
java.lang.String suppliedUrl)
|
static void |
closeJdbc(java.sql.Connection con,
java.sql.Statement st,
java.sql.ResultSet rs)
Close a connection to a JDBC database in a safe fashion. |
static java.lang.String |
configurationNamespaceToProductName(java.lang.String configuratioNamespace)
Return the product name associated with a configuration namespace. |
static TypeEnum |
enumForName(java.lang.String name,
TypeEnum[] enums)
|
static java.lang.String |
expand(java.lang.String src,
Type model)
Utility method to expand 'variables' embedded in a string with respect to a model. |
static void |
expand(java.io.Writer writer,
java.io.InputStream content,
Type model)
Utility method which reads content from a url, expands any variables it finds embedded in the content against the model supplied, and writes the output to a specified writer. |
static void |
expand(java.io.Writer writer,
java.lang.String content,
Type model)
Utility method which expands any variables it finds embedded in the passed in content against the model supplied, and writes the output to a specified writer. |
static void |
expand(java.io.Writer writer,
java.net.URL url,
Type model)
Utility method which reads content from a url, expands any variables it finds embedded in the content against the model supplied, and writes the output to a specified writer. |
static java.lang.String |
format(java.util.Date date,
java.lang.String pattern)
Translate a Date into a String using the specified format. |
static java.lang.String[] |
getStringArrayFromString(java.lang.String string,
java.lang.String separator)
Builds a String[] from a String with a
given character separating values. |
static java.lang.String |
hideNull(java.lang.String s)
Convert null strings into empty strings. |
static java.lang.String |
loadScriptOrUrlContent(Core core,
java.lang.String suppliedUrl,
java.lang.String script)
The script may be local (the value of the script property), or remote (loaded using the url property). |
static java.lang.String |
loadUrlContentAsString(java.net.URL url)
Load the content from a URL into a String. |
static java.lang.String |
productNameToConfigurationNamespace(java.lang.String productName)
Return the configuration namespace associated with a product. |
static java.lang.String |
productNameToDefaultType(java.lang.String productName)
Return the name of a product's default type based on it's namespace. |
static java.lang.String |
valuesAsCsv(java.lang.Object[] e)
Turn an array of Objects into a comma separated list where each value in the list is the result of calling toString() on the corresponding Object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Functions()
| Method Detail |
|---|
public static java.lang.String[] getStringArrayFromString(java.lang.String string,
java.lang.String separator)
String[] from a String with a
given character separating values. Example "val1|val2|val3".
string - String containing values.separator - Denotes character(s) in between values.
public static void closeJdbc(java.sql.Connection con,
java.sql.Statement st,
java.sql.ResultSet rs)
con - Connection to be closed (or null)st - Statement to be closed (or null)rs - ResultSet to be closed (or null)public static java.lang.String valuesAsCsv(java.lang.Object[] e)
If the array of objects is empty, an empty string is returned.
e - An array of objects to be CSV'ed
public static TypeEnum enumForName(java.lang.String name,
TypeEnum[] enums)
public static java.lang.String loadUrlContentAsString(java.net.URL url)
throws java.io.IOException
url - URL to load content from
java.io.IOException
public static java.lang.String expand(java.lang.String src,
Type model)
quoteNumber property; this method would
return "Your quote number is: FQ1234".
src - model -
public static void expand(java.io.Writer writer,
java.lang.String content,
Type model)
writer - Where the expanded output is written no.content - The String to read content frommodel - The model to resolve variable references against
public static void expand(java.io.Writer writer,
java.net.URL url,
Type model)
writer - Where the expanded output is written no.url - The URL to read content frommodel - The model to resolve variable references against
public static void expand(java.io.Writer writer,
java.io.InputStream content,
Type model)
writer - Where the expanded output is written no.content - Stream to read content from.model - The model to resolve variable references againstpublic static java.lang.String hideNull(java.lang.String s)
s - String to check
public static java.lang.String format(java.util.Date date,
java.lang.String pattern)
date - Date to be convertedpattern - Format for to return date
public static java.net.URL absoluteConfigureUrl(Core core,
java.lang.String suppliedUrl)
throws java.net.MalformedURLException
java.net.MalformedURLException
public static java.lang.String loadScriptOrUrlContent(Core core,
java.lang.String suppliedUrl,
java.lang.String script)
public static java.lang.String productNameToConfigurationNamespace(java.lang.String productName)
productName - Name of the product to get the namespace.
public static java.lang.String configurationNamespaceToProductName(java.lang.String configuratioNamespace)
configuratioNamespace - Namespace to fetch the product name for.
public static java.lang.String productNameToDefaultType(java.lang.String productName)
productName - Name of product to get the default type for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||