@Constraints(noNullInputs=true,notMutable=true,noDirectInsertion=true) public static <T>void validateBean(@BoundInputVariable(initializer=true,atMostOnceWithSameParameters=true) T instance,Class<?> clazz) throws FalsePositiveException, IllegalArgumentException {
  Inputs.checkNull(instance,clazz);
  for (  Field f : getAllFieldsToInject(clazz)) {
    f.setAccessible(true);
    try {
      Object obj=f.get(instance);
      if (obj == null) {
        throw new FalsePositiveException("Missing dependency injection for field " + f.getName() + " in class "+ clazz.getName());
      }
    }
 catch (    IllegalAccessException e) {
      logger.warn(e.toString());
    }
  }
  Class<?> parent=clazz.getSuperclass();
  if (parent != null && !parent.equals(Object.class)) {
    validateBean(instance,parent);
  }
}

@ Constraints ( noNullInputs = true , notMutable = true , noDirectInsertion = true ) public static < T > void validateBean ( @ BoundInputVariable ( initializer = true , atMostOnceWithSameParameters = true ) T instance , Class < ? > clazz ) throws FalsePositiveException , IllegalArgumentException { Inputs . checkNull ( instance , clazz ) ; for ( Field f : getAllFieldsToInject ( clazz ) ) { f . setAccessible ( true ) ; try { Object obj = f . get ( instance ) ; if ( obj == null ) { throw new FalsePositiveException ( "Missing dependency injection for field " + f . getName ( ) + " in class " + clazz . getName ( ) ) ; } } catch ( IllegalAccessException e ) { logger . warn ( e . toString ( ) ) ; } } Class < ? > parent = clazz . getSuperclass ( ) ; if ( parent != null && ! parent . equals ( Object . class ) ) { validateBean ( instance , parent ) ; } }
check if all beans that need injection have been properly injected
