You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2019/08/04 15:50:22 UTC

[commons-text] branch master updated: Expand Javadoc. Remove trailing white spaces on all lines.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git


The following commit(s) were added to refs/heads/master by this push:
     new eb9d133  Expand Javadoc. Remove trailing white spaces on all lines.
eb9d133 is described below

commit eb9d133260513e73f2e1e53fdae0e0143cfd1574
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Aug 4 11:50:19 2019 -0400

    Expand Javadoc.
    Remove trailing white spaces on all lines.
---
 .../text/lookup/Base64DecoderStringLookup.java     |  6 +-
 .../text/lookup/Base64EncoderStringLookup.java     |  6 +-
 .../commons/text/lookup/ConstantStringLookup.java  |  4 +-
 .../commons/text/lookup/DateStringLookup.java      |  4 +-
 .../lookup/EnvironmentVariableStringLookup.java    |  6 +-
 .../commons/text/lookup/FileStringLookup.java      |  4 +-
 .../text/lookup/JavaPlatformStringLookup.java      | 32 ++++++--
 .../commons/text/lookup/StringLookupFactory.java   | 96 +++++++++++++---------
 .../apache/commons/text/lookup/package-info.java   |  2 +-
 9 files changed, 97 insertions(+), 63 deletions(-)

diff --git a/src/main/java/org/apache/commons/text/lookup/Base64DecoderStringLookup.java b/src/main/java/org/apache/commons/text/lookup/Base64DecoderStringLookup.java
index b67d867..26a05d5 100644
--- a/src/main/java/org/apache/commons/text/lookup/Base64DecoderStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/Base64DecoderStringLookup.java
@@ -27,21 +27,21 @@ import org.apache.commons.text.StringSubstitutor;
  * <p>
  * Using a {@link StringLookup} from the {@link StringLookupFactory}:
  * </p>
- * 
+ *
  * <pre>
  * StringLookupFactory.INSTANCE.base64DecoderStringLookup().lookup("SGVsbG9Xb3JsZCE=");
  * </pre>
  * <p>
  * Using a {@link StringSubstitutor}:
  * </p>
- * 
+ *
  * <pre>
  * StringSubstitutor.createInterpolator().replace("... ${base64Decoder:SGVsbG9Xb3JsZCE=} ..."));
  * </pre>
  * <p>
  * The above examples convert {@code "SGVsbG9Xb3JsZCE="} to {@code "HelloWorld!"}.
  * </p>
- * 
+ *
  * @since 1.5
  */
 final class Base64DecoderStringLookup extends AbstractStringLookup {
diff --git a/src/main/java/org/apache/commons/text/lookup/Base64EncoderStringLookup.java b/src/main/java/org/apache/commons/text/lookup/Base64EncoderStringLookup.java
index 8fd8bdb..5c30951 100644
--- a/src/main/java/org/apache/commons/text/lookup/Base64EncoderStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/Base64EncoderStringLookup.java
@@ -27,21 +27,21 @@ import org.apache.commons.text.StringSubstitutor;
  * <p>
  * Using a {@link StringLookup} from the {@link StringLookupFactory}:
  * </p>
- * 
+ *
  * <pre>
  * StringLookupFactory.INSTANCE.base64EncoderStringLookup().lookup("HelloWorld!");
  * </pre>
  * <p>
  * Using a {@link StringSubstitutor}:
  * </p>
- * 
+ *
  * <pre>
  * StringSubstitutor.createInterpolator().replace("... ${base64Encoder:HelloWorld!} ..."));
  * </pre>
  * <p>
  * The above examples convert {@code "HelloWorld!"} to {@code "SGVsbG9Xb3JsZCE="}.
  * </p>
