org.thymeleaf.expression
Class Strings

Object
  extended by org.thymeleaf.expression.Strings

public final class Strings
extends Object

Since:
1.0
Author:
Daniel Fernández, Le Roux Bernard

Constructor Summary
Strings()
           
 
Method Summary
 String abbreviate(Object target, int maxSize)
           
 String append(Object target, String suffix)
           
 String[] arrayAbbreviate(Object[] target, int maxSize)
           
 String[] arrayAppend(Object[] target, String suffix)
           
 String[] arrayCapitalize(Object[] target)
           Convert the first letter into uppercase (title-case, in fact) for all the elements in the target array.
 String[] arrayCapitalizeWords(Object[] target)
           Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array.
 String[] arrayCapitalizeWords(Object[] target, Object delimiters)
           Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array.
 Boolean[] arrayContains(Object[] target, String fragment)
           
 Boolean[] arrayContainsIgnoreCase(Object[] target, String fragment)
           
 Boolean[] arrayEndsWith(Object[] target, String suffix)
           
 Integer[] arrayIndexOf(Object[] target, String fragment)
           
 Boolean[] arrayIsEmpty(Object[] target)
           
 String arrayJoin(Object[] stringArray, String separator)
           
 Integer[] arrayLength(Object[] target)
           
 String[] arrayPrepend(Object[] target, String prefix)
           
 String[] arrayReplace(Object[] target, String before, String after)
           
 String[] arraySplit(Object target, String separator)
           
 Boolean[] arrayStartsWith(Object[] target, String prefix)
           
 String[] arraySubstring(Object[] target, int start)
           copy a part of target start beginIndex to the end of target for all the elements in the target array.
 String[] arraySubstring(Object[] target, int start, int end)
           
 String[] arraySubstringAfter(Object[] target, String substr)
           
 String[] arraySubstringBefore(Object[] target, String substr)
           
 String[] arrayToLowerCase(Object[] target)
           
 String[] arrayToUpperCase(Object[] target)
           
 String[] arrayTrim(Object[] target)
           
 String[] arrayUnCapitalize(Object[] target)
           Convert the first letter into lowercase for all the elements in the target array.
 String capitalize(Object target)
           Convert the first letter of target to uppercase (title-case, in fact).
 String capitalizeWords(Object target)
           Convert the first letter of each words of target to uppercase (title-case, in fact).
 String capitalizeWords(Object target, Object delimiters)
           Convert the first letter of each words of target to uppercase (title-case, in fact), using the specified delimiter chars for determining word ends/starts.
 Boolean contains(Object target, String fragment)
           
 Boolean containsIgnoreCase(Object target, String fragment)
           
 Boolean endsWith(Object target, String suffix)
           
 Integer indexOf(Object target, String fragment)
           
 Boolean isEmpty(Object target)
           
 Integer length(Object target)
           
 java.util.List<String> listAbbreviate(java.util.List<?> target, int maxSize)
           
 java.util.List<String> listAppend(java.util.List<?> target, String suffix)
           
 java.util.List<String> listCapitalize(java.util.List<?> target)
           Convert the first letter into uppercase (title-case, in fact) for all the elements in the target list.
 java.util.List<String> listCapitalizeWords(java.util.List<?> target)
           Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list.
 java.util.List<String> listCapitalizeWords(java.util.List<?> target, Object delimiters)
           Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list.
 java.util.List<Boolean> listContains(java.util.List<?> target, String fragment)
           
 java.util.List<Boolean> listContainsIgnoreCase(java.util.List<?> target, String fragment)
           
 java.util.List<Boolean> listEndsWith(java.util.List<?> target, String suffix)
           
 java.util.List<Integer> listIndexOf(java.util.List<?> target, String fragment)
           
 java.util.List<Boolean> listIsEmpty(java.util.List<?> target)
           
 String listJoin(java.util.List<?> stringIter, String separator)
           
 java.util.List<Integer> listLength(java.util.List<?> target)
           
 java.util.List<String> listPrepend(java.util.List<?> target, String prefix)
           
 java.util.List<String> listReplace(java.util.List<?> target, String before, String after)
           
 java.util.List<String> listSplit(Object target, String separator)
           
 java.util.List<Boolean> listStartsWith(java.util.List<?> target, String prefix)
           
 java.util.List<String> listSubstring(java.util.List<?> target, int start)
           copy a part of target start beginIndex to the end of target for all the elements in the target list.
 java.util.List<String> listSubstring(java.util.List<?> target, int start, int end)
           
 java.util.List<String> listSubstringAfter(java.util.List<?> target, String substr)
           
 java.util.List<String> listSubstringBefore(java.util.List<?> target, String substr)
           
 java.util.List<String> listToLowerCase(java.util.List<?> target)
           
 java.util.List<String> listToUpperCase(java.util.List<?> target)
           
 java.util.List<String> listTrim(java.util.List<?> target)
           
 java.util.List<String> listUnCapitalize(java.util.List<?> target)
           Convert the first letter into lowercase for all the elements in the target list.
 String prepend(Object target, String prefix)
           
 String replace(Object target, String before, String after)
           
 java.util.Set<String> setAbbreviate(java.util.Set<?> target, int maxSize)
           
 java.util.Set<String> setAppend(java.util.Set<?> target, String suffix)
           
 java.util.Set<String> setCapitalize(java.util.Set<?> target)
           Convert the first letter into uppercase (title-case, in fact) for all the elements in the target set.
 java.util.Set<String> setCapitalizeWords(java.util.Set<?> target)
           Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set.
 java.util.Set<String> setCapitalizeWords(java.util.Set<?> target, Object delimiters)
           Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set.
 java.util.Set<Boolean> setContains(java.util.Set<?> target, String fragment)
           
 java.util.Set<Boolean> setContainsIgnoreCase(java.util.Set<?> target, String fragment)
           
 java.util.Set<Boolean> setEndsWith(java.util.Set<?> target, String suffix)
           
 java.util.Set<Integer> setIndexOf(java.util.Set<?> target, String fragment)
           
 java.util.Set<Boolean> setIsEmpty(java.util.Set<?> target)
           
 String setJoin(java.util.Set<?> stringIter, String separator)
           
 java.util.Set<Integer> setLength(java.util.Set<?> target)
           
 java.util.Set<String> setPrepend(java.util.Set<?> target, String prefix)
           
 java.util.Set<String> setReplace(java.util.Set<?> target, String before, String after)
           
 java.util.Set<String> setSplit(Object target, String separator)
           
 java.util.Set<Boolean> setStartsWith(java.util.Set<?> target, String prefix)
           
 java.util.Set<String> setSubstring(java.util.Set<?> target, int start)
           copy a part of target start beginIndex to the end of target for all the elements in the target set.
 java.util.Set<String> setSubstring(java.util.Set<?> target, int start, int end)
           
 java.util.Set<String> setSubstringAfter(java.util.Set<?> target, String substr)
           
 java.util.Set<String> setSubstringBefore(java.util.Set<?> target, String substr)
           
 java.util.Set<String> setToLowerCase(java.util.Set<?> target)
           
 java.util.Set<String> setToUpperCase(java.util.Set<?> target)
           
 java.util.Set<String> setTrim(java.util.Set<?> target)
           
 java.util.Set<String> setUnCapitalize(java.util.Set<?> target)
           Convert the first letter into lowercase for all the elements in the target set.
 Boolean startsWith(Object target, String prefix)
           
 String substring(Object target, int start)
           copy a part of target start beginIndex to the end of target.
 String substring(Object target, int start, int end)
           
 String substringAfter(Object target, String substr)
           
 String substringBefore(Object target, String substr)
           
 String toLowerCase(Object target)
           
 String toUpperCase(Object target)
           
 String trim(Object target)
           
 String unCapitalize(Object target)
           Convert the first letter of target to lowercase.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Strings

