Java Doc for StringUtils.java in  » Template-Engine » Velocity » org » apache » velocity » util » 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 » Template Engine » Velocity » org.apache.velocity.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.velocity.util.StringUtils

StringUtils
public class StringUtils (Code)
This class provides some methods for dynamically invoking methods in objects, and some string manipulation methods used by torque. The string methods will soon be moved into the turbine string utilities class.
author:
   Jason van Zyl
author:
   Daniel Rall
version:
   $Id: StringUtils.java 463298 2006-10-12 16:10:32Z henning $




Method Summary
public  booleanallEmpty(List list)
     Check to see if all the string objects passed in are empty.
Parameters:
  list - A list of java.lang.String objects.
public static  StringcapitalizeFirstLetter(String data)
    

Capitalize the first letter but leave the rest as they are.

public static  Stringchop(String s, int i)
     Chop i characters off the end of a string. This method assumes that any EOL characters in String s and the platform EOL will be the same. A 2 character EOL will count as 1 character.
Parameters:
  s - String to chop.
Parameters:
  i - Number of characters to chop.
public static  Stringchop(String s, int i, String eol)
     Chop i characters off the end of a string. A 2 character EOL will count as 1 character.
Parameters:
  s - String to chop.
Parameters:
  i - Number of characters to chop.
Parameters:
  eol - A String representing the EOL (end of line).
public static  StringcollapseNewlines(String argStr)
     Remove/collapse multiple newline characters.
Parameters:
  argStr - string to collapse newlines in.
public static  StringcollapseSpaces(String argStr)
     Remove/collapse multiple spaces.
Parameters:
  argStr - string to remove multiple spaces from.
public  Stringconcat(List list)
     Concatenates a list of objects as a String.
Parameters:
  list - The list of objects to concatenate.
public static  StringfileContentsToString(String file)
     Read the contents of a file and place them in a string object.
Parameters:
  file - path to file.
public static  StringfirstLetterCaps(String data)
    

Makes the first letter caps and the rest lowercase.

public static  StringgetPackageAsPath(String pckge)
     Return a package name as a relative path name
Parameters:
  pckge - package name to convert to a directory.
final public static  StringnormalizePath(String path)
     Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out.
public static  StringnullTrim(String s)
     Trim the string, but pass a null through.
public static  StringremoveAndHump(String data)
    

'Camels Hump' replacement of underscores.

public static  StringremoveAndHump(String data, String replaceThis)
    

'Camels Hump' replacement.

public static  StringremoveUnderScores(String data)
    

Remove underscores from a string and replaces first letters with capitals.

public  Stringselect(boolean state, String trueString, String falseString)
     If state is true then return the trueString, else return the falseString.
public static  String[]split(String line, String delim)
    
final public static  StringstackTrace(Throwable e)
     Returns the output of printStackTrace as a String.
Parameters:
  e - A Throwable.
public static  StringBufferstringSubstitution(String argStr, Hashtable vars)
    
public static  StringBufferstringSubstitution(String argStr, Map vars)
     Perform a series of substitutions.
final public static  Stringsub(String line, String oldString, String newString)
     Replaces all instances of oldString with newString in line. Taken from the Jive forum package.
Parameters:
  line - original string.
Parameters:
  oldString - string in line to replace.
Parameters:
  newString - replace oldString with this.
public static  ListtrimStrings(List list)
     Trim all strings in a List.



Method Detail
allEmpty
public boolean allEmpty(List list)(Code)
Check to see if all the string objects passed in are empty.
Parameters:
  list - A list of java.lang.String objects. Whether all strings are empty.



capitalizeFirstLetter
public static String capitalizeFirstLetter(String data)(Code)

Capitalize the first letter but leave the rest as they are.

For example fooBar becomes FooBar.


Parameters:
  data - capitalize this String



chop
public static String chop(String s, int i)(Code)
Chop i characters off the end of a string. This method assumes that any EOL characters in String s and the platform EOL will be the same. A 2 character EOL will count as 1 character.
Parameters:
  s - String to chop.
Parameters:
  i - Number of characters to chop. String with processed answer.



