org.jopendocument.util
Class StringUtils

java.lang.Object
  extended by org.jopendocument.util.StringUtils

public class StringUtils
extends Object

Author:
Sylvain CUAZ

Nested Class Summary
static class StringUtils.Escaper
           
static class StringUtils.Shortener
           
 
Field Summary
static Charset ASCII
           
static Charset Cp1252
           
static Charset Cp850
           
static Charset ISO8859_1
           
static Charset UTF16
           
static Charset UTF8
           
 
Constructor Summary
StringUtils()
           
 
Method Summary
static String doubleQuote(String s)
           
static List<String> fastSplit(String string, char sep)
           
static String firstUp(String s)
           
static String firstUpThenLow(String s)
          Retourne la chaine avec la première lettre en majuscule et le reste en minuscule.
static String getBoundedLengthString(String s, int maxLength)
          Return a string built from s that is at most maxLength long.
static int getLeastMaximum()
          The minimum value for getBoundedLengthString(String, int).
static String leftAlign(String s, int width)
           
static String rightAlign(String s, int width)
           
static String splitString(String s, int nbCharMaxLine)
          Split une string s tous les nbCharMaxLine
static String trim(String s, boolean leading)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF8

public static final Charset UTF8

UTF16

public static final Charset UTF16

ASCII

public static final Charset ASCII

ISO8859_1

public static final Charset ISO8859_1

Cp1252

public static final Charset Cp1252

Cp850

public static final Charset Cp850
Constructor Detail

StringUtils

public StringUtils()
Method Detail

firstUpThenLow

public static String firstUpThenLow(String s)
Retourne la chaine avec la première lettre en majuscule et le reste en minuscule.

Parameters:
s - la chaîne à transformer.
Returns:
la chaine avec la première lettre en majuscule et le reste en minuscule.

firstUp

public static String firstUp(String s)

getLeastMaximum

public static final int getLeastMaximum()
The minimum value for getBoundedLengthString(String, int).

Returns:
the minimum value for maxLength.

getBoundedLengthString

public static final String getBoundedLengthString(String s,
                                                  int maxLength)
                                           throws IllegalArgumentException
Return a string built from s that is at most maxLength long.

Parameters:
s - the string to bound.
maxLength - the maximum length the result must have.
Returns:
a string built from s.
Throws:
IllegalArgumentException - if maxLength is too small.
See Also:
getLeastMaximum(), StringUtils.Shortener.getBoundedLengthString(String, int)

fastSplit

public static final List<String> fastSplit(String string,
                                           char sep)

splitString

public static String splitString(String s,
                                 int nbCharMaxLine)
Split une string s tous les nbCharMaxLine

Parameters:
s -
nbCharMaxLine -
Returns:

doubleQuote

public static String doubleQuote(String s)

rightAlign

public static String rightAlign(String s,
                                int width)

leftAlign

public static String leftAlign(String s,
                               int width)

trim

public static String trim(String s,
                          boolean leading)


Copyright © 2010 jOpenDocument All Rights Reserved.