Repository: commons-text Updated Branches: refs/heads/master f8a2b9a3a -> 4f28f3795
[TEXT-113] Add an interpolator string lookup. Javadoc. Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/4f28f379 Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/4f28f379 Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/4f28f379 Branch: refs/heads/master Commit: 4f28f379591f9a55af467810ae47c9d7a1fbaa95 Parents: f8a2b9a Author: Gary Gregory <[email protected]> Authored: Sat Feb 10 17:25:40 2018 -0700 Committer: Gary Gregory <[email protected]> Committed: Sat Feb 10 17:25:40 2018 -0700 ---------------------------------------------------------------------- .../text/lookup/InterpolatorStringLookup.java | 26 +++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-text/blob/4f28f379/src/main/java/org/apache/commons/text/lookup/InterpolatorStringLookup.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/text/lookup/InterpolatorStringLookup.java b/src/main/java/org/apache/commons/text/lookup/InterpolatorStringLookup.java index 1e6faf2..2ded621 100644 --- a/src/main/java/org/apache/commons/text/lookup/InterpolatorStringLookup.java +++ b/src/main/java/org/apache/commons/text/lookup/InterpolatorStringLookup.java @@ -33,14 +33,23 @@ public class InterpolatorStringLookup extends AbstractStringLookup { private final Map<String, StringLookup> stringLookupMap = new HashMap<>(); /** - * Create the default Interpolator using only Lookups that work without an event. + * Creates an instance using only lookups that work without initial properties and are stateless. + * <p> + * The following lookups are installed: + * </p> + * <ul> + * <li>"sys" for the SystemPropertyStringLookup.</li> + * <li>"env" for the EnvironmentVariableStringLookup.</li> + * <li>"java" for the JavaPlatformStringLookup.</li> + * <li>"date" for the DateStringLookup.</li> + * </ul> */ public InterpolatorStringLookup() { this((Map<String, String>) null); } /** - * Creates the Interpolator using only Lookups that work without an event and initial properties. + * Creates an instance using only lookups that work without initial properties and are stateless. * <p> * The following lookups are installed: * </p> @@ -63,11 +72,22 @@ public class InterpolatorStringLookup extends AbstractStringLookup { stringLookupMap.put("date", DateStringLookup.INSTANCE); } + /** + * Creates an instance with the given lookup. + * + * @param defaultStringLookup + * the default lookup. + */ public InterpolatorStringLookup(final StringLookup defaultStringLookup) { this.defaultStringLookup = defaultStringLookup; } - public Map<String, StringLookup> getStrLookupMap() { + /** + * Gets the lookup map. + * + * @return the lookup map. + */ + public Map<String, StringLookup> getStringLookupMap() { return stringLookupMap; }
