Java Doc for StringUtilsHelper.java in  » UML » AndroMDA-3.2 » org » andromda » utils » 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 » UML » AndroMDA 3.2 » org.andromda.utils 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.andromda.utils.StringUtilsHelper

StringUtilsHelper
public class StringUtilsHelper extends StringUtils (Code)
A utility object for doing string manipulation operations that are commonly needed by the code generation templates.
author:
   Matthias Bohlen
author:
   Chris Shaw
author:
   Chad Brandon
author:
   Wouter Zoons




Method Summary
public static  Stringformat(String plainText)
     Formats the argument string without any indentiation, the text will be wrapped at the default column.
public static  Stringformat(String plainText, String indentation)
     Formats the given argument with the specified indentiation, wrapping the text at a 64 column margin.
public static  Stringformat(String plainText, String indentation, int wrapAtColumn)
     Formats the given argument with the specified indentiation, wrapping the text at the desired column margin.
public static  Stringformat(String plainText, String indentation, int wrapAtColumn, boolean htmlStyle)
    

Formats the given argument with the specified indentation, wrapping the text at the desired column margin.

public static  StringgetLineSeparator()
     Gets the line separator.
public static  StringlowerCamelCaseName(String string)
    

Returns the argument string as a camel cased name beginning with a lowercased letter.

public static  Stringpluralize(String singularNoun)
     Linguistically pluralizes a singular noun.
public static  StringprefixWithAPredicate(String word)
     Takes an english word as input and prefixes it with 'a ' or 'an ' depending on the first character of the argument String.
public static  StringremoveLastOccurrence(String string, String value)
     Removes the last occurance of the oldValue found within the string.
Parameters:
  string - the String to remove the value from.
Parameters:
  value - the value to remove.
public static  StringreplaceSuffix(String src, String suffixOld, String suffixNew)
    

Replaces a given suffix of the source string with a new one.

public static  Stringseparate(String string, String separator)
     Converts the argument to lowercase, removes all non-word characters, and replaces each of those sequences by the separator.
public static  StringsuffixLines(String multiLines, String suffix)
     Suffixes each line with the argument suffix.
public static  StringtoPhrase(String string)
     Converts into a string suitable as a human readable phrase, First character is uppercase (the rest is left unchanged), words are separated by a space.
public static  StringtoResourceMessage(String multiLines)
     Converts any multi-line String into a version that is suitable to be included as-is in properties resource bundle.
public static  StringtoResourceMessageKey(String string)
     Converts the argument into a message key in a properties resource bundle, all lowercase characters, words are separated by dots.
public static  StringtoSingleLine(String string)
     Converts multiline text into a single line, normalizing whitespace in the process.
public static  StringupperCamelCaseName(String string)
    

Returns the argument string as a camel cased name beginning with an uppercased letter.




Method Detail
format
public static String format(String plainText)(Code)
Formats the argument string without any indentiation, the text will be wrapped at the default column.
See Also:   StringUtilsHelper.format(String,String)



format
public static String format(String plainText, String indentation)(Code)
Formats the given argument with the specified indentiation, wrapping the text at a 64 column margin.
See Also:   StringUtilsHelper.format(String,String,int)



format
public static String format(String plainText, String indentation, int wrapAtColumn)(Code)
Formats the given argument with the specified indentiation, wrapping the text at the desired column margin. The returned String will not be suited for display in HTML environments.
See Also:   StringUtilsHelper.format(String,String,int,boolean)



format
public static String format(String plainText, String indentation, int wrapAtColumn, boolean htmlStyle)(Code)

Formats the given argument with the specified indentation, wrapping the text at the desired column margin.

When enabling htmlStyle the returned text will be suitable for display in HTML environments such as JavaDoc, all newlines will be replaced by paragraphs.

This method trims the input text: all leading and trailing whitespace will be removed.

If for some reason this method would fail it will return the plainText argument.


Parameters:
  plainText - the text to format, the empty string will be returned incase this argument is null; long words will beplaced on a newline but will never be wrapped
Parameters:
  indentation - the empty string will be used if this argument wouldbe null
