users@jaxb.java.net

Re: xjc plugin: How to access enumeration value jxb:javadoc bindings?

From: Peter Lynch <peterlynch_at_pub.missioncap.ca>
Date: Wed, 31 Jan 2007 23:10:45 -0400

I am trying to add jxb:javadoc in my xsd and have that carry through to the
enumeration values. I know there is an RFE open for this already but...

this is what I got so far

<xs:simpleType name="FaultCodeCoreType">
     <xs:restriction base="xs:string">
       <xs:enumeration value="ERROR1">
         <xs:annotation>
           <xs:appinfo>
             <jxb:property>
                <jxb:javadoc>
             Please add this to the javadoc of the enum
                <jxb:javadoc>
             </jxb:property>
           </xs:appinfo>
         </xs:annotation>
       </xs:enumeration>
</xs:restriction>
<xs:simpleType>

in my plugin run method I started with

for (EnumOutline enumOutline : outline.getEnums()) {
             List<EnumConstantOutline> enumConstOutline = enumOutline.constants;
             for (EnumConstantOutline constOutline : enumConstOutline) {

                 JEnumConstant constRef = constOutline.constRef;
                 JDocComment docComment = constRef.javadoc();
        
                // how to get the binding information to add the javadoc to the docComment
model????

             }
         }

Any pointers to get the jxb elements javadoc out of the xsd as I find an enum?

I see for outline.getClasses() you can have customizations - but alas these are
  classes not Enums and I see no api to have customizations for enums.

-Peter


Aleksei Valikov wrote:
> Hi.
>
>> I noticed that passing javadoc from xsd jxb:javadoc tags to
>> enumeration values is currently not supported by xjc ( at least it
>> doesn't work for me). This led me to try writing a plugin that would
>> do it.
>>
>> Problem I am having is that I'm stuck trying to get easy access to the
>> jxb:javadoc binding text in my binding file.
>>
>> How do I access the binding info directly to get the text I specify
>> there so that I can insert it into the javadoc for each enum?
>
> I don't know if it helps? but there's "javadoc" field in CPropertyInfo.
> What are you up to? Could you post an example, maybe one of us could help.
>
> Bye.
> /lexi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>