public static class ValidatingObjectInputStream.Builder extends AbstractStreamBuilder<ValidatingObjectInputStream,ValidatingObjectInputStream.Builder>
ValidatingObjectInputStream.
ValidatingObjectInputStream s = ValidatingObjectInputStream.builder()
.setPath(Paths.get("MyFile.ser"))
.get();
ValidatingObjectInputStream s = ValidatingObjectInputStream.builder()
.setFile(new File("MyFile.ser"))
.get();
get()| Modifier and Type | Method and Description |
|---|---|
ValidatingObjectInputStream.Builder |
accept(Class<?>... classes)
Accepts the specified classes for deserialization, unless they are otherwise rejected.
|
ValidatingObjectInputStream.Builder |
accept(ClassNameMatcher matcher)
Accepts class names where the supplied ClassNameMatcher matches for deserialization, unless they are otherwise rejected.
|
ValidatingObjectInputStream.Builder |
accept(Pattern pattern)
Accepts class names that match the supplied pattern for deserialization, unless they are otherwise rejected.
|
ValidatingObjectInputStream.Builder |
accept(String... patterns)
Accepts the wildcard specified classes for deserialization, unless they are otherwise rejected.
|
ValidatingObjectInputStream |
get()
Builds a new
ValidatingObjectInputStream. |
ObjectStreamClassPredicate |
getPredicate()
Gets the predicate.
|
ValidatingObjectInputStream.Builder |
reject(Class<?>... classes)
Rejects the specified classes for deserialization, even if they are otherwise accepted.
|
ValidatingObjectInputStream.Builder |
reject(ClassNameMatcher matcher)
Rejects class names where the supplied ClassNameMatcher matches for deserialization, even if they are otherwise accepted.
|
ValidatingObjectInputStream.Builder |
reject(Pattern pattern)
Rejects class names that match the supplied pattern for deserialization, even if they are otherwise accepted.
|
ValidatingObjectInputStream.Builder |
reject(String... patterns)
Rejects the wildcard specified classes for deserialization, even if they are otherwise accepted.
|
ValidatingObjectInputStream.Builder |
setPredicate(ObjectStreamClassPredicate predicate)
Sets the predicate, null resets to an empty new ObjectStreamClassPredicate.
|
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptionscheckOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newRandomAccessFileOrigin, newRandomAccessFileOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterasThisclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasSupplier, getUncheckedpublic ValidatingObjectInputStream.Builder accept(Class<?>... classes)
classes - Classes to acceptpublic ValidatingObjectInputStream.Builder accept(ClassNameMatcher matcher)
matcher - a class name matcher to accept objects.public ValidatingObjectInputStream.Builder accept(Pattern pattern)
pattern - a Pattern for compiled regular expression.public ValidatingObjectInputStream.Builder accept(String... patterns)
patterns - Wildcard file name patterns as defined by FilenameUtils.wildcardMatchpublic ValidatingObjectInputStream get() throws IOException
ValidatingObjectInputStream.
You must set an aspect that supports AbstractStreamBuilder.getInputStream() on this builder, otherwise, this method throws an exception.
This builder uses the following aspects:
AbstractStreamBuilder.getInputStream() gets the target aspect.UnsupportedOperationException - if the origin cannot provide a InputStream.IOException - if an I/O error occurs converting to an InputStream using AbstractStreamBuilder.getInputStream().AbstractStreamBuilder.getWriter(),
IOSupplier.getUnchecked()public ObjectStreamClassPredicate getPredicate()
public ValidatingObjectInputStream.Builder reject(Class<?>... classes)
classes - Classes to rejectpublic ValidatingObjectInputStream.Builder reject(ClassNameMatcher matcher)
matcher - the matcher to usepublic ValidatingObjectInputStream.Builder reject(Pattern pattern)
pattern - standard Java regexppublic ValidatingObjectInputStream.Builder reject(String... patterns)
patterns - Wildcard file name patterns as defined by FilenameUtils.wildcardMatchpublic ValidatingObjectInputStream.Builder setPredicate(ObjectStreamClassPredicate predicate)
predicate - the predicate.