code: public static boolean isPublicField(Object obj, String name) {
          Class<?> clazz = obj.getClass();
          try {
              Field f = clazz.getDeclaredField(name);
              return Modifier.isPublic(f.getModifiers());
          }
          catch (NoSuchFieldException e) {
              return false;
          }
      }
docs: Work out if the specified object has a public field with the name supplied.
  
  @param obj
  @param name
  @return true if a public field with the name exists