From 41b6193261883a9aaeb74eab1a2a15da15bd548f Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Mon, 9 Mar 2015 13:00:27 -0400 Subject: [PATCH] Add missing since tags and other minor doc cleanups Fixes #278 --- .../typesafe/config/ConfigBeanFactory.java | 38 +++++++++++-------- .../com/typesafe/config/ConfigException.java | 1 + .../com/typesafe/config/ConfigFactory.java | 2 +- .../com/typesafe/config/ConfigObject.java | 2 +- .../com/typesafe/config/ConfigOrigin.java | 4 ++ .../typesafe/config/ConfigOriginFactory.java | 9 +++++ .../java/com/typesafe/config/ConfigValue.java | 6 ++- 7 files changed, 42 insertions(+), 20 deletions(-) diff --git a/config/src/main/java/com/typesafe/config/ConfigBeanFactory.java b/config/src/main/java/com/typesafe/config/ConfigBeanFactory.java index 49bb6124..66d957be 100644 --- a/config/src/main/java/com/typesafe/config/ConfigBeanFactory.java +++ b/config/src/main/java/com/typesafe/config/ConfigBeanFactory.java @@ -4,28 +4,34 @@ import com.typesafe.config.impl.ConfigBeanImpl; /** * Factory for automatically creating a Java class from a {@link Config}. + * See {@link #create(Config,Class)}. * - * Example usage: - * - *
- * Config configSource = ConfigFactory.load().getConfig("foo");
- * FooConfig config = ConfigBeanFactory.create(configSource, FooConfig.class);
- * 
- * - * The Java class should follow JavaBean conventions. Field types - * can be any of the types you can normally get from a {@link - * Config}, including java.time.Duration or {@link - * ConfigMemorySize}. Fields may also be another JavaBean-style - * class. - * - * Fields are mapped to config by converting the config key to - * camel case. So the key foo-bar becomes JavaBean - * setter setFooBar. + * @since 1.3.0 */ public class ConfigBeanFactory { /** * Creates an instance of a class, initializing its fields from a {@link Config}. + * + * Example usage: + * + *
+     * Config configSource = ConfigFactory.load().getConfig("foo");
+     * FooConfig config = ConfigBeanFactory.create(configSource, FooConfig.class);
+     * 
+ * + * The Java class should follow JavaBean conventions. Field types + * can be any of the types you can normally get from a {@link + * Config}, including java.time.Duration or {@link + * ConfigMemorySize}. Fields may also be another JavaBean-style + * class. + * + * Fields are mapped to config by converting the config key to + * camel case. So the key foo-bar becomes JavaBean + * setter setFooBar. + * + * @since 1.3.0 + * * @param config source of config information * @param clazz class to be instantiated * @param the type of the class to be instantiated diff --git a/config/src/main/java/com/typesafe/config/ConfigException.java b/config/src/main/java/com/typesafe/config/ConfigException.java index f5b7a719..58d54170 100644 --- a/config/src/main/java/com/typesafe/config/ConfigException.java +++ b/config/src/main/java/com/typesafe/config/ConfigException.java @@ -394,6 +394,7 @@ public abstract class ConfigException extends RuntimeException implements Serial /** * Some problem with a JavaBean we are trying to initialize. + * @since 1.3.0 */ public static class BadBean extends BugOrBroken { private static final long serialVersionUID = 1L; diff --git a/config/src/main/java/com/typesafe/config/ConfigFactory.java b/config/src/main/java/com/typesafe/config/ConfigFactory.java index eae89afe..6c4dd3a0 100644 --- a/config/src/main/java/com/typesafe/config/ConfigFactory.java +++ b/config/src/main/java/com/typesafe/config/ConfigFactory.java @@ -639,7 +639,7 @@ public final class ConfigFactory { } /** - * Like {@link parseProperties(Properties, ConfigParseOptions)} but uses default + * Like {@link #parseProperties(Properties, ConfigParseOptions)} but uses default * parse options. * @param properties * a Java Properties object diff --git a/config/src/main/java/com/typesafe/config/ConfigObject.java b/config/src/main/java/com/typesafe/config/ConfigObject.java index 84583c79..37287fc1 100644 --- a/config/src/main/java/com/typesafe/config/ConfigObject.java +++ b/config/src/main/java/com/typesafe/config/ConfigObject.java @@ -129,7 +129,7 @@ public interface ConfigObject extends ConfigValue, Map { * @return the new instance with the new map entry */ ConfigObject withValue(String key, ConfigValue value); - + @Override ConfigObject withOrigin(ConfigOrigin origin); } diff --git a/config/src/main/java/com/typesafe/config/ConfigOrigin.java b/config/src/main/java/com/typesafe/config/ConfigOrigin.java index fc14f459..152e6058 100644 --- a/config/src/main/java/com/typesafe/config/ConfigOrigin.java +++ b/config/src/main/java/com/typesafe/config/ConfigOrigin.java @@ -90,6 +90,8 @@ public interface ConfigOrigin { * Note that when the given comments are equal to the comments on this object, * a new instance may not be created and {@code this} is returned directly. * + * @since 1.3.0 + * * @param comments the comments used on the returned origin * @return the ConfigOrigin with the given comments */ @@ -107,6 +109,8 @@ public interface ConfigOrigin { * object, a new instance may not be created and {@code this} is returned * directly. * + * @since 1.3.0 + * * @param lineNumber the new line number * @return the created ConfigOrigin */ diff --git a/config/src/main/java/com/typesafe/config/ConfigOriginFactory.java b/config/src/main/java/com/typesafe/config/ConfigOriginFactory.java index 9a9a0413..fc1ba30d 100644 --- a/config/src/main/java/com/typesafe/config/ConfigOriginFactory.java +++ b/config/src/main/java/com/typesafe/config/ConfigOriginFactory.java @@ -11,6 +11,7 @@ import com.typesafe.config.impl.ConfigImpl; * But you can also set the origin of an existing {@code ConfigValue}, using * {@link ConfigValue#withOrigin(ConfigOrigin)}. * + * @since 1.3.0 */ public final class ConfigOriginFactory { private ConfigOriginFactory() { @@ -21,6 +22,8 @@ public final class ConfigOriginFactory { * provided. This is the origin used in {@link ConfigValueFactory * #fromAnyRef(Object)}. * + * @since 1.3.0 + * * @return the default origin */ public static ConfigOrigin newSimple() { @@ -30,6 +33,8 @@ public final class ConfigOriginFactory { /** * Returns an origin with the given description. * + * @since 1.3.0 + * * @param description brief description of what the origin is * @return a new origin */ @@ -40,6 +45,8 @@ public final class ConfigOriginFactory { /** * Creates a file origin with the given filename. * + * @since 1.3.0 + * * @param filename the filename of this origin * @return a new origin */ @@ -50,6 +57,8 @@ public final class ConfigOriginFactory { /** * Creates a url origin with the given URL object. * + * @since 1.3.0 + * * @param url the url of this origin * @return a new origin */ diff --git a/config/src/main/java/com/typesafe/config/ConfigValue.java b/config/src/main/java/com/typesafe/config/ConfigValue.java index 59c0525f..b507a616 100644 --- a/config/src/main/java/com/typesafe/config/ConfigValue.java +++ b/config/src/main/java/com/typesafe/config/ConfigValue.java @@ -107,12 +107,14 @@ public interface ConfigValue extends ConfigMergeable { * @return a {@code Config} instance containing this value at the given key. */ Config atKey(String key); - + /** * Returns a {@code ConfigValue} based on this one, but with the given * origin. This is useful when you are parsing a new format of file or setting * comments for a single ConfigValue. - * + * + * @since 1.3.0 + * * @param origin the origin set on the returned value * @return the new ConfigValue with the given origin */