Element     groupTypesMetaData  = _getImmediateElement(e, "groupTypesMetaData"); Collection  groupTypes          = _getImmediateElements(groupTypesMetaData, "groupTypeDef");
Element     groupTypesMetaData  = this._getImmediateElement(e, "groupTypesMetaData"); Collection  groupTypes          = this._getImmediateElements(groupTypesMetaData, "groupTypeDef");
  private void _processMetaData(Element e)     throws  InsufficientPrivilegeException,            SchemaException  {    if (!_optionTrue("import.metadata.group-types") || e == null) {      return;    }    LOG.debug("import.metadata.group-types=true - loading group-types");    Element     groupTypesMetaData  = _getImmediateElement(e, "groupTypesMetaData");    Collection  groupTypes          = _getImmediateElements(groupTypesMetaData, "groupTypeDef");    Iterator    groupTypesIterator  = groupTypes.iterator();    Element     groupType;    GroupType   grouperGroupType;    Collection  fields;    Iterator    fieldsIterator;    Field       grouperField;    Element     field;    String      groupTypeName;    String      fieldName;    String      readPriv;    String      writePriv;    String      fieldType;    boolean     required;    boolean     isNew               = false;    while (groupTypesIterator.hasNext()) {      isNew         = false;      groupType     = (Element) groupTypesIterator.next();      groupTypeName = groupType.getAttribute("name");      try {        grouperGroupType = GroupTypeFinder.find(groupTypeName);        LOG.debug("Found existing GroupType - " + groupTypeName);      }       catch (SchemaException ex) {        grouperGroupType  = GroupType.createType(s, groupTypeName);        isNew             = true;        LOG.debug("Found and created new GroupType - " + groupTypeName);      }      fields = _getImmediateElements(groupType, "field");      if (fields.size() > 0) {        LOG.debug("import.metadata.group-type-attributes=true");      }      fieldsIterator = fields.iterator();      while (fieldsIterator.hasNext()) {        field     = (Element) fieldsIterator.next();        fieldName = field.getAttribute("name");        fieldType = field.getAttribute("type");        required  = "true".equals(field.getAttribute("required"));        readPriv  = field.getAttribute("readPriv");        writePriv = field.getAttribute("writePriv");        try {          grouperField = FieldFinder.find(fieldName);          LOG.debug("Found existing Field - " + fieldName);        }         catch (SchemaException ex) {          grouperField = null;        }        if (          (isNew || _optionTrue("import.metadata.group-type-attributes"))          && grouperField == null        )         {          LOG.debug("Found new Field - "  + fieldName + " - now adding");          LOG.debug("Field Type="         + fieldType);          LOG.debug("Field readPriv="     + readPriv);          LOG.debug("Field writePriv="    + writePriv);          LOG.debug("Field required="     + required);          if (fieldType.equals("list")) {            grouperGroupType.addList(              s, fieldName,               Privilege.getInstance(readPriv),               Privilege.getInstance(writePriv)            );          }           else if (fieldType.equals("attribute")) {            grouperGroupType.addAttribute(              s, fieldName,               Privilege.getInstance(readPriv),               Privilege.getInstance(writePriv), required            );          }           else {          }        }      }    }    LOG.debug("Finished processing group types and fields");  } // private void _processMetaData(e)