public boolean equals(Annotation left,Annotation right) throws Exception {
  Class type=left.annotationType();
  Class expect=right.annotationType();
  Method[] list=type.getDeclaredMethods();
  if (type.equals(expect)) {
    for (    Method method : list) {
      if (!isIgnore(method)) {
        Object value=method.invoke(left);
        Object other=method.invoke(right);
        if (!value.equals(other)) {
          return false;
        }
      }
    }
    return true;
  }
  return false;
}

public boolean equals ( Annotation left , Annotation right ) throws Exception { Class type = left . annotationType ( ) ; Class expect = right . annotationType ( ) ; Method [ ] list = type . getDeclaredMethods ( ) ; if ( type . equals ( expect ) ) { for ( Method method : list ) { if ( ! isIgnore ( method ) ) { Object value = method . invoke ( left ) ; Object other = method . invoke ( right ) ; if ( ! value . equals ( other ) ) { return false ; } } } return true ; } return false ; }
this is used to determine if two annotations are equals based on the attributes of the annotation . the comparison done can ignore specific attributes , for instance the name attribute .
