You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ba...@apache.org on 2003/07/08 07:59:59 UTC
cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang RandomStringUtils.java StringEscapeUtils.java StringPrintWriter.java StringUtils.java SystemUtils.java WordWrapUtils.java
bayard 2003/07/07 22:59:59
Modified: lang/src/java/org/apache/commons/lang RandomStringUtils.java
StringEscapeUtils.java StringPrintWriter.java
StringUtils.java SystemUtils.java
WordWrapUtils.java
Log:
Great set of javadoc improvements from Fredrik.
Also an optimisation to StringUtils.leftPad/rightPad.
Submitted by: Fredrik Westermarck
Revision Changes Path
1.14 +3 -3 jakarta-commons/lang/src/java/org/apache/commons/lang/RandomStringUtils.java
Index: RandomStringUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/RandomStringUtils.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- RandomStringUtils.java 9 Jun 2003 21:36:02 -0000 1.13
+++ RandomStringUtils.java 8 Jul 2003 05:59:58 -0000 1.14
@@ -198,10 +198,10 @@
* <p>Creates a random string based on a variety of options, using
* default source of randomness.</p>
*
- * This method has exactly the same semantics as {@link
+ * <p>This method has exactly the same semantics as {@link
* #random(int,int,int,boolean,boolean,char[],Random)}, but
* instead of using an externally supplied source of randomness, it uses
- * the internal static {@link Random} instance ({@link #RANDOM}).
+ * the internal static {@link Random} instance ({@link #RANDOM}).</p>
*
* @param count length of random string to create
* @param start position in set of chars to start at
1.16 +58 -39 jakarta-commons/lang/src/java/org/apache/commons/lang/StringEscapeUtils.java
Index: StringEscapeUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringEscapeUtils.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- StringEscapeUtils.java 5 Jul 2003 23:37:30 -0000 1.15
+++ StringEscapeUtils.java 8 Jul 2003 05:59:58 -0000 1.16
@@ -55,8 +55,6 @@
import java.io.IOException;
import java.io.Writer;
-import java.io.PrintWriter;
-
import org.apache.commons.lang.exception.NestableRuntimeException;
/**
@@ -86,9 +84,10 @@
/**
* <p><code>StringEscapeUtils</code> instances should NOT be constructed in
- * standard programming.</p>
- * <p>Instead, the class should be used as:</p>
- * <pre>StringEscapeUtils.escapeJava("foo");</pre>
+ * standard programming.</p>
+ *
+ * <p>Instead, the class should be used as:
+ * <pre>StringEscapeUtils.escapeJava("foo");</pre></p>
*
* <p>This constructor is public to permit tools that require a JavaBean
* instance to operate.</p>
@@ -100,6 +99,7 @@
//--------------------------------------------------------------------------
/**
* <p>Escapes the characters in a <code>String</code> using Java String rules.</p>
+ *
* <p>Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) </p>
*
* <p>So a tab becomes the characters <code>'\\'</code> and
@@ -124,7 +124,8 @@
}
/**
- * <p>Escapes the characters in a <code>String</code> using Java String rules to a <code>Writer</code>.</p>
+ * <p>Escapes the characters in a <code>String</code> using Java String rules to
+ * a <code>Writer</code>.</p>
*
* @see #escapeJava(java.lang.String)
* @param out Writer to write escaped string into
@@ -163,7 +164,8 @@
}
/**
- * <p>Escapes the characters in a <code>String</code> using JavaScript String rules to a <code>Writer</code>.</p>
+ * <p>Escapes the characters in a <code>String</code> using JavaScript String rules
+ * to a <code>Writer</code>.</p>
*
* @see #escapeJavaScript(java.lang.String)
* @param out Writer to write escaped string into
@@ -253,7 +255,8 @@
}
/**
- * Returns an upper case hexadecimal <code>String</code> for the given character.
+ * <p>Returns an upper case hexadecimal <code>String</code> for the given
+ * character.</p>
*
* @param ch The character to convert.
* @return An upper case hexadecimal <code>String</code>
@@ -263,9 +266,10 @@
}
/**
- * Unescapes any Java literals found in the <code>String</code>.
- * For example, it will turn a sequence of '\' and 'n' into a newline character,
- * unless the '\' is preceded by another '\'.
+ * <p>Unescapes any Java literals found in the <code>String</code>.
+ * For example, it will turn a sequence of <code>'\'</code> and
+ * <code>'n'</code> into a newline character, unless the <code>'\'</code>
+ * is preceded by another <code>'\'</code>.</p>
*
* @param str The <code>String</code> to unescape.
* @return A new unescaped <code>String</code>.
@@ -283,9 +287,12 @@
}
/**
- * Unescapes any Java literals found in the <code>String</code> to a <code>Writer</code>.
- * For example, it will turn a sequence of '\' and 'n' into a newline character,
- * unless the '\' is preceded by another '\'.
+ * <p>Unescapes any Java literals found in the <code>String</code> to a
+ * <code>Writer</code>.</p>
+ *
+ * <p>For example, it will turn a sequence of <code>'\'</code> and
+ * <code>'n'</code> into a newline character, unless the <code>'\'</code>
+ * is preceded by another <code>'\'</code>.</p>
*
* @param out The <code>Writer</code> used to output unescaped characters.
* @param str The <code>String</code> to unescape.
@@ -369,9 +376,11 @@
}
/**
- * Unescapes any JavaScript literals found in the <code>String</code>.
- * For example, it will turn a sequence of '\' and 'n' into a newline character,
- * unless the '\' is preceded by another '\'.
+ * <p>Unescapes any JavaScript literals found in the <code>String</code>.</p>
+ *
+ * <p>For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code>
+ * into a newline character, unless the <code>'\'</code> is preceded by another
+ * <code>'\'</code>.</p>
*
* @param str The <code>String</code> to unescape.
* @return A new unescaped <code>String</code>.
@@ -382,9 +391,12 @@
}
/**
- * Unescapes any JavaScript literals found in the <code>String</code> to a <code>Writer</code>.
- * For example, it will turn a sequence of '\' and 'n' into a newline character,
- * unless the '\' is preceded by another '\'.
+ * <p>Unescapes any JavaScript literals found in the <code>String</code> to a
+ * <code>Writer</code>.</p>
+ *
+ * <p>For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code>
+ * into a newline character, unless the <code>'\'</code> is preceded by another
+ * <code>'\'</code>.</p>
*
* @param out The <code>Writer</code> used to output unescaped characters.
* @param str The <code>String</code> to unescape.
@@ -400,11 +412,12 @@
/**
* <p>Escapes the characters in a <code>String</code> using HTML entities.</p>
+ *
* <p>
* For example: <tt>"bread" & "butter"</tt> => <tt>&quot;bread&quot; &amp; &quot;butter&quot;</tt>.
* </p>
- * <p>Supports all known HTML 4.0 entities, including funky accents.
- * </p>
+ *
+ * <p>Supports all known HTML 4.0 entities, including funky accents.</p>
*
* @param str The <code>String</code> to escape
* @return A new escaped <code>String</code>.
@@ -427,8 +440,10 @@
* <p>Unescapes a string containing entity escapes to a string
* containing the actual Unicode characters corresponding to the
* escapes. Supports HTML 4.0 entities.</p>
+ *
* <p>For example, the string "&lt;Fran&ccedil;ais&gt;"
* will become "<Français>"</p>
+ *
* <p>If an entity is unrecognized, it is left alone, and inserted
* verbatim into the result string. e.g. "&gt;&zzzz;x" will
* become ">&zzzz;x".</p>
@@ -443,14 +458,14 @@
/**
* <p>Escapes the characters in a <code>String</code> using XML entities.</p>
- * <p>
- * For example: <tt>"bread" & "butter"</tt> =>
+ *
+ * <p>For example: <tt>"bread" & "butter"</tt> =>
* <tt>&quot;bread&quot; &amp; &quot;butter&quot;</tt>.
* </p>
- * <p>
- * Supports only the four basic XML entities (gt, lt, quot, amp).
- * Does not support DTDs or external entities.
- * </p>
+ *
+ * <p>Supports only the four basic XML entities (gt, lt, quot, amp).
+ * Does not support DTDs or external entities.</p>
+ *
* @param str The <code>String</code> to escape
* @return A new escaped <code>String</code>.
* @see #unescapeXml(java.lang.String)
@@ -462,12 +477,10 @@
/**
* <p>Unescapes a string containing XML entity escapes to a string
* containing the actual Unicode characters corresponding to the
- * escapes.
- * </p>
- * <p>
- * Supports only the four basic XML entities (gt, lt, quot, amp).
- * Does not support DTDs or external entities.
- * </p>
+ * escapes.</p>
+ *
+ * <p>Supports only the four basic XML entities (gt, lt, quot, amp).
+ * Does not support DTDs or external entities.</p>
*
* @param str The <code>String</code> to unescape
* @return A new unescaped <code>String</code>.
@@ -478,13 +491,19 @@
}
/**
- * Escapes the characters in a <code>String</code> to be suitable to pass to
- * an SQL query. For example,
+ * <p>Escapes the characters in a <code>String</code> to be suitable to pass to
+ * an SQL query.</p>
+ *
+ * <p>For example,
* <pre>statement.executeQuery("SELECT * FROM MOVIES WHERE TITLE='" +
* StringEscapeUtils.escapeSql("McHale's Navy") +
* "'");</pre>
- * At present, this method only turns single-quotes into doubled single-quotes (<code>"McHale's Navy"</code> => <code>"McHale''s Navy"</code>).
- * It does not handle the cases of percent (%) or underscore (_) for use in LIKE clauses.
+ * </p>
+ *
+ * <p>At present, this method only turns single-quotes into doubled single-quotes
+ * (<code>"McHale's Navy"</code> => <code>"McHale''s Navy"</code>). It does not
+ * handle the cases of percent (%) or underscore (_) for use in LIKE clauses.</p>
+ *
* see http://www.jguru.com/faq/view.jsp?EID=8881
* @param s the string to escape
* @return A new String, escaped for SQL
1.2 +9 -4 jakarta-commons/lang/src/java/org/apache/commons/lang/StringPrintWriter.java
Index: StringPrintWriter.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringPrintWriter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StringPrintWriter.java 31 Mar 2003 03:53:52 -0000 1.1
+++ StringPrintWriter.java 8 Jul 2003 05:59:58 -0000 1.2
@@ -56,12 +56,16 @@
import java.io.*;
/**
- * A PrintWriter that maintains a String as its backing store.
- * Usage: <pre>
+ * <p>A PrintWriter that maintains a String as its backing store.</p>
+ *
+ * <p>Usage:
+ * <pre>
* StringPrintWriter out = new StringPrintWriter();
* printTo(out);
* System.out.println( out.getString() );
* </pre>
+ * </p>
+ *
* @author Alex Chaffee
* @author Scott Stanchfield
**/
@@ -75,9 +79,10 @@
}
/**
- * Since toString() returns information *about* this object, we
+ * <p>Since toString() returns information *about* this object, we
* want a separate method to extract just the contents of the
- * internal buffer as a String.
+ * internal buffer as a String.</p>
+ *
* @return the contents of the internal string buffer
*/
public String getString() {
1.52 +69 -51 jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java
Index: StringUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringUtils.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- StringUtils.java 24 Jun 2003 21:14:50 -0000 1.51
+++ StringUtils.java 8 Jul 2003 05:59:58 -0000 1.52
@@ -98,7 +98,7 @@
/**
* <p>An array of <code>String</code>s used for padding.</p>
*
- * <p>Used for efficient blank padding. The length of each string expands as needed.</p>
+ * <p>Used for efficient blank padding. The length of each string expands as needed.</p>
*/
private final static String[] padding = new String[Character.MAX_VALUE];
// String.concat about twice as fast as StringBuffer.append
@@ -845,11 +845,12 @@
/**
* <p>Remove one newline from end of a String if it's there,
- * otherwise leave it alone. A newline is "\n", "\r", or "\r\n".
- * <p>
- * Note that this behavior has changed from 1.0. It
+ * otherwise leave it alone. A newline is "<code>\n</code>",
+ * "<code>\r</code>", or "<code>\r\n</code>".</p>
+ *
+ * <p>Note that this behavior has changed from 1.0. It
* now more closely matches Perl chomp. For the previous behavior,
- * use slice(String).
+ * use {@link #slice(String)}.</p>
*
* @param str String to chomp a newline from
* @return String without newline
@@ -885,13 +886,12 @@
}
/**
- * <p>Remove one string (the separator) from the end of another
- * string if it's there, otherwise leave it alone.
- * <p>
+ * <p>Remove <code>separator</code> from the end of
+ * <code>str</code> if it's there, otherwise leave it alone.</p>
*
- * Note that this behavior has changed from 1.0. It
+ * <p>Note that this behavior has changed from 1.0. It
* now more closely matches Perl chomp. For the previous behavior,
- * use {@link #slice(String,String)}.
+ * use {@link #slice(String,String)}.</p>
*
* @param str string to chomp from
* @param separator separator string
@@ -909,7 +909,7 @@
}
/**
- * <p>Remove a newline if and only if it is at the end
+ * <p>Remove any "\n" if and only if it is at the end
* of the supplied String.</p>
*
* @param str String to chomp from
@@ -1070,7 +1070,8 @@
/**
* <p>Remove the last newline, and everything after it from a String.</p>
- * (This method was formerly named chomp or chopNewline.)
+ *
+ * <p><em>(This method was formerly named chomp or chopNewline.)</em></p>
*
* @param str String to slice the newline from
* @return String without sliced newline
@@ -1083,7 +1084,8 @@
/**
* <p>Find the last occurence of a separator String;
* remove it and everything after it.</p>
- * (This method was formerly named chomp.)
+ *
+ * <p><em>(This method was formerly named chomp.)</em></p>
*
* @param str String to slice from
* @param sep String to slice
@@ -1102,8 +1104,9 @@
/**
* <p>Find the last occurence of a separator String, and return
* everything after it.</p>
- * (This method was formerly named getchomp. Also, now it does not
- * include the separator in the return value.)
+ *
+ * <p><em>(This method was formerly named getchomp. Also, now it does not
+ * include the separator in the return value.)</em></p>
*
* @param str String to slice from
* @param sep String to slice
@@ -1124,8 +1127,9 @@
/**
* <p>Find the first occurence of a separator String, and return
* everything after it.</p>
- * (This method was formerly named prechomp. Also, previously
- * it included the separator in the return value; now it does not.)
+ *
+ * <p><em>(This method was formerly named prechomp. Also, previously
+ * it included the separator in the return value; now it does not.)</em></p>
*
* @param str String to slice from
* @param sep String to slice
@@ -1144,8 +1148,9 @@
/**
* <p>Find the first occurence of a separator string;
* return everything before it (but not including the separator).</p>
- * (This method was formerly named getPrechomp. Also, it used to
- * include the separator, but now it does not.)
+ *
+ * <p><em>(This method was formerly named getPrechomp. Also, it used to
+ * include the separator, but now it does not.)</em></p>
*
* @param str String to slice from
* @param sep String to slice
@@ -1185,13 +1190,14 @@
}
/**
- * Unescapes any Java literals found in the String. For example,
- * it will turn a sequence of '\' and 'n' into a newline character,
- * unless the '\' is preceded by another '\'.
- * <p>
- * As of Lang 2.0, this calls {@link StringEscapeUtils#unescapeJava(java.lang.String)}
- * behind the scenes.
- * <p>
+ * <p>Unescapes any Java literals found in the String. For example,
+ * it will turn a sequence of <code>'\'</code> and <code>'n'</code>
+ * into a newline character, unless the <code>'\'</code> is preceded
+ * by another <code>'\'</code>.</p>
+ *
+ * <p>As of Lang 2.0, this calls {@link StringEscapeUtils#unescapeJava(java.lang.String)}
+ * behind the scenes.</p>
+ *
* @see StringEscapeUtils#unescapeJava(java.lang.String)
* @deprecated Use {@link StringEscapeUtils#unescapeJava(java.lang.String)}
* This method will be removed in Commons Lang 3.0
@@ -1240,8 +1246,8 @@
}
/**
- * <p>Returns padding using the specified delimiter repeated to a given length.
- * </p>
+ * <p>Returns padding using the specified delimiter repeated
+ * to a given length.</p>
*
* @param repeat number of times to repeat delim
* @param delim character to repeat
@@ -1276,7 +1282,7 @@
return str; // returns original string when possible
}
if (pads > PAD_LIMIT) {
- return rightPad(str, size, " ");
+ return rightPad(str, size, ' ');
}
return str + padding(pads);
}
@@ -1343,13 +1349,15 @@
return str; // returns original string when possible
}
if (pads > PAD_LIMIT) {
- return leftPad(str, size, " ");
+ return leftPad(str, size, ' ');
}
return padding(pads).concat(str);
}
/**
- * Left pad a String with a specified character. Pad to a size of n.
+ * <p>Left pad a String with a specified character.</p>
+ *
+ * <p>Pad to a size of <code>n</code>.</p>
*
* @param str String to pad out
* @param size size to pad to
@@ -1363,13 +1371,15 @@
return str; // returns original string when possible
}
if (pads > PAD_LIMIT) {
- return leftPad(str, size, " ");
+ return leftPad(str, size, ' ');
}
return padding(pads, delim).concat(str);
}
/**
- * Left pad a String with a specified string. Pad to a size of n.
+ * <p>Left pad a String with a specified string.</p>
+ *
+ * <p>Pad to a size of <code>n</code>.</p>
*
* @param str String to pad out
* @param size size to pad to
@@ -2145,14 +2155,19 @@
//--------------------------------------------------------------------------
/**
- * Turn "Now is the time for all good men" into "Now is the time for..."
- * <p>
- * Specifically:
- * <p>
- * If str is less than max characters long, return it.
- * Else abbreviate it to (substring(str, 0, max-3) + "...").
- * If maxWidth is less than 3, throw an IllegalArgumentException.
- * In no case will it return a string of length greater than maxWidth.
+ * <p>Turn "Now is the time for all good men" into "Now is the time for..."</p>
+ *
+ * <p>Specifically:
+ * <ul>
+ * <li>If <code>str</code> is less than <code>maxWidth</code> characters
+ * long, return it.</li>
+ * <li>Else abbreviate it to <code>(substring(str, 0, max-3) + "...")</code>.</li>
+ * <li>If <code>maxWidth</code> is less than </code>3, throw an
+ * <code>IllegalArgumentException</code>.</li>
+ * <li>In no case will it return a string of length greater than
+ * <code>maxWidth</code>.</li>
+ * </ul>
+ * </p>
*
* @param maxWidth maximum length of result string
*/
@@ -2161,13 +2176,15 @@
}
/**
- * Turn "Now is the time for all good men" into "...is the time for..."
- * <p>
- * Works like abbreviate(String, int), but allows you to specify a "left edge"
- * offset. Note that this left edge is not necessarily going to be the leftmost
- * character in the result, or the first
- * character following the ellipses, but it will appear somewhere in the result.
- * In no case will it return a string of length greater than maxWidth.
+ * <p>Turn "Now is the time for all good men" into "...is the time for..."</p>
+ *
+ * <p>Works like <code>abbreviate(String, int)</code>, but allows you to specify
+ * a "left edge" offset. Note that this left edge is not necessarily going to
+ * be the leftmost character in the result, or the first character following the
+ * ellipses, but it will appear somewhere in the result.
+ *
+ * <p>In no case will it return a string of length greater than
+ * <code>maxWidth</code>.</p>
*
* @param offset left edge of source string
* @param maxWidth maximum length of result string
@@ -2194,9 +2211,10 @@
//--------------------------------------------------------------------------
/**
- * Compare two strings, and return the portion where they differ.
+ * <p>Compare two strings, and return the portion where they differ.
* (More precisely, return the remainder of the second string,
- * starting from where it's different from the first.)
+ * starting from where it's different from the first.)</p>
+ *
* <p>
* For example, <code>difference("i am a machine", "i am a robot") -> "robot"</code>
*
1.17 +224 -212 jakarta-commons/lang/src/java/org/apache/commons/lang/SystemUtils.java
Index: SystemUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/SystemUtils.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- SystemUtils.java 8 Jun 2003 14:10:54 -0000 1.16
+++ SystemUtils.java 8 Jul 2003 05:59:58 -0000 1.17
@@ -73,7 +73,7 @@
//-----------------------------------------------------------------------
/**
- * The <code>file.encoding</code> System Property.
+ * <p>The <code>file.encoding</code> System Property.</p>
* <p>File encoding, such as <code>Cp1252</code>.</p>
*
* <p>Defaults to <code>null</code> if the runtime does not have
@@ -84,10 +84,10 @@
public static final String FILE_ENCODING = getSystemProperty("file.encoding");
/**
- * The <code>file.separator</code> System Property.
- * File separator ("/" on UNIX).
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>file.separator</code> System Property.
+ * File separator (<code>"/"</code> on UNIX).</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java version 1.1.
@@ -96,101 +96,115 @@
//-----------------------------------------------------------------------
/**
- * Is <code>true</code> if this is Java version 1.1 (also 1.1.x versions).
- * <p>
- * The field will return false if {@link #JAVA_VERSION} is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Java version 1.1 (also 1.1.x versions).</p>
+ *
+ * <p>The field will return <code>false</code> if {@link #JAVA_VERSION} is
+ * <code>null</code>.</p>
*/
public static final boolean IS_JAVA_1_1 = getJavaVersionMatches("1.1");
/**
- * Is <code>true</code> if this is Java version 1.2 (also 1.2.x versions).
- * <p>
- * The field will return false if {@link #JAVA_VERSION} is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Java version 1.2 (also 1.2.x versions).</p>
+ *
+ * <p>The field will return <code>false</code> if {@link #JAVA_VERSION} is
+ * <code>null</code>.</p>
*/
public static final boolean IS_JAVA_1_2 = getJavaVersionMatches("1.2");
/**
- * Is <code>true</code> if this is Java version 1.3 (also 1.3.x versions).
- * <p>
- * The field will return false if {@link #JAVA_VERSION} is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Java version 1.3 (also 1.3.x versions).</p>
+ *
+ * <p>The field will return <code>false</code> if {@link #JAVA_VERSION} is
+ * <code>null</code>.</p>
*/
public static final boolean IS_JAVA_1_3 = getJavaVersionMatches("1.3");
/**
- * Is <code>true</code> if this is Java version 1.4 (also 1.4.x versions).
- * <p>
- * The field will return false if {@link #JAVA_VERSION} is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Java version 1.4 (also 1.4.x versions).</p>
+ *
+ * <p>The field will <code>false</code> false if {@link #JAVA_VERSION} is
+ * <code>null</code>.</p>
*/
public static final boolean IS_JAVA_1_4 = getJavaVersionMatches("1.4");
/**
- * Is <code>true</code> if this is Java version 1.5 (also 1.5.x versions).
- * <p>
- * The field will return false if {@link #JAVA_VERSION} is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Java version 1.5 (also 1.5.x versions).</p>
+ *
+ * <p>The field will return <code>false</code> if {@link #JAVA_VERSION} is
+ * <code>null</code>.</p>
*/
public static final boolean IS_JAVA_1_5 = getJavaVersionMatches("1.5");
/**
- * Is <code>true</code> if this is AIX.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is AIX.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_AIX = getOSMatches("AIX");
/**
- * Is <code>true</code> if this is HP-UX.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is HP-UX.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_HP_UX = getOSMatches("HP-UX");
/**
- * Is <code>true</code> if this is Irix.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Irix.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_IRIX = getOSMatches("Irix");
/**
- * Is <code>true</code> if this is Linux.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Linux.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_LINUX = getOSMatches("Linux") || getOSMatches("LINUX");
// Windows XP returns 'Windows 2000' just for fun...
/**
- * Is <code>true</code> if this is Mac.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Mac.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_MAC = getOSMatches("Mac");
/**
- * Is <code>true</code> if this is Mac.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Mac.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_MAC_OSX = getOSMatches("Mac OS X");
/**
- * Is <code>true</code> if this is Mac.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Mac.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_OS2 = getOSMatches("OS/2");
/**
- * Is <code>true</code> if this is Solaris.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Solaris.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_SOLARIS = getOSMatches("Solaris");
/**
- * Is <code>true</code> if this is SunOS.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is SunOS.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_SUN_OS = getOSMatches("SunOS");
@@ -200,63 +214,69 @@
// if you want another added or a mistake corrected
/**
- * Is <code>true</code> if this is Windows.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Windows.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_WINDOWS = getOSMatches("Windows");
/**
- * Is <code>true</code> if this is Windows 2000.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Windows 2000.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_WINDOWS_2000 = getOSMatches("Windows", "5.0");
/**
- * Is <code>true</code> if this is Windows 95.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Windows 95.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_WINDOWS_95 = getOSMatches("Windows 9", "4.0");
// JDK 1.2 running on Windows98 returns 'Windows 95', hence the above
/**
- * Is <code>true</code> if this is Windows 98.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Windows 98.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_WINDOWS_98 = getOSMatches("Windows 9", "4.1");
// JDK 1.2 running on Windows98 returns 'Windows 95', hence the above
/**
- * Is <code>true</code> if this is Windows ME.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Windows ME.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_WINDOWS_ME = getOSMatches("Windows", "4.9");
// JDK 1.2 running on WindowsME may return 'Windows 95', hence the above
/**
- * Is <code>true</code> if this is Windows NT.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Windows NT.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_WINDOWS_NT = getOSMatches("Windows NT");
// Windows 2000 returns 'Windows 2000' but may suffer from same JDK1.2 problem
/**
- * Is <code>true</code> if this is Windows XP.
- * <p>
- * The field will return false if <code>OS_NAME</code> is <code>null</code>.</p>
+ * <p>Is <code>true</code> if this is Windows XP.</p>
+ *
+ * <p>The field will return <code>false</code> if <code>OS_NAME</code> is
+ * <code>null</code>.</p>
*/
public static final boolean IS_OS_WINDOWS_XP = getOSMatches("Windows", "5.1");
/**
- * The <code>java.class.path</code> System Property.
- * Java class path.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.class.path</code> System Property. Java class path.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java version 1.1.
@@ -264,10 +284,10 @@
public static final String JAVA_CLASS_PATH = getSystemProperty("java.class.path");
/**
- * The <code>java.class.version</code> System Property.
- * Java class format version number.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.class.version</code> System Property.
+ * Java class format version number.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java version 1.1.
@@ -275,11 +295,10 @@
public static final String JAVA_CLASS_VERSION = getSystemProperty("java.class.version");
/**
- * The <code>java.compiler</code> System Property.
- * Name of JIT compiler to use.
- * First in JDK version 1.2. Not used in Sun JDKs after 1.2.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.compiler</code> System Property. Name of JIT compiler to use.
+ * First in JDK version 1.2. Not used in Sun JDKs after 1.2.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java version 1.2. Not used in Sun versions after 1.2.
@@ -287,10 +306,10 @@
public static final String JAVA_COMPILER = getSystemProperty("java.compiler");
/**
- * The <code>java.ext.dirs</code> System Property.
- * Path of extension directory or directories.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.ext.dirs</code> System Property. Path of extension directory
+ * or directories.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.3
@@ -298,10 +317,9 @@
public static final String JAVA_EXT_DIRS = getSystemProperty("java.ext.dirs");
/**
- * The <code>java.home</code> System Property.
- * Java installation directory.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.home</code> System Property. Java installation directory.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -309,10 +327,9 @@
public static final String JAVA_HOME = getSystemProperty("java.home");
/**
- * The <code>java.io.tmpdir</code> System Property.
- * Default temp file path.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.io.tmpdir</code> System Property. Default temp file path.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -320,10 +337,10 @@
public static final String JAVA_IO_TMPDIR = getSystemProperty("java.io.tmpdir");
/**
- * The <code>java.library.path</code> System Property.
- * List of paths to search when loading libraries.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.library.path</code> System Property. List of paths to search
+ * when loading libraries.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -331,10 +348,10 @@
public static final String JAVA_LIBRARY_PATH = getSystemProperty("java.library.path");
/**
- * The <code>java.runtime.name</code> System Property.
- * Java Runtime Environment name.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.runtime.name</code> System Property. Java Runtime Environment
+ * name.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.3
@@ -342,10 +359,10 @@
public static final String JAVA_RUNTIME_NAME = getSystemProperty("java.runtime.name");
/**
- * The <code>java.runtime.version</code> System Property.
- * Java Runtime Environment version.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.runtime.version</code> System Property. Java Runtime Environment
+ * version.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.3
@@ -353,10 +370,10 @@
public static final String JAVA_RUNTIME_VERSION = getSystemProperty("java.runtime.version");
/**
- * The <code>java.specification.name</code> System Property.
- * Java Runtime Environment specification name.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.specification.name</code> System Property. Java Runtime Environment
+ * specification name.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -364,10 +381,10 @@
public static final String JAVA_SPECIFICATION_NAME = getSystemProperty("java.specification.name");
/**
- * The <code>java.specification.vendor</code> System Property.
- * Java Runtime Environment specification vendor.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.specification.vendor</code> System Property. Java Runtime Environment
+ * specification vendor.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -375,10 +392,10 @@
public static final String JAVA_SPECIFICATION_VENDOR = getSystemProperty("java.specification.vendor");
/**
- * The <code>java.specification.version</code> System Property.
- * Java Runtime Environment specification version.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.specification.version</code> System Property. Java Runtime Environment
+ * specification version.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.3
@@ -386,10 +403,9 @@
public static final String JAVA_SPECIFICATION_VERSION = getSystemProperty("java.specification.version");
/**
- * The <code>java.vendor</code> System Property.
- * Java vendor-specific string.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vendor</code> System Property. Java vendor-specific string.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -397,10 +413,9 @@
public static final String JAVA_VENDOR = getSystemProperty("java.vendor");
/**
- * The <code>java.vendor.url</code> System Property.
- * Java vendor URL.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vendor.url</code> System Property. Java vendor URL.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -408,10 +423,9 @@
public static final String JAVA_VENDOR_URL = getSystemProperty("java.vendor.url");
/**
- * The <code>java.version</code> System Property.
- * Java version number.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.version</code> System Property. Java version number.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -420,34 +434,36 @@
//-----------------------------------------------------------------------
/**
- * Gets the Java version as a <code>float</code>.
+ * <p>Gets the Java version as a <code>float</code>.</p>
+ *
* <p>Example return values:</p>
* <ul>
* <li><code>1.2f</code> for JDK 1.2
* <li><code>1.31f</code> for JDK 1.3.1
* </ul>
- * <p>
- * The field will return zero if {@link #JAVA_VERSION} is <code>null</code>.</p>
+ *
+ * <p>The field will return zero if {@link #JAVA_VERSION} is <code>null</code>.</p>
*/
public static final float JAVA_VERSION_FLOAT = getJavaVersionAsFloat();
/**
- * Gets the Java version as an <code>int</code>.
+ * <p>Gets the Java version as an <code>int</code>.</p>
+ *
* <p>Example return values:</p>
* <ul>
* <li><code>120</code> for JDK 1.2
* <li><code>131</code> for JDK 1.3.1
* </ul>
- * <p>
- * The field will return zero if {@link #JAVA_VERSION} is <code>null</code>.</p>
+ *
+ * <p>The field will return zero if {@link #JAVA_VERSION} is <code>null</code>.</p>
*/
public static final int JAVA_VERSION_INT = getJavaVersionAsInt();
/**
- * The <code>java.vm.info</code> System Property.
- * Java Virtual Machine implementation info.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vm.info</code> System Property. Java Virtual Machine implementation
+ * info.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -455,10 +471,10 @@
public static final String JAVA_VM_INFO = getSystemProperty("java.vm.info");
/**
- * The <code>java.vm.name</code> System Property.
- * Java Virtual Machine implementation name.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vm.name</code> System Property. Java Virtual Machine implementation
+ * name.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -466,10 +482,10 @@
public static final String JAVA_VM_NAME = getSystemProperty("java.vm.name");
/**
- * The <code>java.vm.specification.name</code> System Property.
- * Java Virtual Machine specification name.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vm.specification.name</code> System Property. Java Virtual Machine
+ * specification name.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -477,10 +493,10 @@
public static final String JAVA_VM_SPECIFICATION_NAME = getSystemProperty("java.vm.specification.name");
/**
- * The <code>java.vm.specification.vendor</code> System Property.
- * Java Virtual Machine specification vendor.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vm.specification.vendor</code> System Property. Java Virtual
+ * Machine specification vendor.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -488,10 +504,10 @@
public static final String JAVA_VM_SPECIFICATION_VENDOR = getSystemProperty("java.vm.specification.vendor");
/**
- * The <code>java.vm.specification.version</code> System Property.
- * Java Virtual Machine specification version.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vm.specification.version</code> System Property. Java Virtual Machine
+ * specification version.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -499,10 +515,10 @@
public static final String JAVA_VM_SPECIFICATION_VERSION = getSystemProperty("java.vm.specification.version");
/**
- * The <code>java.vm.vendor</code> System Property.
- * Java Virtual Machine implementation vendor.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vm.vendor</code> System Property. Java Virtual Machine implementation
+ * vendor.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -510,10 +526,10 @@
public static final String JAVA_VM_VENDOR = getSystemProperty("java.vm.vendor");
/**
- * The <code>java.vm.version</code> System Property.
- * Java Virtual Machine implementation version.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>java.vm.version</code> System Property. Java Virtual Machine
+ * implementation version.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -521,10 +537,10 @@
public static final String JAVA_VM_VERSION = getSystemProperty("java.vm.version");
/**
- * The <code>line.separator</code> System Property.
- * Line separator ("\n" on UNIX).
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>line.separator</code> System Property. Line separator
+ * (<code>"\n<"</code> on UNIX).</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -532,10 +548,9 @@
public static final String LINE_SEPARATOR = getSystemProperty("line.separator");
/**
- * The <code>os.arch</code> System Property.
- * Operating system architecture.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>os.arch</code> System Property. Operating system architecture.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -543,10 +558,9 @@
public static final String OS_ARCH = getSystemProperty("os.arch");
/**
- * The <code>os.name</code> System Property.
- * Operating system name.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>os.name</code> System Property. Operating system name.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -554,10 +568,9 @@
public static final String OS_NAME = getSystemProperty("os.name");
/**
- * The <code>os.version</code> System Property.
- * Operating system version.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>os.version</code> System Property. Operating system version.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -565,10 +578,10 @@
public static final String OS_VERSION = getSystemProperty("os.version");
/**
- * The <code>path.separator</code> System Property.
- * Path separator (":" on UNIX).
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>path.separator</code> System Property. Path separator
+ * (<code>":"</code> on UNIX).</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -576,12 +589,11 @@
public static final String PATH_SEPARATOR = getSystemProperty("path.separator");
/**
- * The <code>user.country</code> or <code>user.region</code> System Property.
- * User's country code, such as <code>GB</code>.
- * First in JDK version 1.2 as <code>user.region</code>.
- * Renamed to <code>user.country</code> in 1.4
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>user.country</code> or <code>user.region</code> System Property.
+ * User's country code, such as <code>GB</code>. First in JDK version 1.2 as
+ * <code>user.region</code>. Renamed to <code>user.country</code> in 1.4</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -591,10 +603,10 @@
getSystemProperty("user.region") : getSystemProperty("user.country"));
/**
- * The <code>user.dir</code> System Property.
- * User's current working directory.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>user.dir</code> System Property. User's current working
+ * directory.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -602,10 +614,9 @@
public static final String USER_DIR = getSystemProperty("user.dir");
/**
- * The <code>user.home</code> System Property.
- * User's home directory.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>user.home</code> System Property. User's home directory.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -613,10 +624,10 @@
public static final String USER_HOME = getSystemProperty("user.home");
/**
- * The <code>user.language</code> System Property.
- * User's language code, such as 'en'.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>user.language</code> System Property. User's language code,
+ * such as 'en'.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.2
@@ -624,10 +635,9 @@
public static final String USER_LANGUAGE = getSystemProperty("user.language");
/**
- * The <code>user.name</code> System Property.
- * User's account name.
- * <p>
- * Defaults to <code>null</code> if the runtime does not have
+ * <p>The <code>user.name</code> System Property. User's account name.</p>
+ *
+ * <p>Defaults to <code>null</code> if the runtime does not have
* security access to read this property or the property does not exist.</p>
*
* @since Java 1.1
@@ -706,7 +716,7 @@
}
/**
- * Decides if the java version matches.
+ * <p>Decides if the java version matches.</p>
*
* @param versionPrefix the prefix for the java version
* @return true if matches, or false if not or can't determine
@@ -719,7 +729,7 @@
}
/**
- * Decides if the operating system matches.
+ * <p>Decides if the operating system matches.</p>
*
* @param osNamePrefix the prefix for the os name
* @return true if matches, or false if not or can't determine
@@ -732,7 +742,7 @@
}
/**
- * Decides if the operating system matches.
+ * <p>Decides if the operating system matches.</p>
*
* @param osNamePrefix the prefix for the os name
* @param osVersionPrefix the prefix for the version
@@ -747,9 +757,11 @@
//-----------------------------------------------------------------------
/**
- * Gets a System property, defaulting to <code>null</code> if the property
- * cannot be read. If a <code>SecurityException</code> is caught, the return
- * value is <code>null</code> and a message is written to <code>System.err</code>.
+ * <p>Gets a System property, defaulting to <code>null</code> if the property
+ * cannot be read.</p>
+ *
+ * <p>If a <code>SecurityException</code> is caught, the return
+ * value is <code>null</code> and a message is written to <code>System.err</code>.</p>
*
* @param property the system property name
* @return the system property value or <code>null</code> if a security problem occurs
1.5 +12 -12 jakarta-commons/lang/src/java/org/apache/commons/lang/WordWrapUtils.java
Index: WordWrapUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/WordWrapUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- WordWrapUtils.java 8 Jun 2003 23:27:26 -0000 1.4
+++ WordWrapUtils.java 8 Jul 2003 05:59:58 -0000 1.5
@@ -82,14 +82,14 @@
//--------------------------------------------------------------------------
/**
- * Wraps a block of text to a specified line length.
- * <p>
- * This method takes a block of text, which might have long lines in it
+ * <p>Wraps a block of text to a specified line length.</p>
+ *
+ * <p>This method takes a block of text, which might have long lines in it
* and wraps the long lines based on the supplied wrapColumn parameter.
* It was initially implemented for use by VelocityEmail. If there are tabs
* in inString, you are going to get results that are a bit strange,
* since tabs are a single character but are displayed as 4 or 8
- * spaces. Remove the tabs.
+ * spaces. Remove the tabs.</p>
*
* @param str text which is in need of word-wrapping
* @param newline the characters that define a newline
@@ -121,8 +121,8 @@
}
/**
- * Wraps a single line of text.
- * Called by wrapText() to do the real work of wrapping.
+ * <p>Wraps a single line of text. Called by wrapText() to do the real
+ * work of wrapping.</p>
*
* @param line a line which is in need of word-wrapping
* @param newline the characters that define a newline
@@ -170,23 +170,23 @@
//--------------------------------------------------------------------------
/**
- * Create a word-wrapped version of a String. Wrap at 80 characters and
+ * <p>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.
+ * use a - sign to split it.</p>
*/
public static String wordWrap(String str) {
return wordWrap(str, 80, "\n", "-");
}
/**
- * Create a word-wrapped version of a String. Wrap at a specified width and
+ * <p>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.
+ * use a - sign to split it.</p>
*/
public static String wordWrap(String str, int width) {
return wordWrap(str, width, "\n", "-");
}
/**
- * Word-wrap a string.
+ * <p>Word-wrap a string.</p>
*
* @param str String to word-wrap
* @param width int to wrap at
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org