Draft version of an ArgumentParser

Change-Id: I339637b884747d12ee7331555f9de71105c685e6
Introduced ArgumentHandler and made Argument immutable.

Changed the creation of Arguments to use the Builder Pattern.

This simplified the creation of new ArgumentHandlers. See HostPortArgument for an example of this.

Made the error message for Integer/Long/Short/Byte/Char more clear.

Moved ArgumentHandler subclasses (previously Argument subclasses) into their own package.

Change-Id: I86c0b4a13294c985165304fcac8353c4ded7c24c
Added OneParameterArgument to simplify usages of the ArgumentHandler interface.

Restructured builders into their own package. Introduced "internal" packages.

Simplified the CommandExecutor interface by having it be be part of CommandParser instead.

Change-Id: I7e26520be7d87f9d789d0d53e5c734be3a1a6d39
Large update:

* Added support for enum values
* Added possibility to validate(or limit) parsed values, see PositiveInteger for an example
* Added basic Usage printing support, more tests are needed
* Separated test cases into more small subparts (files & packages)
* Added support for "Dynamic" parameters, i.e Map<String, Value>, (with support for repeats)
* Started work on suggestions for unhanded arguments

Change-Id: If607a0cd22dac15622d8f3369f32b7990a99c842
Added StringSplitter, DefaultValueProvider, @Nonnull, StringConverter, Refactored CommanArgument

