My preference would be to take best of both here - I think a lot of time the 
SimpleLiteral is enough (and AnnotationInstanceProvider should have such a 
method) but that it can be useful to produce a literal with members as well. I 
don't love the lack of type safety though, in the map of values, so maybe that 
is a good reason not to do this (and promote "real literals" in this case).

Grepping the sSeam code base the member value version is used extensively by 
the XML extension to add annotations to types, which seems to me to be a good 
argument to include it, as we want to add the XML stuff soon I think?

On 18 Jan 2012, at 17:27, Gerhard Petracek wrote:

> no - it's just that simple. ok - i'll edit the issue to review and
> discuss AnnotationInstanceProvider.
> 
> thx & regards,
> gerhard
> 
> 
> 
> 2012/1/18 Pete Muir <pm...@redhat.com>
> 
>> +1. Solder offers the same -
>> https://github.com/seam/solder/blob/master/api/src/main/java/org/jboss/solder/reflection/AnnotationInstanceProvider.java
>> 
>> Solder also allows you to pass in a map of values. Does CODI have a
>> "ComplexLiteral" that does this?
>> 
>> On 18 Jan 2012, at 17:08, Gerhard Petracek wrote:
>> 
>>> hi @ all,
>>> 
>>> like DELTASPIKE-53 this ticket is also related to DELTASPIKE-45. for
>> users
>>> it might be useful to use: SimpleLiteral.of(MySimpleAnnotation.class) in
>>> combination with the builder methods instead of implementing literals
>>> manually (just for using them with the default values).
>>> at [1] you can see the util we have in myfaces codi for it. if we agree
>> on
>>> it, i'll push this class.
>>> 
>>> regards,
>>> gerhard
>>> 
>>> [1] http://s.apache.org/Ffp
>> 
>> 

Reply via email to