private Method findFromStringMethod(Class<?> cls,boolean searchSuperclasses){
  Method matched=null;
  Class<?> loopCls=cls;
  while (loopCls != null && matched == null) {
    Method[] methods=loopCls.getDeclaredMethods();
    for (    Method method : methods) {
      FromString fromString=method.getAnnotation(FromString.class);
      if (fromString != null) {
        if (matched != null) {
          throw new IllegalStateException("Two methods are annotated with @ToString");
        }
        matched=method;
      }
    }
    if (searchSuperclasses == false) {
      break;
    }
    loopCls=loopCls.getSuperclass();
  }
  return matched;
}

private Method findFromStringMethod ( Class < ? > cls , boolean searchSuperclasses ) { Method matched = null ; Class < ? > loopCls = cls ; while ( loopCls != null && matched == null ) { Method [ ] methods = loopCls . getDeclaredMethods ( ) ; for ( Method method : methods ) { FromString fromString = method . getAnnotation ( FromString . class ) ; if ( fromString != null ) { if ( matched != null ) { throw new IllegalStateException ( "Two methods are annotated with @ToString" ) ; } matched = method ; } } if ( searchSuperclasses == false ) { break ; } loopCls = loopCls . getSuperclass ( ) ; } return matched ; }
finds the conversion method .