Parameters:
  wrapAtColumn - does not take into account the length of theindentation, needs to be stricly positive
Parameters:
  htmlStyle - whether or not to make sure the returned string issuited for display in HTML environments such as JavaDoc a String instance which represents the formatted input, nevernull
throws:
  IllegalArgumentException - when the wrapAtColumnargument is not strictly positive



getLineSeparator
public static String getLineSeparator()(Code)
Gets the line separator. the line separator.



lowerCamelCaseName
public static String lowerCamelCaseName(String string)(Code)

Returns the argument string as a camel cased name beginning with a lowercased letter.

Non word characters be removed and the letter following such a character will be uppercased.


Parameters:
  string - any string the string converted to a camel cased name beginning with a lowercased letter.



pluralize
public static String pluralize(String singularNoun)(Code)
Linguistically pluralizes a singular noun.

  • noun becomes nouns
  • key becomes keys
  • word becomes words
  • property becomes properties
  • bus becomes busses
  • boss becomes bosses

Whitespace as well as null arguments will return an empty String.


Parameters:
  singularNoun - A singular noun to pluralize The plural of the argument singularNoun or the empty String if the argument isnull or blank.



prefixWithAPredicate
public static String prefixWithAPredicate(String word)(Code)
Takes an english word as input and prefixes it with 'a ' or 'an ' depending on the first character of the argument String.

The characters 'a', 'e', 'i' and 'o' will yield the 'an' predicate while all the others will yield the 'a' predicate.


Parameters:
  word - the word needing the predicate the argument prefixed with the predicate



removeLastOccurrence
public static String removeLastOccurrence(String string, String value)(Code)
Removes the last occurance of the oldValue found within the string.
Parameters:
  string - the String to remove the value from.
Parameters:
  value - the value to remove. String the resulting string.



replaceSuffix
public static String replaceSuffix(String src, String suffixOld, String suffixNew)(Code)

Replaces a given suffix of the source string with a new one. If the suffix isn't present, the string is returned unmodified.


Parameters:
  src - the String for which the suffix should bereplaced
Parameters:
  suffixOld - a String with the suffix that should bereplaced
Parameters:
  suffixNew - a String with the new suffix a String with the given suffix replaced orunmodified if the suffix isn't present



separate
public static String separate(String string, String separator)(Code)
Converts the argument to lowercase, removes all non-word characters, and replaces each of those sequences by the separator.



suffixLines
public static String suffixLines(String multiLines, String suffix)(Code)
Suffixes each line with the argument suffix.
Parameters:
  multiLines - A String, optionally containing many lines
Parameters:
  suffix - The suffix to append to the end of each line String The input String with the suffix appended at the end ofeach line



toPhrase
public static String toPhrase(String string)(Code)
Converts into a string suitable as a human readable phrase, First character is uppercase (the rest is left unchanged), words are separated by a space.
Parameters:
  string - any string the string converted to a value that would be well-suited for ahuman readable phrase



toResourceMessage
public static String toResourceMessage(String multiLines)(Code)
Converts any multi-line String into a version that is suitable to be included as-is in properties resource bundle.
Parameters:
  multiLines - A String, optionally containing many lines String The input String with a backslash appended at the end ofeach line, or null if the input String was blank.



toResourceMessageKey
public static String toResourceMessageKey(String string)(Code)
Converts the argument into a message key in a properties resource bundle, all lowercase characters, words are separated by dots.
Parameters:
  string - any string the string converted to a value that would be well-suited for amessage key



toSingleLine
public static String toSingleLine(String string)(Code)
Converts multiline text into a single line, normalizing whitespace in the process. This means whitespace characters will not follow each other directly.

The resulting String will be trimmed.

If the input String is null the return value will be an empty string.


Parameters:
  string - A String, may be null The argument in a single line



upperCamelCaseName
public static String upperCamelCaseName(String string)(Code)

Returns the argument string as a camel cased name beginning with an uppercased letter.

Non word characters be removed and the letter following such a character will be uppercased.


Parameters:
  string - any string the string converted to a camel cased name beginning with a lowercased letter.



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