- * 
+ *
  * @since 1.6
  */
 final class Base64EncoderStringLookup extends AbstractStringLookup {
diff --git a/src/main/java/org/apache/commons/text/lookup/ConstantStringLookup.java b/src/main/java/org/apache/commons/text/lookup/ConstantStringLookup.java
index a432d47..e3fc737 100644
--- a/src/main/java/org/apache/commons/text/lookup/ConstantStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/ConstantStringLookup.java
@@ -41,14 +41,14 @@ import org.apache.commons.text.StringSubstitutor;
  * <p>
  * Using a {@link StringLookup} from the {@link StringLookupFactory}:
  * </p>
- * 
+ *
  * <pre>
  * StringLookupFactory.INSTANCE.constantStringLookup().lookup("java.awt.event.KeyEvent.VK_ESCAPE");
  * </pre>
  * <p>
  * Using a {@link StringSubstitutor}:
  * </p>
- * 
+ *
  * <pre>
  * StringSubstitutor.createInterpolator().replace("... ${const:java.awt.event.KeyEvent.VK_ESCAPE} ..."));
  * </pre>
diff --git a/src/main/java/org/apache/commons/text/lookup/DateStringLookup.java b/src/main/java/org/apache/commons/text/lookup/DateStringLookup.java
index 5333b0e..8f7c0b6 100644
--- a/src/main/java/org/apache/commons/text/lookup/DateStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/DateStringLookup.java
@@ -29,14 +29,14 @@ import org.apache.commons.text.StringSubstitutor;
  * <p>
  * Using a {@link StringLookup} from the {@link StringLookupFactory}:
  * </p>
- * 
+ *
  * <pre>
  * StringLookupFactory.INSTANCE.dateStringLookup().lookup("yyyy-MM-dd");
  * </pre>
  * <p>
  * Using a {@link StringSubstitutor}:
  * </p>
- * 
+ *
  * <pre>
  * StringSubstitutor.createInterpolator().replace("... ${date:yyyy-MM-dd} ..."));
  * </pre>
diff --git a/src/main/java/org/apache/commons/text/lookup/EnvironmentVariableStringLookup.java b/src/main/java/org/apache/commons/text/lookup/EnvironmentVariableStringLookup.java
index 398629a..2b7f57c 100644
--- a/src/main/java/org/apache/commons/text/lookup/EnvironmentVariableStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/EnvironmentVariableStringLookup.java
@@ -23,14 +23,14 @@ import org.apache.commons.text.StringSubstitutor;
  * <p>
  * Using a {@link StringLookup} from the {@link StringLookupFactory}:
  * </p>
- * 
+ *
  * <pre>
  * StringLookupFactory.INSTANCE.dateStringLookup().lookup("USER");
  * </pre>
  * <p>
  * Using a {@link StringSubstitutor}:
  * </p>
- * 
+ *
  * <pre>
  * StringSubstitutor.createInterpolator().replace("... ${env:USER} ..."));
  * </pre>
@@ -38,7 +38,7 @@ import org.apache.commons.text.StringSubstitutor;
  * The above examples convert (on Linux) {@code "USER"} to the current user name. On Windows 10, you would use
  * {@code "USERNAME"} to the same effect.
  * </p>
