/**
   * According to the requirement, correspondingly perform isset, unset or set function.
   *
   * @param frag one string fragment in the path
   * @param path the String representation of path based access
   * @param caller the DataObject that pass path information in
   * @param value the value to be set as the target property's value
   * @param lastSlashIndex the last index of '/' in the path string
   * @param convertValue boolean used for set if we should convert the value
   * @param _case an int value indicating what kind of operation to use: set, isset or unset.
   * @return true if operation is isset and property's value is set, otherwise false.
   */
  private boolean setIsSetUnSet(
      String frag,
      String path,
      DataObject caller,
      Object value,
      int lastSlashIndex,
      boolean convertValue,
      int _case) {
    int indexOfDot = frag.lastIndexOf('.');
    int indexOfOpenBracket = frag.lastIndexOf('[');
    int indexOfCloseBracket = frag.lastIndexOf(']');
    int numInLastProperty =
        getNumberInFrag(frag, indexOfDot, indexOfOpenBracket, indexOfCloseBracket);
    String lastPropertyName =
        getPropertyNameInFrag(
            frag,
            numInLastProperty,
            indexOfDot,
            indexOfOpenBracket); // get last property name on path for case 1
    DataObject lastDataObject;
    if (-1 < lastSlashIndex) {
      Object lastObject =
          get(path.substring(0, lastSlashIndex), caller); // get last dataobject on path
      // If trying to access a list element from a null list, this object will be
      // an instance of ListWrapper, not DataObject, but the error message is the same
      // as if it was a null DataObject
      if (lastObject == null || lastObject instanceof ListWrapper) {
        throw SDOException.cannotPerformOperationOnProperty(lastPropertyName, path);
      }
      lastDataObject = (SDODataObject) lastObject;
    } else {
      lastDataObject = caller;
    }
    Property lastProperty =
        lastDataObject.getInstanceProperty(lastPropertyName); // get property of this dataobject

    switch (_case) {
      case SET:
        if (lastProperty == null) {
          lastProperty =
              ((SDODataObject) lastDataObject).defineOpenContentProperty(lastPropertyName, value);
        }
        if (lastProperty != null) {
          set(lastProperty, lastDataObject, numInLastProperty, value, convertValue);
        }
        return false;
      case ISSET:
        if (lastProperty == null) {
          return false;
        }
        return isSet(lastProperty, lastDataObject);
      case UNSET:
        if (lastProperty == null) {
          return false;
        }
        unSet(lastProperty, lastDataObject, numInLastProperty);
        return false;
      default:
        return false;
    }
  }