Adds a new OptionalBinder.  OptionalBinder allows frameworks to setup bindings for items that user code may or may not bind.  It also allows frameworks to set default values that users can override.

The API is:
OptionalBinder.newOptionalBinder(Binder, Class|TypeLiteral|Key) -> OptionalBinder
optionalBinder.setDefault -> LinkedBindingBuilder
optionalBinder.setBinding -> LinkedBindingBuilder

By way of example, this will do:

newOptionalBinder(..) -> @Inject Thing -> exception: neither setDefault nor setBinding called
newOptionalBinder(..) -> @Inject Optional<Thing> -> isPresent() == false
newOptionalBinder(..).setDefault().to("a") -> @Inject Thing -> "a"
newOptionalBinder(..).setDefault().to("a") -> @Inject Optional<Thing> --> get() == "a"
newOptionalBinder(..).setDefault().to("a") + newOptionalBinder(..).setBinding().to("b") -> @Inject Thing -> "b"
newOptionalBinder(..).setDefault().to("a") + newOptionalBinder(..).setBinding().to("b") -> @Inject Optional<Thing> -> get() == "b"
newOptionalBinder(..).setBinding().to("b") -> @Inject Thing -> "b"
newOptionalBinder(..).setBinding().to("b") -> @Inject Optional<Thing> -> get() == "b"
newOptionalBinder(..).setDefault().to("a") + newOptionalBinder(..).setDefault().to("b") -> configuration exception
newOptionalBinder(..).setBinding().to("a") + newOptionalBinder(..).setBinding().to("b") -> configuration exception

(This also adds the jsr305 jar for build time, because doclava wanted it. Frustrating.)

(This also fixes users that implemented MultibindingsTargetVisitor, because I can't use default methods yet.)
Created by MOE:
10 files changed