* Added StringSplitter (i.e ArgumentBuilder#splitWith)

* Added JSR305 and annotated most methods with @Nonnull, @Nullable & @CheckReturnValue

* Fixed ignoreCase for property maps

* Added descriptionForValidValues for argument handlers

* Improved CommandArgument (made it easier to implement a thread safe child class) and added commandNames (to avoid defining the command name in several places)

* Removed RepeatableArgument, made ArgumentHandler more complex but introduced StringConverter as an alternative (and easier) interface for simple arguments

* Started to work on a DefaultValueProvider interface.

Change-Id: I9631433cba0b2e4f762025689c6e612dd2ba5eb9
Improved code coverage.

Added more javadocs.

Added ParsedValueCallback, ParsedValueFinalizer.

Removed dependencies towards other command line parser libs.

Added concurrency test that discovers if ArgumentParser is made mutable (at least when handling standard data types).

Formatted code according to eclipse_formatter_style.xml

Change-Id: Ibb7f77771926b3cdd46abac4070ed7fc1e99f4a1
Introduced the shorthand invocation Argument#parse(String…)

When programs only uses one argument or performance isn't
critical this will make the code much more readable.

As evidenced by the decrease in test code size (-112 lines)
this will result in much less code for simple arguments.

Change-Id: I178409f569ec39b665cc50439096ad8162f859b6
Moved @Nonnull/@Nullable to be before any other modifiers.

Fixed a problem with describing RadixiableArguments, especially Longs.

Renamed ParsedValueCallback.java, ParsedValueFinalizer.java, to
Callback, Finalizer to get a more consistent class name design.

Also renamed ValueValidator to Limiter and made it return a value instead of throwing.

Moved every ArgumentHandler into ArgumentFactory to hide the implementation details.
Moved every Limiter into Limiters.
Moved every Callback into Callbacks.
Moved every Finalizer into Finalizers.
Moved every StringSplitter into StringSplitters.
Moved every Description into Descriptions.
Moved every DefaultValueProvider into DefaultValueProviders.

Hopefully this makes it super clear where to find implementations for the different interfaces.
I realize that there are several cons with this design:
1. The package will grow very big as I add features
2. It's not as easy to find all features as they all are in the same package

But I think the pros outweigh the cons:
1. Much more private implementations = less noise in the autocomplete suggestions
2. More consistent names = No more guessing what the prefix of the class is
3. A more natural way to find implementations = they are right next to the interface
4. This follows the same pattern as Guava uses = Guava users will feel right at home
5. Less packages = less frightening/overwhelming for new users

Change-Id: Ie02988426dd1d4db3048155064d499b7ef63c20e
Moved exceptions from the exceptions package into ArgumentExceptions.

Renamed
* ArgumentHandler to StringParser and made the more advanced
  InternalStringParser package-private inside StringParsers.
* CommandArgument to Command
* ArgumentParser to CommandLineParser and introduced CommandLineParsers
  that implement the CommandLineParser interface.
* DefaultValueProvider to Provider

Introduced Cache, ForwardingStringParser, Describer.

And I also achieved 100% code coverage.
I'm excited about testing this with Jester to see what the test coverage is.

Change-Id: Ibfe59a7fe170f1d5190ae5dd6ef62988563d5b4c
Moved expected Usage texts into resources.

Added minValue/maxValue to radixiable arguments
(byte,short,integer,long).

This may have to be replaced with calls to Limiters.range(C start,
C end) but care needs to be taken when a different radix is set and the
limit is printed...

Change-Id: I18ed4565fc9344fac17ebdce636f29400c353c29
Simplified how classes can extend the Command class.

Added support for running two commands each with parameters of their own
with a single command line invocation.

Change-Id: I0b00d27659aa0164ef55adef5460f72a15228845
Replaced Provider/Providers/Cache with Guavas Supplier.

Removed Callback/Callbacks that was used with
ArgumentBuilder#callbackForValues(Callback) because this feature can
pretty easily be implemented with a ForwardingStringParser.

"When in doubt, leave it out", Joshua Bloch

Change-Id: I0efa1b7c96814b7307f0aedae0e20b9851b98ad1
Clarified the Describer interface.

Change-Id: Ia079e94ae1e26e3a851f4d1f63bb3fd0c43abee5
Introduced Limiters#asPredicate(Limiter)

Change-Id: I5f4d5f4c13dc1e0a068b0d6766edfbc6d37870f9
Renamed Lines -> Platform, Arguments -> ArgumentIterator.

Increased dependency version of Guava.

Fixed printing of separator between name and meta description.

Fixed empty separator.

Fixed > 1 length separators.

Fixed handling of defaultValueSupplier/defaultValueDescriber for List
arguments.

Fixed printing of default values for list/map arguments.

Introduced the requirement that meta descriptions needs to be non-empty.

Change-Id: I9ca9229b86036bb2f8528c33db54de4b56dde951
Fixed a @Nonnull warning.

Change-Id: I428baae0846cd6a5774497a0f635ed2878b8fab8
Cleaned up some test cases

* Updated the tests to use the latest ways to
parse in the API
* Moved positive test cases to the top of the test case
files as this is what you first need to read to understand what the
feature is about.

Made most exception classes package private.

Added the possibility to declare a description inside of Command
classes. This should make it easier to produce nice usage texts while
still invoking CommandLineParser.forCommands(...) instead of
CommandLineParser.forArguments(...)

Added support for combined options such as "-fs" instead of "-f -s"

Removed validation of enum classes in the EnumParser constructor because
it caused the enum class to initialize.

Change-Id: Ie882b85f57875251ebf5698b5fe04578c60290dc
Removed getClass check in RadixiableParser.

Change-Id: Icbe6fc5af9608b2688074107ee2280c786d12a89
Moved Finalizer/Finalizers into the internal package to minimize the
public API.

Added validValuesDescription() in Limiter, this is now printed in the
usage if a limiter is used.

Removed CompoundLimiter as it wouldn't work properly with
RangeLimiterForRadix.

Moved parsing/printing logic in RadixiableParser into NumberType and
Radix so that it uses the strategy pattern instead.

Changed printing of numbers to remove leading zeros.

Change-Id: I01f545110fb30a0f2af3a6e47b44ee19e21ec0bc
Fixed usage for commands

Change-Id: I20d001565906fee0ecede86b655ccd7be71b99b2