Skip to content

Commit

Permalink
Cosmetic improvements + formatter pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
mukel committed Jul 8, 2019
1 parent 5fc6f9a commit df0bd74
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ public Builder help(@SuppressWarnings("hiding") String help) {
}

/**
* Defines if option is an {@link OptionMap option map}. The default value is
* <code>false</code>.
* Defines if this option is an {@link OptionMap option map}. The default value is
* <code>false</code>. See {@link OptionKey#mapOf(Class)}.
*
* @since 20.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public OptionKey(T defaultValue, OptionType<T> type) {
* properties. See {@link OptionMap}.
*
* Example usage:
*
* <pre>
* &#64;Option.Group("mylang")
* public class MiscOptions {
Expand All @@ -98,14 +99,16 @@ public OptionKey(T defaultValue, OptionType<T> type) {
* </pre>
*
* Keys can be set using the {@code mylang.Properties} prefix.
*
* <pre>
* Engine engine = Engine.newBuilder()
* .option(&quot;mylang.Properties.key&quot;, &quot;value&quot;)
* .option(&quot;mylang.Properties.user.name&quot;, &quot;guest&quot;)
* .build();
* Engine engine = Engine.newBuilder() //
* .option(&quot;mylang.Properties.key&quot;, &quot;value&quot;) //
* .option(&quot;mylang.Properties.user.name&quot;, &quot;guest&quot;) //
* .build();
* </pre>
*
* The option map can be consumed as follows:
*
* <pre>
* OptionMap&lt;String&gt; properties = getOptions().get(MiscOptions.Properties);
* properties.get(&quot;key&quot;); // value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ public T convert(String value) {
}

/**
* Converts a string value, validates it, and converts it to an object of this type. For option maps
* includes the previous map stored for the option and the key.
* Converts a string value, validates it, and converts it to an object of this type. For option
* maps includes the previous map stored for the option and the key.
*
* @param nameSuffix the key for prefix options.
* @param previousValue the previous value holded by option.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,11 @@ public static class OptionError {
@Option(help = "A", name = "Duplicate", deprecated = true, category = OptionCategory.USER) //
static final OptionKey<String> Error8 = new OptionKey<>("defaultValue");

@ExpectError("Options cannot have a '.' in the name") //
@ExpectError("Options cannot contain a '.' in the name") //
@Option(help = "A", name = "Category.SubCategory", deprecated = true, category = OptionCategory.USER) //
static final OptionKey<OptionMap<String>> Error9 = OptionKey.mapOf(String.class);

@ExpectError("Options cannot have a '.' in the name") //
@ExpectError("Options cannot contain a '.' in the name") //
@Option(help = "A", name = "Property.SubProperty", deprecated = true, category = OptionCategory.USER) //
static final OptionKey<String> Error10 = new OptionKey<>("defaultValue");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private boolean processElement(Element element, AnnotationMirror elementAnnotati
}

if (optionName.contains(".")) {
error(element, elementAnnotation, "Options cannot have a '.' in the name");
error(element, elementAnnotation, "Options cannot contain a '.' in the name");
return false;
}

Expand Down

0 comments on commit df0bd74

Please sign in to comment.