public class Utils
extends java.lang.Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
arrayToString(java.lang.Object[] ary)
Converts an array of objects to a string, by concatenating them
together and separated with comma.
|
static Component |
getComponentById(Component comp,
java.lang.String id)
Returns the component of the specified ID or UUID.
|
static java.lang.String |
getDynamicMediaURI(AbstractComponent comp,
int version,
java.lang.String name,
java.lang.String format)
Returns the encoded URL for the dynamic generated content, or empty
the component doesn't belong to any desktop.
|
static int |
getIntAttribute(Component comp,
java.lang.String name,
int defValue,
boolean recurse)
Returns the number if the given attribute is defined in a component or in library property.
|
static java.lang.String |
intsToString(int[] ary)
Converts an array of numbers to a string.
|
static java.lang.String |
outFeature()
Generates the ZK feature information
|
static java.lang.String |
outLocaleJavaScript()
Generates the locale-dependent JavaScript codes, such as messages
(msgzul).
|
static void |
renderCrawlableA(java.lang.String href,
java.lang.String label)
Render the crawlable HTML A tag.
|
static void |
renderCrawlableText(java.lang.String text)
Render the crawlable text.
|
static java.lang.String[] |
stringToArray(java.lang.String src,
java.lang.String defaultValue)
Parse a list of numbers.
|
static int[] |
stringToInts(java.lang.String numbers,
int defaultValue)
Parse a list of numbers.
|
static boolean |
testAttribute(Component comp,
java.lang.String name,
boolean defValue,
boolean recurse)
Tests if the given attribute is defined in a component or in library property.
|
public static final int[] stringToInts(java.lang.String numbers, int defaultValue) throws WrongValueException
defaultValue
- the value if a number is omitted. For example, ",2"
means "1,2" if defafultValue is 1WrongValueException
public static final java.lang.String intsToString(int[] ary)
public static final java.lang.String[] stringToArray(java.lang.String src, java.lang.String defaultValue)
defaultValue
- the value used if an empty string is fund.
For example, ",2" means "1,2" if defafultValue is "1"public static final java.lang.String arrayToString(java.lang.Object[] ary)
public static java.lang.String getDynamicMediaURI(AbstractComponent comp, int version, java.lang.String name, java.lang.String format)
public static final java.lang.String outFeature()
public static final java.lang.String outLocaleJavaScript()
It is called by zul/lang/zk.wpd.
public static void renderCrawlableA(java.lang.String href, java.lang.String label) throws java.io.IOException
href
- the hyper link. If null or empty, nothing is generated.label
- the label to show. Empty is assumed if null.java.io.IOException
public static void renderCrawlableText(java.lang.String text) throws java.io.IOException
text
- the text that is crawlable.
If null or empty, nothing is generated.java.io.IOException
public static Component getComponentById(Component comp, java.lang.String id)
uuid(comp_uuid)
.public static final boolean testAttribute(Component comp, java.lang.String name, boolean defValue, boolean recurse)
name
- the name of the attributedefValue
- the default value if neither component's attribute or library property is defined
for the given namerecurse
- whether to look up the ancestor's attributepublic static final int getIntAttribute(Component comp, java.lang.String name, int defValue, boolean recurse)
name
- the name of the attributedefValue
- the default value if neither component's attribute or library property is defined
for the given namerecurse
- whether to look up the ancestor's attributeCopyright © 2005-2021 Potix Corporation. All Rights Reserved.