chop
public static String chop(String s, int i, String eol)(Code)
Chop i characters off the end of a string. A 2 character EOL will count as 1 character.
Parameters:
  s - String to chop.
Parameters:
  i - Number of characters to chop.
Parameters:
  eol - A String representing the EOL (end of line). String with processed answer.



collapseNewlines
public static String collapseNewlines(String argStr)(Code)
Remove/collapse multiple newline characters.
Parameters:
  argStr - string to collapse newlines in. String



collapseSpaces
public static String collapseSpaces(String argStr)(Code)
Remove/collapse multiple spaces.
Parameters:
  argStr - string to remove multiple spaces from. String



concat
public String concat(List list)(Code)
Concatenates a list of objects as a String.
Parameters:
  list - The list of objects to concatenate. A text representation of the concatenated objects.



fileContentsToString
public static String fileContentsToString(String file)(Code)
Read the contents of a file and place them in a string object.
Parameters:
  file - path to file. String contents of the file.



firstLetterCaps
public static String firstLetterCaps(String data)(Code)

Makes the first letter caps and the rest lowercase.

For example fooBar becomes Foobar.


Parameters:
  data - capitalize this String



getPackageAsPath
public static String getPackageAsPath(String pckge)(Code)
Return a package name as a relative path name
Parameters:
  pckge - package name to convert to a directory. String directory path.



normalizePath
final public static String normalizePath(String path)(Code)
Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out. If the specified path attempts to go outside the boundaries of the current context (i.e. too many ".." path elements are present), return null instead.
Parameters:
  path - Path to be normalized String normalized path



nullTrim
public static String nullTrim(String s)(Code)
Trim the string, but pass a null through.
Parameters:
  s - List of trimmed Strings.



removeAndHump
public static String removeAndHump(String data)(Code)

'Camels Hump' replacement of underscores.

Remove underscores from a string but leave the capitalization of the other letters unchanged.

For example foo_barBar becomes FooBarBar.


Parameters:
  data - string to hump String



removeAndHump
public static String removeAndHump(String data, String replaceThis)(Code)

'Camels Hump' replacement.

Remove one string from another string but leave the capitalization of the other letters unchanged.

For example, removing "_" from foo_barBar becomes FooBarBar.


Parameters:
  data - string to hump
Parameters:
  replaceThis - string to be replaced String



removeUnderScores
public static String removeUnderScores(String data)(Code)

Remove underscores from a string and replaces first letters with capitals. Other letters are changed to lower case.

For example foo_bar becomes FooBar but foo_barBar becomes FooBarbar.


Parameters:
  data - string to remove underscores from. String



select
public String select(boolean state, String trueString, String falseString)(Code)
If state is true then return the trueString, else return the falseString.
Parameters:
  state -
Parameters:
  trueString -
Parameters:
  falseString - Selected result.



split
public static String[] split(String line, String delim)(Code)
Create a string array from a string separated by delim
Parameters:
  line - the line to split
Parameters:
  delim - the delimter to split by a string array of the split fields



stackTrace
final public static String stackTrace(Throwable e)(Code)
Returns the output of printStackTrace as a String.
Parameters:
  e - A Throwable. A String.



stringSubstitution
public static StringBuffer stringSubstitution(String argStr, Hashtable vars)(Code)

Parameters:
  argStr -
Parameters:
  vars - Substituted String.



stringSubstitution
public static StringBuffer stringSubstitution(String argStr, Map vars)(Code)
Perform a series of substitutions. The substitions are performed by replacing $variable in the target string with the value of provided by the key "variable" in the provided hashtable.
Parameters:
  argStr - target string
Parameters:
  vars - name/value pairs used for substitution String target string with replacements.



sub
final public static String sub(String line, String oldString, String newString)(Code)
Replaces all instances of oldString with newString in line. Taken from the Jive forum package.
Parameters:
  line - original string.
Parameters:
  oldString - string in line to replace.
Parameters:
  newString - replace oldString with this. String string with replacements.



trimStrings
public static List trimStrings(List list)(Code)
Trim all strings in a List. Changes the strings in the existing list.
Parameters:
  list - List of trimmed strings.



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.