code: public static Object getProperty(Object object, String name) throws NoSuchFieldException {
          try {
              Matcher matcher = ARRAY_INDEX.matcher(name);
              if (matcher.matches()) {
                  object = getProperty(object, matcher.group(1));
                  if (object.getClass().isArray()) {
                      return Array.get(object, Integer.parseInt(matcher.group(2)));
                  } else {
                      return ((List)object).get(Integer.parseInt(matcher.group(2)));
                  }
              } else {
                  int dot = name.lastIndexOf('.');
                  if (dot > 0) {
                      object = getProperty(object, name.substring(0, dot));
                      name = name.substring(dot + 1);
                  }
                  return Beans.getKnownField(object.getClass(), name).get(object);
              }
          } catch (NoSuchFieldException x) {
              throw x;
          } catch (Exception x) {
              throw new IllegalArgumentException(x.getMessage() + ": " + name, x);
          }
      }
docs: Reports a property.
  
  @param object the target object
  @param name a dot-separated path to the property
  @return the property value
  @throws NoSuchFieldException if the property is not found