org.codehaus.mojo.pomtools.console.toolkit
Class ConsoleUtils

java.lang.Object
  extended by org.codehaus.mojo.pomtools.console.toolkit.ConsoleUtils

public final class ConsoleUtils
extends java.lang.Object

wordWrap routine copied from http://svn.apache.org/repos/asf/jakarta/taglibs/proper/string/trunk/src/org/apache/taglibs/string/util/StringW.java

Version:
$Id: ConsoleUtils.java 2166 2006-07-18 21:32:16Z carlos $
Author:
David Hawkins

Field Summary
static int DEFAULT_WRAP_WIDTH
           
 
Method Summary
static java.lang.String wordWrap(java.lang.String str)
          Create a word-wrapped version of a String.
static java.lang.String wordWrap(java.lang.String str, int width)
          Create a word-wrapped version of a String.
static java.lang.String wordWrap(java.lang.String str, int width, java.lang.String delim, java.lang.String split)
          Word-wrap a string.
static java.lang.String wordWrap(java.lang.String str, int width, java.lang.String delim, java.lang.String split, boolean delimInside)
          Word-wrap a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WRAP_WIDTH

public static final int DEFAULT_WRAP_WIDTH
See Also:
Constant Field Values
Method Detail

wordWrap

public static java.lang.String wordWrap(java.lang.String str)
Create a word-wrapped version of a String. Wrap at 80 characters and use newlines as the delimiter. If a word is over 80 characters long use a - sign to split it.


wordWrap

public static java.lang.String wordWrap(java.lang.String str,
                                        int width)
Create a word-wrapped version of a String. Wrap at a specified width and use newlines as the delimiter. If a word is over the width in lenght use a - sign to split it.


wordWrap

public static java.lang.String wordWrap(java.lang.String str,
                                        int width,
                                        java.lang.String delim,
                                        java.lang.String split)
Word-wrap a string.

Parameters:
str - String to word-wrap
width - int to wrap at
delim - String to use to separate lines
split - String to use to split a word greater than width long
Returns:
String that has been word wrapped (with the delim inside width boundaries)

wordWrap

public static java.lang.String wordWrap(java.lang.String str,
                                        int width,
                                        java.lang.String delim,
                                        java.lang.String split,
                                        boolean delimInside)
Word-wrap a string.

Parameters:
str - String to word-wrap
width - int to wrap at
delim - String to use to separate lines
split - String to use to split a word greater than width long
delimInside - wheter or not delim should be included in chunk before length reaches width.
Returns:
String that has been word wrapped


Copyright © 2009 The Codehaus. All Rights Reserved.