| java.lang.Object org.apache.tapestry.ioc.internal.util.InternalUtils
InternalUtils | public class InternalUtils (Code) | | Utilities used within various internal implemenations of Tapestry IOC and the rest of the
tapestry-core framework.
|
Field Summary | |
final public static String | NAME_PREFIX Leading punctiation on member names that is stripped off to form a property name or new
member name. |
Method Summary | |
public static String | asString(Method method, ClassFactory classFactory) Converts a method to a user presentable string using a
ClassFactory to obtain a
MethodLocation (where possible). | public static String | asString(Method method) Converts a method to a user presentable string consisting of the containing class name, the
method name, and the short form of the parameter list (the class name of each parameter type,
shorn of the package name portion). | public static Object[] | calculateParameters(ObjectLocator locator, Map<Class, Object> parameterDefaults, Class[] parameterTypes, Annotation[][] parameterAnnotations) | public static Object[] | calculateParametersForConstructor(Constructor constructor, ObjectLocator locator, Map<Class, Object> parameterDefaults) | public static Object[] | calculateParametersForMethod(Method method, ObjectLocator locator, Map<Class, Object> parameterDefaults) | public static String | capitalize(String input) Capitalizes a string, converting the first character to uppercase. | public static boolean | containsSymbols(String input) Return true if the input string contains the marker for symbols that must be expanded. | public static String | createMemberName(String memberName) Strips leading characters defined by
InternalUtils.NAME_PREFIX , then adds the prefix
back in. | public static T | findAnnotation(Annotation[] annotations, Class<T> annotationClass) Finds a specific annotation type within an array of annotations. | public static Constructor | findAutobuildConstructor(Class clazz) Searches a class for the "best" constructor, the public constructor with the most parameters.
Returns null if there are no public constructors. | public static V | get(Map<K, V> map, K key) Gets a value from a map (which may be null). | public static boolean | isBlank(String input) Returns true if the input is null, or is a zero length string (excluding leading/trailing
whitespace). | public static boolean | isNonBlank(String input) | final public static boolean | isStatic(Method method) Returns true if the method provided is a static method. | public static String | join(List elements) Joins together some number of elements to form a comma separated list. | public static String | joinSorted(Collection elements) Creates a sorted copy of the provided elements, then turns that into a comma separated list. | public static String | lastTerm(String input) Searches the string for the final period ('.') character and returns everything after that.
The input string is generally a fully qualified class name, though tapestry-core also uses
this method for the occasional property expression (which is also dot separated). | public static Location | locationOf(Object location) Sniffs the object to see if it is a
Location or
Locatable . | final public static Iterator<T> | reverseIterator(List<T> list) | public static int | size(Object[] array) Returns the size of an object array, or null if the array is empty. | public static List<String> | sortedKeys(Map map) Extracts the string keys from a map and returns them in sorted order. | public static String | stripMemberPrefix(String memberName) Strips leading punctuation ("_" and "$") from the provided name. | public static List<String> | toList(Enumeration e) Converts an enumeration (of Strings) into a sorted list of Strings. |
NAME_PREFIX | final public static String NAME_PREFIX(Code) | | Leading punctiation on member names that is stripped off to form a property name or new
member name.
|
asString | public static String asString(Method method, ClassFactory classFactory)(Code) | | Converts a method to a user presentable string using a
ClassFactory to obtain a
MethodLocation (where possible).
InternalUtils.asString(Method) is used under the covers,
to present a detailed, but not excessive, description of the class, method and parameters.
Parameters: method - method to convert to a string Parameters: classFactory - used to obtain the MethodLocation the method formatted for presentation to the user |
asString | public static String asString(Method method)(Code) | | Converts a method to a user presentable string consisting of the containing class name, the
method name, and the short form of the parameter list (the class name of each parameter type,
shorn of the package name portion).
Parameters: method - short string representation |
capitalize | public static String capitalize(String input)(Code) | | Capitalizes a string, converting the first character to uppercase.
|
containsSymbols | public static boolean containsSymbols(String input)(Code) | | Return true if the input string contains the marker for symbols that must be expanded.
|
findAnnotation | public static T findAnnotation(Annotation[] annotations, Class<T> annotationClass)(Code) | | Finds a specific annotation type within an array of annotations.
< Parameters: T - > Parameters: annotations - to search Parameters: annotationClass - to match the annotation instance, if found, or null otherwise |
findAutobuildConstructor | public static Constructor findAutobuildConstructor(Class clazz)(Code) | | Searches a class for the "best" constructor, the public constructor with the most parameters.
Returns null if there are no public constructors. If there is more than one constructor with
the maximum number of parameters, it is not determined which will be returned (don't build a
class like that!).
Parameters: clazz - to search for a constructor for the constructor to be used to instantiate the class, or null if no appropriateconstructor was found |
get | public static V get(Map<K, V> map, K key)(Code) | | Gets a value from a map (which may be null).
< Parameters: K - >< Parameters: V - > Parameters: map - the map to extract from (may be null) Parameters: key - the value from the map, or null if the map is null |
isBlank | public static boolean isBlank(String input)(Code) | | Returns true if the input is null, or is a zero length string (excluding leading/trailing
whitespace).
|
isNonBlank | public static boolean isNonBlank(String input)(Code) | | |
isStatic | final public static boolean isStatic(Method method)(Code) | | Returns true if the method provided is a static method.
|
join | public static String join(List elements)(Code) | | Joins together some number of elements to form a comma separated list.
|
joinSorted | public static String joinSorted(Collection elements)(Code) | | Creates a sorted copy of the provided elements, then turns that into a comma separated list.
|
lastTerm | public static String lastTerm(String input)(Code) | | Searches the string for the final period ('.') character and returns everything after that.
The input string is generally a fully qualified class name, though tapestry-core also uses
this method for the occasional property expression (which is also dot separated). Returns the
input string unchanged if it does not contain a period character.
|
size | public static int size(Object[] array)(Code) | | Returns the size of an object array, or null if the array is empty.
|
sortedKeys | public static List<String> sortedKeys(Map map)(Code) | | Extracts the string keys from a map and returns them in sorted order. The keys are converted
to strings.
Parameters: map - the map to extract keys from (may be null) the sorted keys, or the empty set if map is null |
stripMemberPrefix | public static String stripMemberPrefix(String memberName)(Code) | | Strips leading punctuation ("_" and "$") from the provided name.
|
|
|