public Strings()
Method Detail

abbreviate

public String abbreviate(Object target,
                         int maxSize)

arrayAbbreviate

public String[] arrayAbbreviate(Object[] target,
                                int maxSize)

listAbbreviate

public java.util.List<String> listAbbreviate(java.util.List<?> target,
                                             int maxSize)

setAbbreviate

public java.util.Set<String> setAbbreviate(java.util.Set<?> target,
                                           int maxSize)

contains

public Boolean contains(Object target,
                        String fragment)

arrayContains

public Boolean[] arrayContains(Object[] target,
                               String fragment)

listContains

public java.util.List<Boolean> listContains(java.util.List<?> target,
                                            String fragment)

setContains

public java.util.Set<Boolean> setContains(java.util.Set<?> target,
                                          String fragment)

containsIgnoreCase

public Boolean containsIgnoreCase(Object target,
                                  String fragment)

arrayContainsIgnoreCase

public Boolean[] arrayContainsIgnoreCase(Object[] target,
                                         String fragment)

listContainsIgnoreCase

public java.util.List<Boolean> listContainsIgnoreCase(java.util.List<?> target,
                                                      String fragment)

setContainsIgnoreCase

public java.util.Set<Boolean> setContainsIgnoreCase(java.util.Set<?> target,
                                                    String fragment)