- * 
+ *
  * @since 1.3
  */
 final class EnvironmentVariableStringLookup extends AbstractStringLookup {
diff --git a/src/main/java/org/apache/commons/text/lookup/FileStringLookup.java b/src/main/java/org/apache/commons/text/lookup/FileStringLookup.java
index 503d308..3162832 100644
--- a/src/main/java/org/apache/commons/text/lookup/FileStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/FileStringLookup.java
@@ -27,14 +27,14 @@ import org.apache.commons.text.StringSubstitutor;
  * <p>
  * Using a {@link StringLookup} from the {@link StringLookupFactory}:
  * </p>
- * 
+ *
  * <pre>
  * StringLookupFactory.INSTANCE.fileStringLookup().lookup(UTF-8:com/domain/document.properties");
  * </pre>
  * <p>
  * Using a {@link StringSubstitutor}:
  * </p>
- * 
+ *
  * <pre>
  * StringSubstitutor.createInterpolator().replace("... ${file:UTF-8:com/domain/document.properties} ..."));
  * </pre>
diff --git a/src/main/java/org/apache/commons/text/lookup/JavaPlatformStringLookup.java b/src/main/java/org/apache/commons/text/lookup/JavaPlatformStringLookup.java
index fff9b79..178f124 100644
--- a/src/main/java/org/apache/commons/text/lookup/JavaPlatformStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/JavaPlatformStringLookup.java
@@ -19,6 +19,7 @@ package org.apache.commons.text.lookup;
 import java.util.Locale;
 
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.text.StringSubstitutor;
 
 /**
  * Looks up keys related to Java: Java version, JRE version, VM version, and so on.
@@ -34,6 +35,25 @@ import org.apache.commons.lang3.StringUtils;
  * <li><b>locale</b>: "default locale: en_US, platform encoding: iso-8859-1"</li>
  * </ul>
  *
+ * <p>
+ * Using a {@link StringLookup} from the {@link StringLookupFactory}:
+ * </p>
+ *
+ * <pre>
+ * StringLookupFactory.INSTANCE.javaPlatformStringLookup().lookup("version");
+ * </pre>
+ * <p>
+ * Using a {@link StringSubstitutor}:
+ * </p>
+ *
+ * <pre>
+ * StringSubstitutor.createInterpolator().replace("... ${java:version} ..."));
+ * </pre>
+ * <p>
+ * The above examples convert {@code "version"} to the current VM version, for example,
+ * {@code "Java version 1.8.0_181"}.
+ * </p>
+ *
  * @since 1.3
  */
 final class JavaPlatformStringLookup extends AbstractStringLookup {
@@ -122,8 +142,7 @@ final class JavaPlatformStringLookup extends AbstractStringLookup {
     /**
      * Gets the given system property.
      *
-     * @param name
-     *            a system property name.
+     * @param name a system property name.
      * @return a system property value.
      */
     private String getSystemProperty(final String name) {
@@ -133,10 +152,8 @@ final class JavaPlatformStringLookup extends AbstractStringLookup {
     /**
      * Gets the given system property.
      *
-     * @param prefix
-     *            the prefix to use for the result string
-     * @param name
-     *            a system property name.
+     * @param prefix the prefix to use for the result string
+     * @param name   a system property name.
      * @return The prefix + a system property value.
      */
     private String getSystemProperty(final String prefix, final String name) {
@@ -171,8 +188,7 @@ final class JavaPlatformStringLookup extends AbstractStringLookup {
      * <li><b>locale</b>: "default locale: en_US, platform encoding: iso-8859-1"</li>
      * </ul>
      *
-     * @param key
-     *            the key to be looked up, may be null
+     * @param key the key to be looked up, may be null
      * @return The value of the environment variable.
      */
     @Override
diff --git a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
index 7cfc90b..b548503 100644
--- a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
+++ b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
@@ -148,119 +148,119 @@ public final class StringLookupFactory {
     public static final StringLookupFactory INSTANCE = new StringLookupFactory();
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_BASE64_DECODER}.
      *
      * @since 1.6
      */
     public static final String KEY_BASE64_DECODER = "base64Decoder";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_BASE64_ENCODER}.
      *
      * @since 1.6
      */
     public static final String KEY_BASE64_ENCODER = "base64Encoder";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_CONST}.
      *
      * @since 1.6
      */
     public static final String KEY_CONST = "const";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_DATE}.
      *
      * @since 1.6
      */
     public static final String KEY_DATE = "date";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_DNS}.
      *
      * @since 1.8
      */
     public static final String KEY_DNS = "dns";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_ENV}.
      *
      * @since 1.6
      */
     public static final String KEY_ENV = "env";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_FILE}.
      *
      * @since 1.6
      */
     public static final String KEY_FILE = "file";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_JAVA}.
      *
      * @since 1.6
      */
     public static final String KEY_JAVA = "java";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_LOCALHOST}.
      *
      * @since 1.6
      */
     public static final String KEY_LOCALHOST = "localhost";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_PROPERTIES}.
      *
      * @since 1.6
      */
     public static final String KEY_PROPERTIES = "properties";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_RESOURCE_BUNDLE}.
      *
      * @since 1.6
      */
     public static final String KEY_RESOURCE_BUNDLE = "resourceBundle";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_SCRIPT}.
      *
      * @since 1.6
      */
     public static final String KEY_SCRIPT = "script";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_SYS}.
      *
      * @since 1.6
      */
     public static final String KEY_SYS = "sys";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_URL}.
      *
      * @since 1.6
      */
     public static final String KEY_URL = "url";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_URL_DECODER}.
      *
      * @since 1.6
      */
     public static final String KEY_URL_DECODER = "urlDecoder";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_URL_ENCODER}.
      *
      * @since 1.6
      */
     public static final String KEY_URL_ENCODER = "urlEncoder";
 
     /**
-     * Default lookup key for interpolation.
+     * Default lookup key for interpolation {@value #KEY_XML}.
      *
      * @since 1.6
      */
