code: private void addField(int fieldIndex, XmlSchemaObjectBase xsdSchemaObject,
              Map < String, Object > fields, RootCompositeType compositeTypes) {
          if (xsdSchemaObject instanceof XmlSchemaElement) {
              XmlSchemaElement xsdElement = (XmlSchemaElement) xsdSchemaObject;
              fields.put(getFieldName(xsdElement),
                      getProps(fieldIndex, xsdElement, compositeTypes));
          } else if (xsdSchemaObject instanceof XmlSchemaChoice) {
              XmlSchemaChoice xsdChoice = (XmlSchemaChoice) xsdSchemaObject;
              fields.put(getFieldName(xsdChoice),
                      getProps(fieldIndex, xsdChoice, compositeTypes));
          }
          // TODO Add Groups
      }
docs: Add a field with associated properties to a complex type.
  
  @param index the order of the field in the parent complex type
  @param xsdSchemaObject the potential field
  @param xsdSchemaObject the potential field
  @param fields the parent complex type's fields collection
  @param compositeTypes the lists of composite types being populated