startsWith

public Boolean startsWith(Object target,
                          String prefix)

arrayStartsWith

public Boolean[] arrayStartsWith(Object[] target,
                                 String prefix)

listStartsWith

public java.util.List<Boolean> listStartsWith(java.util.List<?> target,
                                              String prefix)

setStartsWith

public java.util.Set<Boolean> setStartsWith(java.util.Set<?> target,
                                            String prefix)

endsWith

public Boolean endsWith(Object target,
                        String suffix)

arrayEndsWith

public Boolean[] arrayEndsWith(Object[] target,
                               String suffix)

listEndsWith

public java.util.List<Boolean> listEndsWith(java.util.List<?> target,
                                            String suffix)

setEndsWith

public java.util.Set<Boolean> setEndsWith(java.util.Set<?> target,
                                          String suffix)

substring

public String substring(Object target,
                        int start,
                        int end)

arraySubstring

public String[] arraySubstring(Object[] target,
                               int start,
                               int end)

listSubstring

public java.util.List<String> listSubstring(java.util.List<?> target,
                                            int start,
                                            int end)

setSubstring

public java.util.Set<String> setSubstring(java.util.Set<?> target,
                                          int start,
                                          int end)

substring

public String substring(Object target,
                        int start)

copy a part of target start beginIndex to the end of target. If non-String object, toString() will be called.

Parameters:
target - source of the copy.
start - index where the copy start.
Returns:
part of target.
Since:
1.1.2

arraySubstring

public String[] arraySubstring(Object[] target,
                               int start)

copy a part of target start beginIndex to the end of target for all the elements in the target array. If non-String object, toString() will be called.

Parameters:
target - source of the copy.
start - index where the copy start.
Returns:
part of target.
Since:
1.1.2

listSubstring

public java.util.List<String> listSubstring(java.util.List<?> target,
                                            int start)

copy a part of target start beginIndex to the end of target for all the elements in the target list. If non-String object, toString() will be called.

Parameters:
target - source of the copy.
start - index where the copy start.
Returns:
part of target.
Since:
1.1.2

setSubstring

public java.util.Set<String> setSubstring(java.util.Set<?> target,
                                          int start)

copy a part of target start beginIndex to the end of target for all the elements in the target set. If non-String object, toString() will be called.

Parameters:
target - source of the copy.
start - index where the copy start.
Returns:
part of target.
Since:
1.1.2

substringAfter

public String substringAfter(Object target,
                             String substr)

arraySubstringAfter

public String[] arraySubstringAfter(Object[] target,
                                    String substr)

listSubstringAfter

public java.util.List<String> listSubstringAfter(java.util.List<?> target,
                                                 String substr)

setSubstringAfter

public java.util.Set<String> setSubstringAfter(java.util.Set<?> target,
                                               String substr)

substringBefore

public String substringBefore(Object target,
                              String substr)

arraySubstringBefore

public String[] arraySubstringBefore(Object[] target,
                                     String substr)

listSubstringBefore

public java.util.List<String> listSubstringBefore(java.util.List<?> target,
                                                  String substr)

setSubstringBefore

public java.util.Set<String> setSubstringBefore(java.util.Set<?> target,
                                                String substr)

prepend

