Java Doc for StringUtil.java in  » Code-Analyzer » pmd-4.2rc1 » net » sourceforge » pmd » 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 » Code Analyzer » pmd 4.2rc1 » net.sourceforge.pmd.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.pmd.util.StringUtil

StringUtil
public class StringUtil (Code)


Field Summary
final public static  String[]EMPTY_STRINGS
    


Method Summary
public static  voidappendXmlEscaped(StringBuffer buf, String src)
     Appends to a StringBuffer the String src where non-ASCII and XML special chars are escaped.
public static  voidasStringOn(StringBuffer sb, Iterator iter, String separator)
     Copies the elements returned by the iterator onto the string buffer each delimited by the separator.
public static  StringhtmlEncode(String string)
    
public static  booleanisSame(String s1, String s2, boolean trim, boolean ignoreCase, boolean standardizeWhitespace)
     Are the two String values the same. The Strings can be optionally trimmed before checking. The Strings can be optionally compared ignoring case. The Strings can be have embedded whitespace standardized before comparing. Two null values are treated as equal.
Parameters:
  s1 - The first String.
Parameters:
  s2 - The second String.
Parameters:
  trim - Indicates if the Strings should be trimmed before comparison.
Parameters:
  ignoreCase - Indicates if the case of the Strings should ignored during comparison.
Parameters:
  standardizeWhitespace - Indicates if the embedded whitespace should be standardized before comparison.
public static  intlengthOfShortestIn(String[] strings)
     Return the length of the shortest string in the array.
public static  Stringlpad(String s, int length)
     Left pads a string.
public static  intmaxCommonLeadingWhitespaceForAll(String[] strings)
     Determine the maximum number of common leading whitespace characters the strings share in the same sequence.
public static  StringreplaceString(String original, char oldChar, String newString)
    
public static  StringreplaceString(String original, String oldString, String newString)
    
public static  String[]substringsOf(String source, char delimiter)
     Parses the input source using the delimiter specified.
public static  String[]substringsOf(String str, String separator)
     Much more efficient than StringTokenizer.
public static  String[]trimStartOn(String[] strings, int trimDepth)
     Trims off the leading characters off the strings up to the trimDepth specified.

Field Detail
EMPTY_STRINGS
final public static String[] EMPTY_STRINGS(Code)





Method Detail
appendXmlEscaped
public static void appendXmlEscaped(StringBuffer buf, String src)(Code)
Appends to a StringBuffer the String src where non-ASCII and XML special chars are escaped.
Parameters:
  buf - The destination XML stream
Parameters:
  src - The String to append to the stream



asStringOn
public static void asStringOn(StringBuffer sb, Iterator iter, String separator)(Code)
Copies the elements returned by the iterator onto the string buffer each delimited by the separator.
Parameters:
  sb - StringBuffer
Parameters:
  iter - Iterator
Parameters:
  separator - String



htmlEncode
public static String htmlEncode(String string)(Code)



isSame
public static boolean isSame(String s1, String s2, boolean trim, boolean ignoreCase, boolean standardizeWhitespace)(Code)
Are the two String values the same. The Strings can be optionally trimmed before checking. The Strings can be optionally compared ignoring case. The Strings can be have embedded whitespace standardized before comparing. Two null values are treated as equal.
Parameters:
  s1 - The first String.
Parameters:
  s2 - The second String.
Parameters:
  trim - Indicates if the Strings should be trimmed before comparison.
Parameters:
  ignoreCase - Indicates if the case of the Strings should ignored during comparison.
Parameters:
  standardizeWhitespace - Indicates if the embedded whitespace should be standardized before comparison. true if the Strings are the same, false otherwise.



lengthOfShortestIn
public static int lengthOfShortestIn(String[] strings)(Code)
Return the length of the shortest string in the array. If any one of them is null then it returns 0.
Parameters:
  strings - String[] int



lpad
public static String lpad(String s, int length)(Code)
Left pads a string.
Parameters:
  s - The String to pad
Parameters:
  length - The desired minimum length of the resulting padded String The resulting left padded String



maxCommonLeadingWhitespaceForAll
public static int maxCommonLeadingWhitespaceForAll(String[] strings)(Code)
Determine the maximum number of common leading whitespace characters the strings share in the same sequence. Useful for determining how many leading characters can be removed to shift all the text in the strings to the left without misaligning them.
Parameters:
  strings - String[] int



replaceString
public static String replaceString(String original, char oldChar, String newString)(Code)



replaceString
public static String replaceString(String original, String oldString, String newString)(Code)



substringsOf
public static String[] substringsOf(String source, char delimiter)(Code)
Parses the input source using the delimiter specified. This method is much faster than using the StringTokenizer or String.split(char) approach and serves as a replacement for String.split() for JDK1.3 that doesn't have it. FIXME - we're on JDK 1.4 now, can we replace this with String.split?
Parameters:
  source - String
Parameters:
  delimiter - char String[]



substringsOf
public static String[] substringsOf(String str, String separator)(Code)
Much more efficient than StringTokenizer.
Parameters:
  str - String
Parameters:
  separator - char String[]



trimStartOn
public static String[] trimStartOn(String[] strings, int trimDepth)(Code)
Trims off the leading characters off the strings up to the trimDepth specified. Returns the same strings if trimDepth = 0
Parameters:
  strings -
Parameters:
  trimDepth - String[]



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.