@Test public void serialize() { final Serializable obj = Serializable.class.cast(Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(), new Class<?>[]{ValidatorFactory.class}, new LazyValidator(Validation.buildDefaultValidatorFactory()))); final LazyValidator deserialized = LazyValidator.class.cast(Proxy.getInvocationHandler(SerializationUtils.deserialize(SerializationUtils.serialize(obj)))); final Validator validator = deserialized.getValidator(); assertNotNull(validator); }
public Validator getValidator() { ensureDelegate(); return validator; }
LazyValidator implements InvocationHandler, Serializable { public Validator getValidator() { ensureDelegate(); return validator; } }
LazyValidator implements InvocationHandler, Serializable { public Validator getValidator() { ensureDelegate(); return validator; } LazyValidator(final ValidatorFactory factory); }
LazyValidator implements InvocationHandler, Serializable { public Validator getValidator() { ensureDelegate(); return validator; } LazyValidator(final ValidatorFactory factory); @Override Object invoke(final Object proxy, final Method method, final Object[] args); Validator getValidator(); }
LazyValidator implements InvocationHandler, Serializable { public Validator getValidator() { ensureDelegate(); return validator; } LazyValidator(final ValidatorFactory factory); @Override Object invoke(final Object proxy, final Method method, final Object[] args); Validator getValidator();  }