public class InternalCommonsUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static AnnotationProvider |
NULL_ANNOTATION_PROVIDER |
Constructor and Description |
---|
InternalCommonsUtils() |
Modifier and Type | Method and Description |
---|---|
static <K,V> void |
addToMapList(java.util.Map<K,java.util.List<V>> map,
K key,
V value)
Adds a value to a specially organized map where the values are lists of objects.
|
static java.lang.String |
asString(java.lang.reflect.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).
|
static java.lang.String |
capitalize(java.lang.String input)
Capitalizes a string, converting the first character to uppercase.
|
static boolean |
containsSymbols(java.lang.String input)
Return true if the input string contains the marker for symbols that must be expanded.
|
static java.lang.String |
defaultLabel(java.lang.String id,
Messages messages,
java.lang.String propertyExpression)
Looks for a label within the messages based on the id.
|
static java.lang.String |
extractIdFromPropertyExpression(java.lang.String expression)
Used to convert a property expression into a key that can be used to locate various resources (Blocks, messages,
etc.).
|
static boolean |
isBlank(java.lang.String input)
Returns true if the input is null, or is a zero length string (excluding leading/trailing whitespace).
|
static boolean |
isNonBlank(java.lang.String input) |
static java.lang.String |
join(java.util.List elements)
Joins together some number of elements to form a comma separated list.
|
static java.lang.String |
join(java.util.List elements,
java.lang.String separator)
Joins together some number of elements.
|
static java.lang.String |
joinSorted(java.util.Collection elements)
Creates a sorted copy of the provided elements, then turns that into a comma separated list.
|
static java.lang.String |
lastTerm(java.lang.String input)
Searches the string for the final period ('.') character and returns everything after that.
|
static Location |
locationOf(java.lang.Object location)
|
static java.lang.String |
replace(java.lang.String input,
java.util.regex.Pattern pattern,
java.lang.String replacement) |
static java.util.List<java.lang.String> |
sortedKeys(java.util.Map map)
Extracts the string keys from a map and returns them in sorted order.
|
static java.lang.String |
stripMemberName(java.lang.String memberName)
Strips leading "_" and "$" and trailing "_" from the name.
|
static AnnotationProvider |
toAnnotationProvider(java.lang.Class element) |
static AnnotationProvider |
toAnnotationProvider(java.lang.reflect.Method element) |
static java.lang.String |
toUserPresentable(java.lang.String id)
Capitalizes the string, and inserts a space before each upper case character (or sequence of upper case
characters).
|
public static final AnnotationProvider NULL_ANNOTATION_PROVIDER
public InternalCommonsUtils()
public static <K,V> void addToMapList(java.util.Map<K,java.util.List<V>> map, K key, V value)
K
- the type of keyV
- the type of the listmap
- to store value intokey
- for which a value is addedvalue
- to addpublic static Location locationOf(java.lang.Object location)
public static AnnotationProvider toAnnotationProvider(java.lang.reflect.Method element)
public static java.lang.String extractIdFromPropertyExpression(java.lang.String expression)
expression
- a property expressionpublic static java.lang.String replace(java.lang.String input, java.util.regex.Pattern pattern, java.lang.String replacement)
public static java.lang.String defaultLabel(java.lang.String id, Messages messages, java.lang.String propertyExpression)
public static java.lang.String toUserPresentable(java.lang.String id)
public static AnnotationProvider toAnnotationProvider(java.lang.Class element)
public static java.lang.String asString(java.lang.reflect.Method method)
method
- public static java.lang.String stripMemberName(java.lang.String memberName)
public static java.lang.String join(java.util.List elements)
public static java.lang.String join(java.util.List elements, java.lang.String separator)
elements
- objects to be joined togetherseparator
- used between elements when joiningpublic static java.lang.String joinSorted(java.util.Collection elements)
public static boolean isBlank(java.lang.String input)
public static java.lang.String capitalize(java.lang.String input)
public static boolean isNonBlank(java.lang.String input)
public static boolean containsSymbols(java.lang.String input)
public static java.lang.String lastTerm(java.lang.String input)
public static java.util.List<java.lang.String> sortedKeys(java.util.Map map)
map
- the map to extract keys from (may be null)${project.version} - Copyright © 2003-2015 The Apache Software Foundation.