public void validate(@NonNull Object object,@NonNull ExclusionStrategy exclusionStrategy) throws RaveException {
  Class<?> clazz=object.getClass();
  Validated validated=clazz.getAnnotation(Validated.class);
  BaseValidator validator;
synchronized (this) {
    if (validated == null && !unannotatedModelValidator.hasSeen(clazz)) {
      unannotatedModelValidator.processNonAnnotatedClasses(clazz);
    }
    validator=classValidatorMap.get(clazz);
    if (validator == null) {
      validator=getValidatorInstance(clazz);
    }
    if (validator == null) {
      throw new UnsupportedObjectException(Collections.singletonList(new RaveError(clazz,"",RaveErrorStrings.CLASS_NOT_SUPPORTED_ERROR)));
    }
  }
  validator.validate(object,exclusionStrategy);
}

public void validate ( @ NonNull Object object , @ NonNull ExclusionStrategy exclusionStrategy ) throws RaveException { Class < ? > clazz = object . getClass ( ) ; Validated validated = clazz . getAnnotation ( Validated . class ) ; BaseValidator validator ; synchronized ( this ) { if ( validated == null && ! unannotatedModelValidator . hasSeen ( clazz ) ) { unannotatedModelValidator . processNonAnnotatedClasses ( clazz ) ; } validator = classValidatorMap . get ( clazz ) ; if ( validator == null ) { validator = getValidatorInstance ( clazz ) ; } if ( validator == null ) { throw new UnsupportedObjectException ( Collections . singletonList ( new RaveError ( clazz , "" , RaveErrorStrings . CLASS_NOT_SUPPORTED_ERROR ) ) ) ; } } validator . validate ( object , exclusionStrategy ) ; }
validate an object . if the object is not supported , nothing will happen . otherwise the object will be routed to the correct sub - validator which knows how to validate it .
