private static void verifyAttributes(Class<?> clazz,List<Attribute> attributes) throws NoSuchFieldException {
  for (  Attribute attribute : attributes) {
    try {
      clazz.getDeclaredField(attribute.getName());
    }
 catch (    SecurityException e) {
      throw e;
    }
catch (    NoSuchFieldException e) {
      Class<?> superclass=clazz.getSuperclass();
      boolean founded=false;
      while (superclass != Object.class && !founded) {
        try {
          superclass.getDeclaredField(attribute.getName());
          founded=true;
        }
 catch (        NoSuchFieldException e1) {
        }
        superclass=superclass.getSuperclass();
      }
      if (!founded)       throw e;
    }
  }
}

private static void verifyAttributes ( Class < ? > clazz , List < Attribute > attributes ) throws NoSuchFieldException { for ( Attribute attribute : attributes ) { try { clazz . getDeclaredField ( attribute . getName ( ) ) ; } catch ( SecurityException e ) { throw e ; } catch ( NoSuchFieldException e ) { Class < ? > superclass = clazz . getSuperclass ( ) ; boolean founded = false ; while ( superclass != Object . class && ! founded ) { try { superclass . getDeclaredField ( attribute . getName ( ) ) ; founded = true ; } catch ( NoSuchFieldException e1 ) { } superclass = superclass . getSuperclass ( ) ; } if ( ! founded ) throw e ; } } }
this method verifies that the attributes exist in the class .
