Java Doc for StringUtils.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » tools » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » rife 1.6.1 » com.uwyn.rife.tools 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.uwyn.rife.tools.StringUtils

StringUtils
abstract public class StringUtils (Code)
General purpose class containing common String manipulation methods.
author:
   Geert Bevin (gbevin[remove] at uwyn dot com)
version:
   $Revision: 3634 $
since:
   1.0

Inner Class :public static class BbcodeOption extends EnumClass

Field Summary
final public static  PatternBBCODE_BAREURL
    
final public static  PatternBBCODE_COLOR
    
final public static  PatternBBCODE_IMG
    
final public static  PatternBBCODE_QUOTE_LONG
    
final public static  PatternBBCODE_SIZE
    
final public static  PatternBBCODE_URL_LONG
    
final public static  PatternBBCODE_URL_SHORT
    
public static  CharsetCHARSET_US_ASCII
    
final public static  BbcodeOptionCONVERT_BARE_URLS
    
public static  StringENCODING_ISO_8859_1
    
public static  StringENCODING_ISO_8859_2
    
public static  StringENCODING_ISO_8859_5
    
public static  StringENCODING_US_ASCII
    
public static  StringENCODING_UTF_16
    
public static  StringENCODING_UTF_16BE
    
public static  StringENCODING_UTF_16LE
    
public static  StringENCODING_UTF_8
    
final public static  BbcodeOptionNO_FOLLOW_LINKS
    
final public static  BbcodeOptionSANITIZE_URL
    
final public static  BbcodeOptionSHORTEN_URL
    


Method Summary
public static  Stringcapitalize(String source)
     Ensure that the first character of the provided string is upper case.
Parameters:
  source - The String to capitalize.
public static  StringconvertBbcode(String source)
     Converts a BBCode marked-up text to regular html.
Parameters:
  source - The text with BBCode tags.
public static  StringconvertBbcode(String source, BbcodeOption... options)
     Converts a BBCode marked-up text to regular html.
Parameters:
  source - The text with BBCode tags.
public static  StringconvertTabsToSpaces(String line, int tabWidth)
     Converts all tabs on a line to spaces according to the provided tab width.
Parameters:
  line - The line whose tabs have to be converted.
Parameters:
  tabWidth - The tab width.
public static  booleanconvertToBoolean(String value)
     Converts a String to a boolean value.
Parameters:
  value - The String to convert.
public static  intcount(String source, String substring)
     Counts the number of times a substring occures in a provided string in a case-sensitive manner.
Parameters:
  source - The String object that will be searched in.
Parameters:
  substring - The string whose occurances will we counted.
public static  intcount(String source, String substring, boolean matchCase)
     Counts the number of times a substring occures in a provided string.
Parameters:
  source - The String object that will be searched in.
Parameters:
  substring - The string whose occurances will we counted.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not.
public static  StringdecodeHtml(String source)
    
public static  StringdecodeUrlValue(String source)
     Decodes a String that has been encoded in a RIFE-specific manner for URL usage..
public static  booleandoesUrlValueNeedDecoding(String source)
     Checks if a String is encoded in a RIFE-specific manner for URL usage.
public static  StringencodeClassname(String name)
     Transforms a provided String object into a new string, containing only valid characters for a java class name.
Parameters:
  name - The string that has to be transformed into a valid classname.
public static  StringencodeHtml(String source)
     Transforms a provided String object into a new string, containing only valid Html characters.
Parameters:
  source - The string that has to be transformed into a valid Htmlstring.
public static  StringencodeHtmlDefensive(String source)
     Transforms a provided String object into a new string, containing as much as possible Html characters.
public static  StringencodeLatex(String source)
     Transforms a provided String object into a new string, containing only valid LaTeX characters.
Parameters:
  source - The string that has to be transformed into a valid LaTeXstring.
public static  StringencodeRegexp(String source)
     Transforms a provided String object into a literal that can be included into a regular expression Pattern as-is.
public static  StringencodeSql(String source)
     Transforms a provided String object into a new string, containing only valid Sql characters.
Parameters:
  source - The string that has to be transformed into a valid Sqlstring.
public static  StringencodeString(String source)
     Transforms a provided String object into a new string, containing only valid String characters.
Parameters:
  source - The string that has to be transformed into a validsequence of String characters.
public static  StringencodeUnicode(String source)
     Transforms a provided String object into a series of unicode escape codes.
