castor
  1. castor
  2. CASTOR-1137

Special characters ("+", "-", "*") in Enumeration not Generated Correctly from Schema

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.6, 1.0, 1.0.1, 1.0.2, 1.0.3
    • Fix Version/s: 1.0.4
    • Component/s: XML code generator
    • Labels:
      None
    • Number of attachments :
      0

      Description

      <xsd:simpleType name="FormulaOperatorDataType">
      <xsd:restriction base="xsd:string">
      <xsd:enumeration value="-"/>
      <xsd:enumeration value="+"/>
      <xsd:enumeration value="*"/>
      </xsd:restriction>
      </xsd:simpleType>

      The above snippet of an XML Schema will not be generated correctly when you try to generate classes. The below code snippets result:
      /**

      • The * type
        */
        public static final int __TYPE = 2;

      /**

      • The instance of the * type
        */
        public static final FormulaOperatorDataType _ = new FormulaOperatorDataType(__TYPE, "*");

      ...

      private static java.util.Hashtable init()
      {
      Hashtable members = new Hashtable();
      members.put("-", _);
      return members;
      } //-- java.util.Hashtable init()

        Issue Links

          Activity

          Werner Guttmann logged work - 09/Oct/06 8:19 AM
          • Time Spent:
            30 minutes
             
            Fix creation & testing.
          Werner Guttmann logged work - 09/Oct/06 8:20 AM
          • Time Spent:
            35 minutes
             
            Refactoring of SourceFactory, moving several methods related to processing of enumerations to new EnumerationFactory class.

            People

            • Assignee:
              Werner Guttmann
              Reporter:
              Chuck Betts
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour, 30 minutes
                1h 30m
                Remaining:
                Time Spent - 1 hour, 5 minutes Remaining Estimate - 25 minutes
                25m
                Logged:
                Time Spent - 1 hour, 5 minutes Remaining Estimate - 25 minutes
                1h 5m