[
https://issues.jboss.org/browse/ROASTER-100?page=com.atlassian.jira.plugi...
]
Kai Müller commented on ROASTER-100:
------------------------------------
Hi,
I found a way to this. Two questions for this:
1. Where should I add the logic to create an annotation without an assigned java type. For
testing purpose I create a dummy class, add the annotation and then use only it. But maybe
it makes sense to add a method _createUnparentAnnotation _to JavaType (or any other
interface)?
2. Do you know how to the string representation of a annotation without calling
toString()?
The current idea looks like this
{code:java}
public AnnotationSource<O> setAnnotationArrayValue(String name,
AnnotationSource<O>[] values)
{
final List<String> literals = new ArrayList<>();
for (AnnotationSource<O> value : requireNonNull(values))
{
//TODO not nice
literals.add(requireNonNull(value).toString());
}
return setArrayLiteralValue(name, literals);
}
{code}
BR,
Kai
Can't add array of annotations as annotation value
--------------------------------------------------
Key: ROASTER-100
URL:
https://issues.jboss.org/browse/ROASTER-100
Project: Roaster
Issue Type: Feature Request
Components: API
Affects Versions: 2.18.4.Final
Reporter: Simone D'Avico
Priority: Major
Fix For: 2.x Future
It is not currently possible to generate an annotation such as
{code:java}
@MatrixMix (
mix = { @Row({ 50, 50, 50, 50 ,50 }),
@Row({ 50, 50, 50, 50 ,50 }),
@Row({ 50, 50, 50, 50 ,50 }) }
)
{code}
The only workaround is to treat the array as a String and set it as a literal, as
discussed [
here|https://developer.jboss.org/message/953302]. It would be nice to add this
capability to the API.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)