Hi.
> I am writing a plugin to get at the element documentation (the get method
> javadoc). So that I can use this as a default title for GUI components in my
> JSF pages. I have written a plugin to get the javadoc and write the method.
Might be a bug, try tracing how documentation is read from the schema.
In any case you must have access to XSComponent from the property and
you can get your annotations from there.
I have few comments for you:
* You're creating a new subclass for your "GetLabel"-enabled fields. I
don't think it is a good design decision. You'll have to create
subclasses for all field classes out there. Essentially, you don't
need this: better iterate over outline/class outlines/field outlines
and generate additional getters, you don't need special field
subclasses for this. This will be much simpler.
* Direct statements in code model are evil. Code model was especially
developed to produce the code programmatically. Try something like
method.body()._return(JExpr.lit(label)).
* You can have special-purpose XML customization for your plugin.
Imagine something like:
<xs:element ref="SET:VESSDAT" minOccurs="0">
<xs:annotation>
<xs:appInfo><my:label>Hello World</my:label></xs:appInfo>
</xs:annotation>
</xs:element>
Instead of misusing xs:documentation for your custom purposes.
See this plugin for example:
https://jaxb2-commons.dev.java.net/source/browse/jaxb2-commons/annotate/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/AnnotatePlugin.java
Bye.
/lexi