code: public static Object extract(Object target, String key, String delimeter)
      {
          if (target == null)
          {
              return target;
          }
  
          String keyHead = extractKeyHead(key, delimeter); // the return value of keyHead 
          String keyTail = extractKeyTail(key, delimeter); // the return value of keyTail 
  
          Object innerObject = null;
  
          // checking if the "Object: target" is Map or not
          if (target instanceof Map)
          {
              Map<?, ?> targetMap = (Map<?, ?>) target;
              innerObject = targetMap.get(keyHead); // get the object inside "keyHead"
          }
          else
          {
              BeanWrapperImpl baseWapper = new BeanWrapperImpl(target); // this is the reflection for getting the field value.
              innerObject = baseWapper.getPropertyValue(keyHead); // get the value from the field if the "keyHead" is not Map
          }
  
          if (innerObject == null)
          {
              return innerObject;
          }
  
          if (StringUtils.isEmpty(keyTail) == true)
          {
              return innerObject;
          }
          else
          {
              return extract(innerObject, keyTail, delimeter); // recursive method for calling self function again.
          }
      }
docs: Extract field
  
  @param target is used to get object data.
  @param key is used to get key value.
  @param delimeter key delimeter
  @return is used to return object data.