DJDoc v.1.0.0b-1

net.sf.djdoc.util
Class StringUtils

java.lang.Object
  extended by net.sf.djdoc.util.StringUtils

public class StringUtils
extends java.lang.Object

The StringUtils class is a utility class with various String manipulation methods.


Method Summary
static java.lang.String evaluate(java.lang.String str)
          This method manipulates a String by replacing occurrences of placeholders (in the form ${placeholder-name}) by values specified as System properties.
static java.lang.String evaluate(java.lang.String str, java.util.Properties props)
          This method manipulates a String by replacing occurrences of placeholders (in the form ${placeholder-name}) by specified values.
static java.lang.String glue(java.lang.String[] arr, java.lang.String delim, int start, int end, boolean startWithDelim, boolean endWithDelim)
          This method creates a result String by concatenating a subarray of a String array, optionally separated by a delimiting String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

evaluate

public static java.lang.String evaluate(java.lang.String str,
                                        java.util.Properties props)
This method manipulates a String by replacing occurrences of placeholders (in the form ${placeholder-name}) by specified values. If a placeholder key has no specified value, it is not replaced by this method.

Parameters:
str - The source String to be manipulated
props - The key/value pairs with the keys equal to the placeholder names
Returns:
A String in which the occurrences of the placeholders in the source String have been replaced with the values specified by the property set

evaluate

public static java.lang.String evaluate(java.lang.String str)
This method manipulates a String by replacing occurrences of placeholders (in the form ${placeholder-name}) by values specified as System properties. If a placeholder key has no corresponding System property, its occurrences are not replaced by this method.

Parameters:
str - The source String to be manipulated
Returns:
A String in which the occurrences of the placeholders in the source String have been replaced with the values specified by the System properties

glue

public static java.lang.String glue(java.lang.String[] arr,
                                    java.lang.String delim,
                                    int start,
                                    int end,
                                    boolean startWithDelim,
                                    boolean endWithDelim)
This method creates a result String by concatenating a subarray of a String array, optionally separated by a delimiting String.

Parameters:
arr - The source String array
delim - The delimiter String
start - The starting index for the concatenation (inclusive)
end - The ending index for the concatenation (exclusive)
startWithDelim - Specifies whether or not the result String should begin with the delimiting String
endWithDelim - Specifies whether or not the result String should end with the delimiting String
Returns:
A String resulting from the concatenation of the specified array members, separated by the delimiting String

DJDoc v.1.0.0b-1