use of org.jboss.forge.roaster.model.ValuePair in project kie-wb-common by kiegroup.
the class DefaultJavaRoasterModelAnnotationDriver method buildAnnotation.
@Override
public Annotation buildAnnotation(AnnotationDefinition annotationDefinition, Object annotationToken) throws ModelDriverException {
AnnotationSource javaAnnotationToken = (AnnotationSource) annotationToken;
AnnotationImpl annotation = new AnnotationImpl(annotationDefinition);
if (annotationDefinition.isMarker()) {
return annotation;
} else {
if (javaAnnotationToken.getValues() != null) {
List<ValuePair> values = javaAnnotationToken.getValues();
if (values != null && values.size() > 0) {
for (AnnotationValuePairDefinition valuePairDefinition : annotationDefinition.getValuePairs()) {
Object annotationValue = buildAnnotationValue(javaAnnotationToken, valuePairDefinition);
if (annotationValue != null) {
annotation.setValue(valuePairDefinition.getName(), annotationValue);
}
}
}
}
}
return annotation;
}
Aggregations