public String prepend(Object target,
                      String prefix)

arrayPrepend

public String[] arrayPrepend(Object[] target,
                             String prefix)

listPrepend

public java.util.List<String> listPrepend(java.util.List<?> target,
                                          String prefix)

setPrepend

public java.util.Set<String> setPrepend(java.util.Set<?> target,
                                        String prefix)

append

public String append(Object target,
                     String suffix)

arrayAppend

public String[] arrayAppend(Object[] target,
                            String suffix)

listAppend

public java.util.List<String> listAppend(java.util.List<?> target,
                                         String suffix)

setAppend

public java.util.Set<String> setAppend(java.util.Set<?> target,
                                       String suffix)

indexOf

public Integer indexOf(Object target,
                       String fragment)

arrayIndexOf

public Integer[] arrayIndexOf(Object[] target,
                              String fragment)

listIndexOf

public java.util.List<Integer> listIndexOf(java.util.List<?> target,
                                           String fragment)

setIndexOf

public java.util.Set<Integer> setIndexOf(java.util.Set<?> target,
                                         String fragment)

isEmpty

public Boolean isEmpty(Object target)

arrayIsEmpty

public Boolean[] arrayIsEmpty(Object[] target)

listIsEmpty

public java.util.List<Boolean> listIsEmpty(java.util.List<?> target)

setIsEmpty

public java.util.Set<Boolean> setIsEmpty(java.util.Set<?> target)

arrayJoin

public String arrayJoin(Object[] stringArray,
                        String separator)

listJoin

public String listJoin(java.util.List<?> stringIter,
                       String separator)

setJoin

public String setJoin(java.util.Set<?> stringIter,
                      String separator)

arraySplit

public String[] arraySplit(Object target,
                           String separator)

listSplit

public java.util.List<String> listSplit(Object target,
                                        String separator)

setSplit

public java.util.Set<String> setSplit(Object target,
                                      String separator)

length

public Integer length(Object target)

arrayLength

public Integer[] arrayLength(Object[] target)

listLength

public java.util.List<Integer> listLength(java.util.List<?> target)

setLength

public java.util.Set<Integer> setLength(java.util.Set<?> target)

replace

public String replace(Object target,
                      String before,
                      String after)

arrayReplace

public String[] arrayReplace(Object[] target,
                             String before,
                             String after)

listReplace

public java.util.List<String> listReplace(java.util.List<?> target,
                                          String before,
                                          String after)

setReplace

public java.util.Set<String> setReplace(java.util.Set<?> target,
                                        String before,
                                        String after)

toUpperCase

public String toUpperCase(Object target)

arrayToUpperCase

public String[] arrayToUpperCase(Object[] target)

listToUpperCase

public java.util.List<String> listToUpperCase(java.util.List<?> target)

setToUpperCase

public java.util.Set<String> setToUpperCase(java.util.Set<?> target)

toLowerCase

public String toLowerCase(Object target)

arrayToLowerCase

public String[] arrayToLowerCase(Object[] target)

listToLowerCase

public java.util.List<String> listToLowerCase(java.util.List<?> target)

setToLowerCase

public java.util.Set<String> setToLowerCase(java.util.Set<?> target)

trim

public String trim(Object target)

arrayTrim

public String[] arrayTrim(Object[] target)

listTrim

public java.util.List<String> listTrim(java.util.List<?> target)

setTrim

public java.util.Set<String> setTrim(java.util.Set<?> target)

capitalize

public String capitalize(Object target)

Convert the first letter of target to uppercase (title-case, in fact).

Parameters:
target - the String to be capitalized. If non-String object, toString() will be called.
Returns:
String the result of capitalizing the target.
Since:
1.1.2

arrayCapitalize

public String[] arrayCapitalize(Object[] target)

Convert the first letter into uppercase (title-case, in fact) for all the elements in the target array.

Parameters:
target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
Returns:
a String[] with the result of capitalizing each element of the target.
Since:
1.1.2

listCapitalize

public java.util.List<String> listCapitalize(java.util.List<?> target)

Convert the first letter into uppercase (title-case, in fact) for all the elements in the target list.

