cancel
Showing results for 
Search instead for 
Did you mean: 

Bean generation with custom annotations

pgaeckle
Discoverer
0 Kudos

I have generated an extension and wrote some functionality to leverage exporting of data.
The export functionality is based on custom annotations.

The objects' classes to be exported are generated via extension-beans.xml.
So the bean definition looks like this

<bean class="path.to.my.Bean">
<import type="path.to.my.custom.Annotation1" />
<import type="path.to.my.custom.Annotation2"/>
<annotations>@Annotation1(value = "somevalue")</annotations>
<property name="field1" type="String">
<annotations>@Annotation2(value = "somevalue")</annotations>
</property>
<property name="field2" type="String">
<annotations>@Annotation1(value = "someothervalue")</annotations>
</property><br></bean>

The extension where the bean is defined has `<requires-extension name="myextension" />` in its extensioninfo.xml defined and this seems to work.

When running ant all now I get an error with @Annotation1 cannot be resolved to a type.

Question now is, how can I get my custom annotations to be recognized by the generated classes.

Additionally, this is one of my custom annotations

@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Annotation1 {
String value(); }


I'm running v2105.15 with Java 11

Accepted Solutions (0)

Answers (0)