Class JavaPropsFactory.ReadConstrainedReader
java.lang.Object
java.io.Reader
com.fasterxml.jackson.dataformat.javaprop.JavaPropsFactory.ReadConstrainedReader
- All Implemented Interfaces:
Closeable, AutoCloseable, Readable
- Enclosing class:
JavaPropsFactory
Reader decorator that enforces
StreamReadConstraints.getMaxDocumentLength() by counting characters
read through it. Needed since actual decoding is done by
Properties.load(Reader), reading content directly from
a Reader, so the parser itself does not see input as it is consumed.
Only installed when constraints define a maximum document length
(see StreamReadConstraints.hasMaxDocumentLength()).
- Since:
- 2.18.11
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longTotal number of characters read (or skipped) so far.private final com.fasterxml.jackson.core.StreamReadConstraintsprivate final Reader -
Constructor Summary
ConstructorsConstructorDescriptionReadConstrainedReader(Reader delegate, com.fasterxml.jackson.core.StreamReadConstraints constraints) -
Method Summary
Methods inherited from class Reader
mark, markSupported, nullReader, of, read, read, readAllAsString, readAllLines, reset, transferTo
-
Field Details
-
_delegate
-
_constraints
private final com.fasterxml.jackson.core.StreamReadConstraints _constraints -
_charsRead
private long _charsReadTotal number of characters read (or skipped) so far.
-
-
Constructor Details
-
ReadConstrainedReader
public ReadConstrainedReader(Reader delegate, com.fasterxml.jackson.core.StreamReadConstraints constraints)
-
-
Method Details
-
_count
private void _count(long n) throws com.fasterxml.jackson.core.exc.StreamConstraintsException - Throws:
com.fasterxml.jackson.core.exc.StreamConstraintsException
-
read
- Overrides:
readin classReader- Throws:
IOException
-
read
- Specified by:
readin classReader- Throws:
IOException
-
skip
- Overrides:
skipin classReader- Throws:
IOException
-
ready
- Overrides:
readyin classReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-