Parameters:
target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
Returns:
a List with the result of capitalizing each element of the target.
Since:
1.1.2

setCapitalize

public java.util.Set<String> setCapitalize(java.util.Set<?> target)

Convert the first letter into uppercase (title-case, in fact) for all the elements in the target set.

Parameters:
target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
Returns:
a Set with the result of capitalizing each element of the target.
Since:
1.1.2

unCapitalize

public String unCapitalize(Object target)

Convert the first letter of target to lowercase.

Parameters:
target - the String to be uncapitalized. If non-String object, toString() will be called.
Returns:
String the result of uncapitalizing the target.
Since:
1.1.2

arrayUnCapitalize

public String[] arrayUnCapitalize(Object[] target)

Convert the first letter into lowercase for all the elements in the target array.

Parameters:
target - the array of Strings to be uncapitalized. If non-String objects, toString() will be called.
Returns:
a String[] with the result of uncapitalizing each element of the target.
Since:
1.1.2

listUnCapitalize

public java.util.List<String> listUnCapitalize(java.util.List<?> target)

Convert the first letter into lowercase for all the elements in the target list.

Parameters:
target - the list of Strings to be uncapitalized. If non-String objects, toString() will be called.
Returns:
a List with the result of uncapitalizing each element of the target.
Since:
1.1.2

setUnCapitalize

public java.util.Set<String> setUnCapitalize(java.util.Set<?> target)

Convert the first letter into lowercase for all the elements in the target set.

Parameters:
target - the set of Strings to be uncapitalized. If non-String objects, toString() will be called.
Returns:
a Set with the result of uncapitalizing each element of the target.
Since:
1.1.2

capitalizeWords

public String capitalizeWords(Object target)

Convert the first letter of each words of target to uppercase (title-case, in fact). The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

Parameters:
target - the String to be capitalized. If non-String object, toString() will be called.
Returns:
String the result of capitalizing the target.
Since:
1.1.2

arrayCapitalizeWords

public String[] arrayCapitalizeWords(Object[] target)

Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

Parameters:
target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
Returns:
a String[] with the result of capitalizing each element of the target.
Since:
1.1.2

listCapitalizeWords

public java.util.List<String> listCapitalizeWords(java.util.List<?> target)

Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

Parameters:
target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
Returns:
a List with the result of capitalizing each element of the target.
Since:
1.1.2

setCapitalizeWords

public java.util.Set<String> setCapitalizeWords(java.util.Set<?> target)

Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

Parameters:
target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
Returns:
a Set with the result of capitalizing each element of the target.
Since:
1.1.2

capitalizeWords

public String capitalizeWords(Object target,
                              Object delimiters)

Convert the first letter of each words of target to uppercase (title-case, in fact), using the specified delimiter chars for determining word ends/starts.

Parameters:
target - the String to be capitalized. If non-String object, toString() will be called.
delimiters - the delimiters of the words. If non-String object, toString() will be called.
Returns:
String the result of capitalizing the target.
Since:
1.1.2

arrayCapitalizeWords

public String[] arrayCapitalizeWords(Object[] target,
                                     Object delimiters)

Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array. The specified delimiter chars will be used for determining word ends/starts.

Parameters:
target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
delimiters - the delimiters of the words. If non-String object, toString() will be called.
Returns:
a String[] with the result of capitalizing each element of the target.
Since:
1.1.2

listCapitalizeWords

public java.util.List<String> listCapitalizeWords(java.util.List<?> target,
                                                  Object delimiters)

Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list. The specified delimiter chars will be used for determining word ends/starts.

Parameters:
target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
delimiters - the delimiters of the words. If non-String object, toString() will be called.
Returns:
a List with the result of capitalizing each element of the target.
Since:
1.1.2

setCapitalizeWords

public java.util.Set<String> setCapitalizeWords(java.util.Set<?> target,
                                                Object delimiters)

Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set. The specified delimiter chars will be used for determining word ends/starts.

Parameters:
target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
delimiters - the delimiters of the words. If non-String object, toString()
Returns:
a Set with the result of capitalizing each element of the target.
Since:
1.1.2


Copyright © 2012 The THYMELEAF team. All Rights Reserved.