@@ -303,21 +303,21 @@ public final class StringLookupFactory {
      * <p>
      * Using a {@link StringLookup} from the {@link StringLookupFactory}:
      * </p>
-     * 
+     *
      * <pre>
      * StringLookupFactory.INSTANCE.base64DecoderStringLookup().lookup("SGVsbG9Xb3JsZCE=");
      * </pre>
      * <p>
      * Using a {@link StringSubstitutor}:
      * </p>
-     * 
+     *
      * <pre>
      * StringSubstitutor.createInterpolator().replace("... ${base64Decoder:SGVsbG9Xb3JsZCE=} ..."));
      * </pre>
      * <p>
      * The above examples convert {@code "SGVsbG9Xb3JsZCE="} to {@code "HelloWorld!"}.
      * </p>
-     * 
+     *
      * @return The DateStringLookup singleton instance.
      * @since 1.5
      */
@@ -330,21 +330,21 @@ public final class StringLookupFactory {
      * <p>
      * Using a {@link StringLookup} from the {@link StringLookupFactory}:
      * </p>
-     * 
+     *
      * <pre>
      * StringLookupFactory.INSTANCE.base64EncoderStringLookup().lookup("HelloWorld!");
      * </pre>
      * <p>
      * Using a {@link StringSubstitutor}:
      * </p>
-     * 
+     *
      * <pre>
      * StringSubstitutor.createInterpolator().replace("... ${base64Encoder:HelloWorld!} ..."));
      * </pre>
      * <p>
      * The above examples convert {@code } to {@code "SGVsbG9Xb3JsZCE="}.
      * </p>
-     * 
+     *
      * @return The DateStringLookup singleton instance.
      * @since 1.6
      */
@@ -357,14 +357,14 @@ public final class StringLookupFactory {
      * <p>
      * Using a {@link StringLookup} from the {@link StringLookupFactory}:
      * </p>
-     * 
+     *
      * <pre>
      * StringLookupFactory.INSTANCE.base64DecoderStringLookup().lookup("SGVsbG9Xb3JsZCE=");
      * </pre>
      * <p>
      * Using a {@link StringSubstitutor}:
      * </p>
-     * 
+     *
      * <pre>
      * StringSubstitutor.createInterpolator().replace("... ${base64Decoder:SGVsbG9Xb3JsZCE=} ..."));
      * </pre>
@@ -397,21 +397,21 @@ public final class StringLookupFactory {
      * <p>
      * Using a {@link StringLookup} from the {@link StringLookupFactory}:
      * </p>
-     * 
+     *
      * <pre>
      * StringLookupFactory.INSTANCE.constantStringLookup().lookup("java.awt.event.KeyEvent.VK_ESCAPE");
      * </pre>
      * <p>
      * Using a {@link StringSubstitutor}:
      * </p>
-     * 
+     *
      * <pre>
      * StringSubstitutor.createInterpolator().replace("... ${const:java.awt.event.KeyEvent.VK_ESCAPE} ..."));
      * </pre>
      * <p>
      * The above examples convert {@code java.awt.event.KeyEvent.VK_ESCAPE} to {@code "27"}.
      * </p>
-     * 
+     *
      * @return The DateStringLookup singleton instance.
      * @since 1.5
      */
@@ -425,21 +425,21 @@ public final class StringLookupFactory {
      * <p>
      * Using a {@link StringLookup} from the {@link StringLookupFactory}:
      * </p>
-     * 
+     *
      * <pre>
      * StringLookupFactory.INSTANCE.dateStringLookup().lookup("yyyy-MM-dd");
      * </pre>
      * <p>
      * Using a {@link StringSubstitutor}:
      * </p>
-     * 
+     *
      * <pre>
      * StringSubstitutor.createInterpolator().replace("... ${date:yyyy-MM-dd} ..."));
      * </pre>
      * <p>
      * The above examples convert {@code "yyyy-MM-dd"} to todays's date, for example, {@code "2019-08-04"}.
      * </p>
