code: public static Object[] isValidDetail(Geometry geometry, int flag) {        
          if (geometry != null) {            
              if (flag == 0) {
                  return detail(geometry, false);
              } else if (flag == 1) {
                  return detail(geometry, true);
              } else {
                  throw new IllegalArgumentException("Supported arguments is 0 or 1.");
              }
          }
          return null;
      }
docs: Returns a valid_detail as an array of objects
  [0] = isvalid,[1] = reason, [2] = error location
  
  isValid equals true if the geometry is valid.
  reason correponds to an error message describing this error.
  error returns the location of this error (on the {@link Geometry}
  containing the error.
  
  @param geometry
  @param flag
  @return