@Test(expected = RuntimeException.class) public void customInvalidMethod() throws Exception { class CustomVOIS extends ValidatingObjectInputStream { CustomVOIS(InputStream is) throws IOException { super(is); } @Override protected void invalidClassNameFound(String className) throws InvalidClassException { throw new RuntimeException("Custom exception"); } }; assertSerialization( willClose(new CustomVOIS(testStream)) .reject(Integer.class) ); }
public ValidatingObjectInputStream reject(Class<?>... classes) { for (Class<?> c : classes) { rejectMatchers.add(new FullClassNameMatcher(c.getName())); } return this; }
ValidatingObjectInputStream extends ObjectInputStream { public ValidatingObjectInputStream reject(Class<?>... classes) { for (Class<?> c : classes) { rejectMatchers.add(new FullClassNameMatcher(c.getName())); } return this; } }
ValidatingObjectInputStream extends ObjectInputStream { public ValidatingObjectInputStream reject(Class<?>... classes) { for (Class<?> c : classes) { rejectMatchers.add(new FullClassNameMatcher(c.getName())); } return this; } ValidatingObjectInputStream(InputStream input); }
ValidatingObjectInputStream extends ObjectInputStream { public ValidatingObjectInputStream reject(Class<?>... classes) { for (Class<?> c : classes) { rejectMatchers.add(new FullClassNameMatcher(c.getName())); } return this; } ValidatingObjectInputStream(InputStream input); ValidatingObjectInputStream accept(Class<?>... classes); ValidatingObjectInputStream reject(Class<?>... classes); ValidatingObjectInputStream accept(String... patterns); ValidatingObjectInputStream reject(String... patterns); ValidatingObjectInputStream accept(Pattern pattern); ValidatingObjectInputStream reject(Pattern pattern); ValidatingObjectInputStream accept(ClassNameMatcher m); ValidatingObjectInputStream reject(ClassNameMatcher m); }
ValidatingObjectInputStream extends ObjectInputStream { public ValidatingObjectInputStream reject(Class<?>... classes) { for (Class<?> c : classes) { rejectMatchers.add(new FullClassNameMatcher(c.getName())); } return this; } ValidatingObjectInputStream(InputStream input); ValidatingObjectInputStream accept(Class<?>... classes); ValidatingObjectInputStream reject(Class<?>... classes); ValidatingObjectInputStream accept(String... patterns); ValidatingObjectInputStream reject(String... patterns); ValidatingObjectInputStream accept(Pattern pattern); ValidatingObjectInputStream reject(Pattern pattern); ValidatingObjectInputStream accept(ClassNameMatcher m); ValidatingObjectInputStream reject(ClassNameMatcher m);  }