Class InputDecorator
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.core.io.InputDecorator
- All Implemented Interfaces:
Serializable
Handler class that can be used to decorate input sources.
Typical use is to use a filter abstraction (filtered stream,
reader) around original input source, and apply additional
processing during read operations.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract InputStream
Method called byJsonFactory
instance when creating parser on given "raw" byte source.Method called byJsonFactory
instance when creating parser given anDataInput
, when this decorator has been registered.abstract InputStream
decorate
(IOContext ctxt, InputStream in) Method called byJsonFactory
instance when creating parser given anInputStream
, when this decorator has been registered.abstract Reader
Method called byJsonFactory
instance when creating parser given anReader
, when this decorator has been registered.
-
Constructor Details
-
InputDecorator
public InputDecorator()
-
-
Method Details
-
decorate
Method called byJsonFactory
instance when creating parser given anInputStream
, when this decorator has been registered.- Parameters:
ctxt
- IO context in use (provides access to declared encoding). NOTE: at this point context may not have all information initialized; specifically auto-detected encoding is only available once parsing starts, which may occur only after this method is called.in
- Original input source- Returns:
- InputStream to use; either 'in' as is, or decorator version that typically delogates to 'in'
- Throws:
IOException
- if construction ofInputStream
fails
-
decorate
public abstract InputStream decorate(IOContext ctxt, byte[] src, int offset, int length) throws IOException Method called byJsonFactory
instance when creating parser on given "raw" byte source. Method can either construct aInputStream
for reading; or return null to indicate that no wrapping should occur.- Parameters:
ctxt
- IO context in use (provides access to declared encoding) NOTE: at this point context may not have all information initialized; specifically auto-detected encoding is only available once parsing starts, which may occur only after this method is called.src
- Input buffer that contains contents to parseoffset
- Offset of the first available byte in the input bufferlength
- Number of bytes available in the input buffer- Returns:
- Either
InputStream
to use as input source; or null to indicate that contents are to be processed as-is by caller - Throws:
IOException
- if construction ofInputStream
fails
-
decorate
Method called byJsonFactory
instance when creating parser given anDataInput
, when this decorator has been registered.Default implementation simply throws
UnsupportedOperationException
- Parameters:
ctxt
- IO context in use (provides access to declared encoding). NOTE: at this point context may not have all information initialized; specifically auto-detected encoding is only available once parsing starts, which may occur only after this method is called.input
- Original input source- Returns:
- InputStream to use; either 'input' as is, or decorator version that typically delogates to 'input'
- Throws:
IOException
- if construction ofDataInput
fails- Since:
- 2.8
-
decorate
Method called byJsonFactory
instance when creating parser given anReader
, when this decorator has been registered.- Parameters:
ctxt
- IO context in use (provides access to declared encoding) NOTE: at this point context may not have all information initialized; specifically auto-detected encoding is only available once parsing starts, which may occur only after this method is called.r
- Original reader- Returns:
- Reader to use; either passed in argument, or something that
calls it (for example, a
FilterReader
) - Throws:
IOException
- if construction ofReader
fails
-