|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.shared.util.SharedUtil
public class SharedUtil
Misc internal utility methods used by both the server and the client package.
| Field Summary | |
|---|---|
static java.lang.String |
SIZE_PATTERN
RegEx pattern to extract the width/height values. |
| Constructor Summary | |
|---|---|
SharedUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
addGetParameters(java.lang.String uri,
java.lang.String extraParams)
Adds the get parameters to the uri and returns the new uri that contains the parameters. |
static java.lang.String |
camelCaseToHumanFriendly(java.lang.String camelCaseString)
Converts a camelCaseString to a human friendly format (Camel case string). |
static java.lang.String |
capitalize(java.lang.String string)
Capitalizes the first character in the given string |
static boolean |
equals(java.lang.Object o1,
java.lang.Object o2)
Checks if a and b are equals using Object.equals(Object). |
static java.lang.String |
join(java.lang.String[] parts,
java.lang.String separator)
Joins the words in the input array together into a single string by inserting the separator string between each word. |
static java.lang.String |
propertyIdToHumanFriendly(java.lang.Object propertyId)
Converts a property id to a human friendly format. |
static java.lang.String[] |
splitCamelCase(java.lang.String camelCaseString)
Splits a camelCaseString into an array of words with the casing preserved. |
static java.lang.String |
trimTrailingSlashes(java.lang.String value)
Trims trailing slashes (if any) from a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SIZE_PATTERN
| Constructor Detail |
|---|
public SharedUtil()
| Method Detail |
|---|
public static boolean equals(java.lang.Object o1,
java.lang.Object o2)
Object.equals(Object). Handles null
values as well. Does not ensure that objects are of the same type.
Assumes that the first object's equals method handle equals properly.
o1 - The first value to compareo2 - The second value to compare
public static java.lang.String trimTrailingSlashes(java.lang.String value)
value - The string value to be trimmed. Cannot be null.
public static java.lang.String[] splitCamelCase(java.lang.String camelCaseString)
camelCaseString - The input string in camelCase format
public static java.lang.String camelCaseToHumanFriendly(java.lang.String camelCaseString)
In general splits words when the casing changes but also handles special cases such as consecutive upper case characters. Examples:
MyBeanContainer becomes My Bean Container AwesomeURLFactory becomes Awesome URL Factory SomeUriAction becomes Some Uri Action
camelCaseString - The input string in camelCase format
public static java.lang.String join(java.lang.String[] parts,
java.lang.String separator)
parts - The array of wordsseparator - The separator string to use between words
public static java.lang.String capitalize(java.lang.String string)
string - The string to capitalize
public static java.lang.String propertyIdToHumanFriendly(java.lang.Object propertyId)
propertyId - The propertyId to format
public static java.lang.String addGetParameters(java.lang.String uri,
java.lang.String extraParams)
uri - The uri to which the parameters should be added.extraParams - One or more parameters in the format "a=b" or "c=d&e=f". An
empty string is allowed but will not modify the url.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||