protected void init(Type type, Class<?> objectClass,
      ObjectInspectorFactory.ObjectInspectorOptions options) {
    this.type = type;

    verifyObjectClassType(objectClass);
    this.objectClass = objectClass;
    final List<? extends ObjectInspector> structFieldObjectInspectors = extractFieldObjectInspectors(objectClass, options);

    Field[] reflectionFields = ObjectInspectorUtils
        .getDeclaredNonStaticFields(objectClass);
    synchronized (this) {
      fields = new ArrayList<MyField>(structFieldObjectInspectors.size());
      int used = 0;
      for (int i = 0; i < reflectionFields.length; i++) {
        if (!shouldIgnoreField(reflectionFields[i].getName())) {
          reflectionFields[i].setAccessible(true);
          fields.add(new MyField(i, reflectionFields[i], structFieldObjectInspectors
              .get(used++)));
        }
      }
      assert (fields.size() == structFieldObjectInspectors.size());
      inited = true;
      notifyAll();
    }
  }
This method is only intended to be used by Utilities class in this package.
The reason that this method is not recursive by itself is because we want
to allow recursive types.
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ReflectionStructObjectInspector.java