code: private SchemaType getSchemaType(Class returnType) {
          SchemaType schemaType = null;
          if (XmlObject.class.isAssignableFrom(returnType)) {
              try {
                  Field f = returnType.getField("type");
                  if (SchemaType.class.isAssignableFrom(f.getType()) && Modifier.isStatic(f.getModifiers())) {
                      schemaType = (SchemaType) f.get(null);
                  }
              } catch (NoSuchFieldException x) {
              } catch (IllegalAccessException x) {
              }
          }
          return schemaType;
      }
docs: Get the SchemaType for the specified class.
  
  @param returnType Class to get the SchemaType for.
  @return SchemaType