-     * 
+     *
      * @return The DateStringLookup singleton instance.
      */
     public StringLookup dateStringLookup() {
@@ -452,14 +452,14 @@ public final class StringLookupFactory {
      * <p>
      * Using a {@link StringLookup} from the {@link StringLookupFactory}:
      * </p>
-     * 
+     *
      * <pre>
      * StringLookupFactory.INSTANCE.dateStringLookup().lookup("USER");
      * </pre>
      * <p>
      * Using a {@link StringSubstitutor}:
      * </p>
-     * 
+     *
      * <pre>
      * StringSubstitutor.createInterpolator().replace("... ${env:USER} ..."));
      * </pre>
@@ -467,7 +467,7 @@ public final class StringLookupFactory {
      * The above examples convert (on Linux) {@code "USER"} to the current user name. On Windows 10, you would use
      * {@code "USERNAME"} to the same effect.
      * </p>
-     * 
+     *
      * @return The EnvironmentVariableStringLookup singleton instance.
      */
     public StringLookup environmentVariableStringLookup() {
@@ -479,14 +479,14 @@ public final class StringLookupFactory {
      * <p>
      * Using a {@link StringLookup} from the {@link StringLookupFactory}:
      * </p>
-     * 
+     *
      * <pre>
      * StringLookupFactory.INSTANCE.fileStringLookup().lookup("UTF-8:com/domain/document.properties");
      * </pre>
      * <p>
      * Using a {@link StringSubstitutor}:
      * </p>
-     * 
+     *
      * <pre>
      * StringSubstitutor.createInterpolator().replace("... ${file:UTF-8:com/domain/document.properties} ..."));
      * </pre>
@@ -504,19 +504,19 @@ public final class StringLookupFactory {
     /**
      * Returns a new InterpolatorStringLookup using the {@link StringLookupFactory default lookups}.
      * <p>
-     * The lookups available to an interpolator are defined in 
+     * The lookups available to an interpolator are defined in
      * </p>
      * <p>
      * Using a {@link StringLookup} from the {@link StringLookupFactory}:
      * </p>
-     * 
+     *
      * <pre>
      * StringLookupFactory.INSTANCE.interpolatorStringLookup().lookup("${sys:os.name}, ${env:USER}");
      * </pre>
      * <p>
      * Using a {@link StringSubstitutor}:
      * </p>
-     * 
+     *
      * <pre>
      * StringSubstitutor.createInterpolator().replace("... ${sys:os.name}, ${env:USER} ..."));
      * </pre>
@@ -584,6 +584,24 @@ public final class StringLookupFactory {
      * <li><b>locale</b>: "default locale: en_US, platform encoding: iso-8859-1"</li>
      * </ul>
      *
+     * <p>
+     * Using a {@link StringLookup} from the {@link StringLookupFactory}:
+     * </p>
+     *
+     * <pre>
+     * StringLookupFactory.INSTANCE.javaPlatformStringLookup().lookup("version");
+     * </pre>
+     * <p>
+     * Using a {@link StringSubstitutor}:
+     * </p>
+     *
+     * <pre>
+     * StringSubstitutor.createInterpolator().replace("... ${java:version} ..."));
+     * </pre>
+     * <p>
+     * The above examples convert {@code "version"} to the current VM version, for example, {@code "Java version 1.8.0_181"}.
+     * </p>
+     *
      * @return The JavaPlatformStringLookup singleton instance.
      */
     public StringLookup javaPlatformStringLookup() {
diff --git a/src/main/java/org/apache/commons/text/lookup/package-info.java b/src/main/java/org/apache/commons/text/lookup/package-info.java
index 984aeb4..192f462 100644
--- a/src/main/java/org/apache/commons/text/lookup/package-info.java
+++ b/src/main/java/org/apache/commons/text/lookup/package-info.java
@@ -21,7 +21,7 @@
  * </p>
  *
  * <p>
- * The initial implementation was adapted from Apache Commons Log4j 2.10.1-SNAPSHOT.
+ * The initial implementation was adapted from Apache Commons Log4j 2.11.0.
  * </p>
  *
  * @since 1.3