JAL-3063 tweak schema so JAXB generates enums for enumerated values
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 18 Sep 2018 15:00:20 +0000 (16:00 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 18 Sep 2018 15:00:20 +0000 (16:00 +0100)
schemas/JalviewUserColours.xsd

index 3934d66..73e6aff 100755 (executable)
                                        <xs:attribute name="RGB" type="xs:string" use="required"/>
                                        <xs:attribute name="minRGB" type="xs:string" use="optional"/>
                                        <xs:attribute name="noValueColour" use="optional" type="jalview:NoValueColour" default="Min" />
-                                       <xs:attribute name="threshType" use="optional">
-                                               <xs:simpleType> 
-                                                       <xs:restriction base="xs:string">
-                                                     <xs:enumeration value="NONE" />
-                                                     <xs:enumeration value="ABOVE" />
-                                                     <xs:enumeration value="BELOW" />
-                                                   </xs:restriction>   
-                                           </xs:simpleType> 
-                                       </xs:attribute>
+                                       <xs:attribute name="threshType" use="optional" type="jalview:ThresholdType" />
                                        <xs:attribute name="threshold" type="xs:float" use="optional"/>
                                        <xs:attribute name="max" type="xs:float" use="optional"/>
                                        <xs:attribute name="min" type="xs:float" use="optional"/>
            <xs:element name="condition" type="xs:string" /> 
            <xs:element name="value" type="xs:string" /> 
          </xs:sequence>
-         <xs:attribute name="by">
-               <xs:simpleType> 
-                       <xs:restriction base="xs:string">
-                     <xs:enumeration value="byLabel" />
-                     <xs:enumeration value="byScore" />
-                     <xs:enumeration value="byAttribute" />
-                   </xs:restriction>   
-           </xs:simpleType> 
-         </xs:attribute> 
-       </xs:complexType> 
+         <xs:attribute name="by" type="jalview:FilterBy" />
+       </xs:complexType>
+
+       <xs:simpleType name="ThresholdType">
+               <xs:annotation>
+                       <xs:documentation>Whether filter has a threshold, and if so is it
+                               above or below
+                       </xs:documentation>
+               </xs:annotation>
+               <xs:restriction base="xs:string">
+                       <xs:enumeration value="NONE" />
+                       <xs:enumeration value="ABOVE" />
+                       <xs:enumeration value="BELOW" />
+               </xs:restriction>
+       </xs:simpleType>
+       
+       <xs:simpleType name="FilterBy">
+               <xs:annotation>
+                       <xs:documentation>Filter may apply to label, score or some feature attribute</xs:documentation>
+               </xs:annotation>
+               <xs:restriction base="xs:string">
+             <xs:enumeration value="byLabel" />
+             <xs:enumeration value="byScore" />
+             <xs:enumeration value="byAttribute" />
+           </xs:restriction>   
+       </xs:simpleType>
        
        <xs:simpleType name="NoValueColour">
                <xs:annotation>