public static  StringencodeUrl(String source)
     Transforms a provided String object into a new string, containing only valid URL characters.
Parameters:
  source - The string that has to be transformed into a valid URLstring.
public static  StringencodeUrlValue(String source)
     Transforms a provided String object into a new string, only pure US Ascii strings are preserved and URL encoded in a regular way.
public static  StringencodeXml(String source)
     Transforms a provided String object into a new string, containing only valid XML characters.
Parameters:
  source - The string that has to be transformed into a valid XMLstring.
public static  booleanfilter(String name, Pattern included, Pattern excluded)
     Checks if the name filters through an including and an excluding regular expression.
public static  booleanfilter(String name, Pattern[] included, Pattern[] excluded)
     Checks if the name filters through a series of including and excluding regular expressions.
public static  DocumentPositiongetDocumentPosition(String document, int characterIndex)
     Calculates the DocumentPosition of a character index in a document.
public static  MatchergetMatchingRegexp(String value, Collection<Pattern> regexps)
     Matches a collection of regular expressions against a string.
Parameters:
  value - The String that will be checked.
Parameters:
  regexps - The collection of regular expressions against which thematch will be performed.
public static  MatchergetRegexpMatch(Collection<String> values, Pattern regexp)
     Matches a collection of strings against a regular expression.
Parameters:
  values - The Collection of Stringobjects that will be checked.
Parameters:
  regexp - The regular expression Pattern against whichthe matches will be performed.
public static  int[]indicesOf(String source, String substring)
     Returns an array that contains all the occurances of a substring in a string in the correct order.
public static  int[]indicesOf(String source, String substring, boolean matchCase)
     Returns an array that contains all the occurances of a substring in a string in the correct order.
Parameters:
  source - The String object that will be searched in.
Parameters:
  substring - The string whose occurances will we counted.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not.
public static  Stringjoin(Collection collection, String seperator)
     Creates a new String object, containing the elements of a supplied Collection of String objects joined by a given seperator.
