Hello!

As discussed in a previous thread, I've created an issue for adding
"boolean optional() default false" to @InjectComponent to complement
@DisableStrictChecks.

https://issues.apache.org/jira/projects/TAP5/issues/TAP5-2727

The ticket contains a patch with an attempt to implement the required
behavior, plus some tests.
If optional() == true, the InjectComponentWorker just ignores the
UnknownValueException and the embedded component will be null.

That was the easiest way to implement it.
Another option would be creating a proxy in case of an optional and missing
component, which reacts with an appropriate Exception if used.
Or do you think that's overkill?
Like @DisableStrictChecks, it's more of an advanced use case.

Cheers,
Ben

Reply via email to