Validator validator = new Validator(); validator.setResolver(mResolver); validator.validate(object);
if (object == null) { throw new ValidationException("cannot validate a null Object."); }  MarshalInfoResolver mResolver = _mResolver; if (mResolver == null) mResolver = new CachingMarshalInfoResolver();  MarshalInfo mInfo = mResolver.resolve(object.getClass());  ValidationRule[] rules = mInfo.getValidationRules();  if (rules != null) { for (int i = 0; i < rules.length; i++) validate(object, rules[i], mInfo); }
    public static void validate(Object object, MarshalInfoResolver mResolver)         throws ValidationException    {        Validator validator = new Validator();        validator.setResolver(mResolver);        validator.validate(object);    } //-- validate