Parameters:
  collection - The Collection containing the elementsto join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(Object[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The object array containing the elements to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(Object[] array, String seperator, String delimiter)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The object array containing the elements to join.
Parameters:
  seperator - The seperator used to join the string elements.
Parameters:
  delimiter - The delimiter used to surround the string elements.
public static  Stringjoin(Object[] array, String seperator, String delimiter, boolean encodeStrings)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The object array containing the elements to join.
Parameters:
  seperator - The seperator used to join the string elements.
Parameters:
  delimiter - The delimiter used to surround the string elements.
Parameters:
  encodeStrings - Indicates whether the characters of the stringrepresentation of the Array values should be encoded.
public static  Stringjoin(boolean[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The boolean array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(byte[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The byte array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(double[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The double array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(float[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The float array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(int[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The integer array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(long[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The long array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(short[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The short array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(char[] array, String seperator)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The char array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
public static  Stringjoin(char[] array, String seperator, String delimiter)
     Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The char array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
Parameters:
  delimiter - The delimiter used to surround the string elements.
public static  Stringrepeat(String source, int count)
     Creates a new string that contains the provided string a number of times.
Parameters:
  source - The string that will be repeated.
Parameters:
  count - The number of times that the string will be repeated.
public static  Stringreplace(String source, String stringToReplace, String replacementString)
     Searches for a string within a specified string in a case-sensitive manner and replaces every match with another string.
Parameters:
  source - The string in which the matching parts will be replaced.
Parameters:
  stringToReplace - The string that will be searched for.
Parameters:
  replacementString - The string that will replace each matchingpart.
public static  Stringreplace(String source, String stringToReplace, String replacementString, boolean matchCase)
     Searches for a string within a specified string and replaces every match with another string.
Parameters:
  source - The string in which the matching parts will be replaced.
Parameters:
  stringToReplace - The string that will be searched for.
Parameters:
  replacementString - The string that will replace each matchingpart.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not.
public static  ArrayList<String>split(String source, String seperator)
     Splits a string into different parts, using a seperator string to detect the seperation boundaries in a case-sensitive manner.
public static  ArrayList<String>split(String source, String seperator, boolean matchCase)
     Splits a string into different parts, using a seperator string to detect the seperation boundaries.
public static  String[]splitToArray(String source, String seperator)
     Splits a string into different parts, using a seperator string to detect the seperation boundaries in a case-sensitive manner.
public static  String[]splitToArray(String source, String seperator, boolean matchCase)
     Splits a string into different parts, using a seperator string to detect the seperation boundaries.
public static  byte[]splitToByteArray(String source, String seperator)
     Splits a string into bytes, using a seperator string to detect the seperation boundaries in a case-sensitive manner.
public static  byte[]splitToByteArray(String source, String seperator, boolean matchCase)
     Splits a string into bytes, using a seperator string to detect the seperation boundaries.
public static  int[]splitToIntArray(String source, String seperator)
     Splits a string into integers, using a seperator string to detect the seperation boundaries in a case-sensitive manner.
public static  int[]splitToIntArray(String source, String seperator, boolean matchCase)
     Splits a string into integers, using a seperator string to detect the seperation boundaries.
public static  StringstripFromEnd(String source, String stringToStrip)
     Removes all occurances of a string from the end of another string in a case-sensitive manner.
Parameters:
  source - The string in which the matching will be done.
Parameters:
  stringToStrip - The string that will be stripped from the end.
public static  StringstripFromEnd(String source, String stringToStrip, boolean matchCase)
     Removes all occurances of a string from the end of another string.
Parameters:
  source - The string in which the matching will be done.
Parameters:
  stringToStrip - The string that will be stripped from the end.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not.
public static  StringstripFromFront(String source, String stringToStrip)
     Removes all occurances of a string from the front of another string in a case-sensitive manner.
Parameters:
  source - The string in which the matching will be done.
Parameters:
  stringToStrip - The string that will be stripped from the front.
public static  StringstripFromFront(String source, String stringToStrip, boolean matchCase)
     Removes all occurances of a string from the front of another string.
Parameters:
  source - The string in which the matching will be done.
Parameters:
  stringToStrip - The string that will be stripped from the front.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not.
public static  ArrayList<String>toArrayList(String[] stringArray)
     Creates a new ArrayList, containing the elements of a supplied array of String objects.
Parameters:
  stringArray - The array of String objects that haveto be converted.
public static  String[]toStringArray(Iterator<String> iterator)
     Creates a new array of String objects, containing the elements of a supplied Iterator.
Parameters:
  iterator - The iterator containing the elements to create thearray with.
public static  Stringtrim(String source)
     Ensures that all whitespace is removed from a String.

It also works with a null argument.
Parameters:
  source - The String to trim.

public static  Stringuncapitalize(String source)
     Ensure that the first character of the provided string lower case.
Parameters:
  source - The String to uncapitalize.
public static  StringwordWrap(String input, int width, Locale locale)
     Reformats a string where lines that are longer than width are split apart at the earliest wordbreak or at maxLength, whichever is sooner.

Field Detail
BBCODE_BAREURL
final public static Pattern BBCODE_BAREURL(Code)



BBCODE_COLOR
final public static Pattern BBCODE_COLOR(Code)



BBCODE_IMG
final public static Pattern BBCODE_IMG(Code)



BBCODE_QUOTE_LONG
final public static Pattern BBCODE_QUOTE_LONG(Code)



BBCODE_SIZE
final public static Pattern BBCODE_SIZE(Code)



BBCODE_URL_LONG
final public static Pattern BBCODE_URL_LONG(Code)



BBCODE_URL_SHORT
final public static Pattern BBCODE_URL_SHORT(Code)



CHARSET_US_ASCII
public static Charset CHARSET_US_ASCII(Code)



CONVERT_BARE_URLS
final public static BbcodeOption CONVERT_BARE_URLS(Code)



ENCODING_ISO_8859_1
public static String ENCODING_ISO_8859_1(Code)



ENCODING_ISO_8859_2
public static String ENCODING_ISO_8859_2(Code)



ENCODING_ISO_8859_5
public static String ENCODING_ISO_8859_5(Code)



ENCODING_US_ASCII
public static String ENCODING_US_ASCII(Code)



ENCODING_UTF_16
public static String ENCODING_UTF_16(Code)



ENCODING_UTF_16BE
public static String ENCODING_UTF_16BE(Code)



ENCODING_UTF_16LE
public static String ENCODING_UTF_16LE(Code)



ENCODING_UTF_8
public static String ENCODING_UTF_8(Code)



NO_FOLLOW_LINKS
final public static BbcodeOption NO_FOLLOW_LINKS(Code)



SANITIZE_URL
final public static BbcodeOption SANITIZE_URL(Code)



SHORTEN_URL
final public static BbcodeOption SHORTEN_URL(Code)





Method Detail
capitalize
public static String capitalize(String source)(Code)
Ensure that the first character of the provided string is upper case.
Parameters:
  source - The String to capitalize. The capitalized String.
since:
   1.0



convertBbcode
public static String convertBbcode(String source)(Code)
Converts a BBCode marked-up text to regular html.
Parameters:
  source - The text with BBCode tags. A String with the corresponding HTML code
since:
   1.0



convertBbcode
public static String convertBbcode(String source, BbcodeOption... options)(Code)
Converts a BBCode marked-up text to regular html.
Parameters:
  source - The text with BBCode tags. A String with the corresponding HTML code
since:
   1.0



convertTabsToSpaces
public static String convertTabsToSpaces(String line, int tabWidth)(Code)
Converts all tabs on a line to spaces according to the provided tab width.
Parameters:
  line - The line whose tabs have to be converted.
Parameters:
  tabWidth - The tab width. A new String object containing the line with thereplaced tabs.
since:
   1.0



convertToBoolean
public static boolean convertToBoolean(String value)(Code)
Converts a String to a boolean value.
Parameters:
  value - The String to convert. The corresponding boolean value.
since:
   1.0



count
public static int count(String source, String substring)(Code)
Counts the number of times a substring occures in a provided string in a case-sensitive manner.
Parameters:
  source - The String object that will be searched in.
Parameters:
  substring - The string whose occurances will we counted. An int value containing the number of occurancesof the substring.
since:
   1.0



count
public static int count(String source, String substring, boolean matchCase)(Code)
Counts the number of times a substring occures in a provided string.
Parameters:
  source - The String object that will be searched in.
Parameters:
  substring - The string whose occurances will we counted.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. An int value containing the number of occurancesof the substring.
since:
   1.0



decodeHtml
public static String decodeHtml(String source)(Code)

since:
   1.6



decodeUrlValue
public static String decodeUrlValue(String source)(Code)
Decodes a String that has been encoded in a RIFE-specific manner for URL usage.. Before calling this method, you should first verify if the value needs decoding by using the doesUrlValueNeedDecoding(String) method.
Parameters:
  source - the value that has been encoded for URL usage in aRIFE-specific way The decoded String object.
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.doesUrlValueNeedDecoding(String)
since:
   1.0



doesUrlValueNeedDecoding
public static boolean doesUrlValueNeedDecoding(String source)(Code)
Checks if a String is encoded in a RIFE-specific manner for URL usage.
Parameters:
  source - the value that might have been encoded for URL usage in aRIFE-specific way true if the value is encoded in the RIFE-specificformat; and

false otherwise
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.decodeUrlValue(String)
since:
   1.0




encodeClassname
public static String encodeClassname(String name)(Code)
Transforms a provided String object into a new string, containing only valid characters for a java class name.
Parameters:
  name - The string that has to be transformed into a valid classname. The encoded String object.
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeHtml
public static String encodeHtml(String source)(Code)
Transforms a provided String object into a new string, containing only valid Html characters.
Parameters:
  source - The string that has to be transformed into a valid Htmlstring. The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeString(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeHtmlDefensive
public static String encodeHtmlDefensive(String source)(Code)
Transforms a provided String object into a new string, containing as much as possible Html characters. It is safe to already feed existing Html to this method since &, < and > will not be encoded.
Parameters:
  source - The string that has to be transformed into a valid Htmlstring. The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeString(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeLatex
public static String encodeLatex(String source)(Code)
Transforms a provided String object into a new string, containing only valid LaTeX characters.
Parameters:
  source - The string that has to be transformed into a valid LaTeXstring. The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeString(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeRegexp
public static String encodeRegexp(String source)(Code)
Transforms a provided String object into a literal that can be included into a regular expression Pattern as-is. None of the regular expression escapes in the string will be functional anymore.
Parameters:
  source - The string that has to be escaped as a literal The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeString(String)
See Also:   StringUtils.encodeLatex(String)
since:
   1.3



encodeSql
public static String encodeSql(String source)(Code)
Transforms a provided String object into a new string, containing only valid Sql characters.
Parameters:
  source - The string that has to be transformed into a valid Sqlstring. The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeString(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeString
public static String encodeString(String source)(Code)
Transforms a provided String object into a new string, containing only valid String characters.
Parameters:
  source - The string that has to be transformed into a validsequence of String characters. The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeUnicode
public static String encodeUnicode(String source)(Code)
Transforms a provided String object into a series of unicode escape codes.
Parameters:
  source - The string that has to be transformed into a validsequence of unicode escape codes The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeUrl
public static String encodeUrl(String source)(Code)
Transforms a provided String object into a new string, containing only valid URL characters.
Parameters:
  source - The string that has to be transformed into a valid URLstring. The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeUrlValue
public static String encodeUrlValue(String source)(Code)
Transforms a provided String object into a new string, only pure US Ascii strings are preserved and URL encoded in a regular way. Strings with characters from other encodings will be encoded in a RIFE-specific manner to allow international data to passed along the query string.
Parameters:
  source - The string that has to be transformed into a valid URLparameter string. The encoded String object.
See Also:   StringUtils.decodeUrlValue(String)
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeXml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



encodeXml
public static String encodeXml(String source)(Code)
Transforms a provided String object into a new string, containing only valid XML characters.
Parameters:
  source - The string that has to be transformed into a valid XMLstring. The encoded String object.
See Also:   StringUtils.encodeClassname(String)
See Also:   StringUtils.encodeUrl(String)
See Also:   StringUtils.encodeUrlValue(String)
See Also:   StringUtils.encodeHtml(String)
See Also:   StringUtils.encodeSql(String)
See Also:   StringUtils.encodeString(String)
See Also:   StringUtils.encodeLatex(String)
See Also:   StringUtils.encodeRegexp(String)
since:
   1.0



filter
public static boolean filter(String name, Pattern included, Pattern excluded)(Code)
Checks if the name filters through an including and an excluding regular expression.
Parameters:
  name - The String that will be filtered.
Parameters:
  included - The regular expressions that needs to succeed
Parameters:
  excluded - The regular expressions that needs to fail true if the name filtered through correctly; or

false otherwise.
since:
   1.0




filter
public static boolean filter(String name, Pattern[] included, Pattern[] excluded)(Code)
Checks if the name filters through a series of including and excluding regular expressions.
Parameters:
  name - The String that will be filtered.
Parameters:
  included - An array of regular expressions that need to succeed
Parameters:
  excluded - An array of regular expressions that need to fail true if the name filtered through correctly; or

false otherwise.
since:
   1.0




getDocumentPosition
public static DocumentPosition getDocumentPosition(String document, int characterIndex)(Code)
Calculates the DocumentPosition of a character index in a document.
Parameters:
  document - a String with the document where theposition should be looked up in
Parameters:
  characterIndex - the index of the character the resulting DocumentPosition instance; or

null if the characterIndex was invalid orif the document was null
since:
   1.0




getMatchingRegexp
public static Matcher getMatchingRegexp(String value, Collection<Pattern> regexps)(Code)
Matches a collection of regular expressions against a string.
Parameters:
  value - The String that will be checked.
Parameters:
  regexps - The collection of regular expressions against which thematch will be performed. The Matcher instance that corresponds to theString that returned a successful match; or

null if no match could be found.
since:
   1.0




getRegexpMatch
public static Matcher getRegexpMatch(Collection<String> values, Pattern regexp)(Code)
Matches a collection of strings against a regular expression.
Parameters:
  values - The Collection of Stringobjects that will be checked.
Parameters:
  regexp - The regular expression Pattern against whichthe matches will be performed. The Matcher instance that corresponds to theString that returned a successful match; or

null if no match could be found.
since:
   1.0




indicesOf
public static int[] indicesOf(String source, String substring)(Code)
Returns an array that contains all the occurances of a substring in a string in the correct order. The search will be performed in a case-sensitive manner.
Parameters:
  source - The String object that will be searched in.
Parameters:
  substring - The string whose occurances will we counted. An int[] array containing the indices of thesubstring.
since:
   1.0



indicesOf
public static int[] indicesOf(String source, String substring, boolean matchCase)(Code)
Returns an array that contains all the occurances of a substring in a string in the correct order.
Parameters:
  source - The String object that will be searched in.
Parameters:
  substring - The string whose occurances will we counted.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. An int[] array containing the indices of thesubstring.
since:
   1.0



join
public static String join(Collection collection, String seperator)(Code)
Creates a new String object, containing the elements of a supplied Collection of String objects joined by a given seperator.
Parameters:
  collection - The Collection containing the elementsto join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(Object[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The object array containing the elements to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(Object[] array, String seperator, String delimiter)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The object array containing the elements to join.
Parameters:
  seperator - The seperator used to join the string elements.
Parameters:
  delimiter - The delimiter used to surround the string elements. A new String with the join result.
since:
   1.0



join
public static String join(Object[] array, String seperator, String delimiter, boolean encodeStrings)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The object array containing the elements to join.
Parameters:
  seperator - The seperator used to join the string elements.
Parameters:
  delimiter - The delimiter used to surround the string elements.
Parameters:
  encodeStrings - Indicates whether the characters of the stringrepresentation of the Array values should be encoded. A new String with the join result.
since:
   1.0



join
public static String join(boolean[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The boolean array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(byte[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The byte array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(double[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The double array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(float[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The float array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(int[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The integer array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(long[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The long array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(short[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The short array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(char[] array, String seperator)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The char array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements. A new String with the join result.
since:
   1.0



join
public static String join(char[] array, String seperator, String delimiter)(Code)
Creates a new String object, containing the elements of a supplied array, joined by a given seperator.
Parameters:
  array - The char array containing the values to join.
Parameters:
  seperator - The seperator used to join the string elements.
Parameters:
  delimiter - The delimiter used to surround the string elements. A new String with the join result.
since:
   1.0



repeat
public static String repeat(String source, int count)(Code)
Creates a new string that contains the provided string a number of times.
Parameters:
  source - The string that will be repeated.
Parameters:
  count - The number of times that the string will be repeated. A new String object containing the repeatedconcatenation result.
since:
   1.0



replace
public static String replace(String source, String stringToReplace, String replacementString)(Code)
Searches for a string within a specified string in a case-sensitive manner and replaces every match with another string.
Parameters:
  source - The string in which the matching parts will be replaced.
Parameters:
  stringToReplace - The string that will be searched for.
Parameters:
  replacementString - The string that will replace each matchingpart. A new String object containing the replacementresult.
since:
   1.0



replace
public static String replace(String source, String stringToReplace, String replacementString, boolean matchCase)(Code)
Searches for a string within a specified string and replaces every match with another string.
Parameters:
  source - The string in which the matching parts will be replaced.
Parameters:
  stringToReplace - The string that will be searched for.
Parameters:
  replacementString - The string that will replace each matchingpart.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. A new String object containing the replacementresult.
since:
   1.0



split
public static ArrayList<String> split(String source, String seperator)(Code)
Splits a string into different parts, using a seperator string to detect the seperation boundaries in a case-sensitive manner. The seperator will not be included in the list of parts.
Parameters:
  source - The string that will be split into parts.
Parameters:
  seperator - The seperator string that will be used to determinethe parts. An ArrayList containing the parts asString objects.
since:
   1.0



split
public static ArrayList<String> split(String source, String seperator, boolean matchCase)(Code)
Splits a string into different parts, using a seperator string to detect the seperation boundaries. The seperator will not be included in the list of parts.
Parameters:
  source - The string that will be split into parts.
Parameters:
  seperator - The seperator string that will be used to determinethe parts.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. An ArrayList containing the parts asString objects.
since:
   1.0



splitToArray
public static String[] splitToArray(String source, String seperator)(Code)
Splits a string into different parts, using a seperator string to detect the seperation boundaries in a case-sensitive manner. The seperator will not be included in the parts array.
Parameters:
  source - The string that will be split into parts.
Parameters:
  seperator - The seperator string that will be used to determinethe parts. A String[] array containing the seperated parts.
since:
   1.0



splitToArray
public static String[] splitToArray(String source, String seperator, boolean matchCase)(Code)
Splits a string into different parts, using a seperator string to detect the seperation boundaries. The seperator will not be included in the parts array.
Parameters:
  source - The string that will be split into parts.
Parameters:
  seperator - The seperator string that will be used to determinethe parts.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. A String[] array containing the seperated parts.
since:
   1.0



splitToByteArray
public static byte[] splitToByteArray(String source, String seperator)(Code)
Splits a string into bytes, using a seperator string to detect the seperation boundaries in a case-sensitive manner. If a part couldn't be converted to a byte, it will be omitted from the resulting array.
Parameters:
  source - The string that will be split into bytes.
Parameters:
  seperator - The seperator string that will be used to determinethe parts. A byte[] array containing the bytes.
since:
   1.0



splitToByteArray
public static byte[] splitToByteArray(String source, String seperator, boolean matchCase)(Code)
Splits a string into bytes, using a seperator string to detect the seperation boundaries. If a part couldn't be converted to a byte, it will be omitted from the resulting array.
Parameters:
  source - The string that will be split into bytes.
Parameters:
  seperator - The seperator string that will be used to determinethe parts.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. A byte[] array containing the bytes.
since:
   1.0



splitToIntArray
public static int[] splitToIntArray(String source, String seperator)(Code)
Splits a string into integers, using a seperator string to detect the seperation boundaries in a case-sensitive manner. If a part couldn't be converted to an integer, it will be omitted from the resulting array.
Parameters:
  source - The string that will be split into integers.
Parameters:
  seperator - The seperator string that will be used to determinethe parts. An int[] array containing the seperated parts.
since:
   1.0



splitToIntArray
public static int[] splitToIntArray(String source, String seperator, boolean matchCase)(Code)
Splits a string into integers, using a seperator string to detect the seperation boundaries. If a part couldn't be converted to an integer, it will be omitted from the resulting array.
Parameters:
  source - The string that will be split into integers.
Parameters:
  seperator - The seperator string that will be used to determinethe parts.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. An int[] array containing the seperated parts.
since:
   1.0



stripFromEnd
public static String stripFromEnd(String source, String stringToStrip)(Code)
Removes all occurances of a string from the end of another string in a case-sensitive manner.
Parameters:
  source - The string in which the matching will be done.
Parameters:
  stringToStrip - The string that will be stripped from the end. A new String containing the stripped result.
since:
   1.0



stripFromEnd
public static String stripFromEnd(String source, String stringToStrip, boolean matchCase)(Code)
Removes all occurances of a string from the end of another string.
Parameters:
  source - The string in which the matching will be done.
Parameters:
  stringToStrip - The string that will be stripped from the end.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. A new String containing the stripped result.
since:
   1.0



stripFromFront
public static String stripFromFront(String source, String stringToStrip)(Code)
Removes all occurances of a string from the front of another string in a case-sensitive manner.
Parameters:
  source - The string in which the matching will be done.
Parameters:
  stringToStrip - The string that will be stripped from the front. A new String containing the stripped result.
since:
   1.0



stripFromFront
public static String stripFromFront(String source, String stringToStrip, boolean matchCase)(Code)
Removes all occurances of a string from the front of another string.
Parameters:
  source - The string in which the matching will be done.
Parameters:
  stringToStrip - The string that will be stripped from the front.
Parameters:
  matchCase - A boolean indicating if the match isgoing to be performed in a case-sensitive manner or not. A new String containing the stripping result.
since:
   1.0



toArrayList
public static ArrayList<String> toArrayList(String[] stringArray)(Code)
Creates a new ArrayList, containing the elements of a supplied array of String objects.
Parameters:
  stringArray - The array of String objects that haveto be converted. The new ArrayList with the elements of theString array.
since:
   1.0



toStringArray
public static String[] toStringArray(Iterator<String> iterator)(Code)
Creates a new array of String objects, containing the elements of a supplied Iterator.
Parameters:
  iterator - The iterator containing the elements to create thearray with. The new String array.
since:
   1.0



trim
public static String trim(String source)(Code)
Ensures that all whitespace is removed from a String.

It also works with a null argument.
Parameters:
  source - The String to trim. The trimmed String.
since:
   1.0




uncapitalize
public static String uncapitalize(String source)(Code)
Ensure that the first character of the provided string lower case.
Parameters:
  source - The String to uncapitalize. The uncapitalized String.
since:
   1.5



wordWrap
public static String wordWrap(String input, int width, Locale locale)(Code)
Reformats a string where lines that are longer than width are split apart at the earliest wordbreak or at maxLength, whichever is sooner. If the width specified is less than 5 or greater than the input Strings length the string will be returned as is.

Please note that this method can be lossy - trailing spaces on wrapped lines may be trimmed.
Parameters:
  input - the String to reformat.
Parameters:
  width - the maximum length of any one line. a new String with reformatted as needed.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.