Top Description Inners Fields Constructors Methods
org.keycloak.util

public Class SystemPropertiesJsonParserFactory

extends MappingJsonFactory
Class Inheritance
Imports
com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.core.io.IOContext, com.fasterxml.jackson.core.util.JsonParserDelegate, com.fasterxml.jackson.databind.MappingJsonFactory, org.keycloak.common.util.StringPropertyReplacer, .SystemEnvProperties, java.io.IOException, .InputStream, .Reader, java.util.Properties

Provides replacing of system properties for parsed values
Author
Marek Posolda

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final Properties

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected JsonParser
_createParser(InputStream
InputStream to use for reading content to parse
in
,
IOContext
I/O context to use for parsing
ctxt
)

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates desired parser given InputStream and context object.
protected JsonParser
_createParser(Reader
Reader to use for reading content to parse
r
,
IOContext
I/O context to use for parsing
ctxt
)

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given Reader object for reading content.
protected JsonParser
_createParser(char[]
Buffer that contains content to parse
data
,
int
Offset to the first character of data to parse
offset
,
int
Number of characters within buffer to parse
len
,
IOContext
I/O context to use for parsing
ctxt
,
boolean
Whether input buffer is recycled by the factory
recyclable
)

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given char[] object for accessing content.
protected JsonParser
_createParser(byte[]
Buffer that contains content to parse
data
,
int
Offset to the first character of data to parse
offset
,
int
Number of characters within buffer to parse
len
,
IOContext
I/O context to use for parsing
ctxt
)

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given Reader object for reading content passed as raw byte array.
Inherited from com.fasterxml.jackson.databind.MappingJsonFactory:
copygetCodecgetFormatNamehasFormat

Field Detail

propertiesback to summary
private static final Properties properties

Constructor Detail

SystemPropertiesJsonParserFactoryback to summary
public SystemPropertiesJsonParserFactory()

Method Detail

_createParserback to summary
protected JsonParser _createParser(InputStream in, IOContext ctxt) throws IOException

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Doc from com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates desired parser given InputStream and context object.

This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.

Parameters
in:InputStream

InputStream to use for reading content to parse

ctxt:IOContext

I/O context to use for parsing

Returns:JsonParser

Parser constructed

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (read) problem
_createParserback to summary
protected JsonParser _createParser(Reader r, IOContext ctxt) throws IOException

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Doc from com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given Reader object for reading content.

This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.

Parameters
r:Reader

Reader to use for reading content to parse

ctxt:IOContext

I/O context to use for parsing

Returns:JsonParser

Actual parser to use

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (read) problem
_createParserback to summary
protected JsonParser _createParser(char[] data, int offset, int len, IOContext ctxt, boolean recyclable) throws IOException

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Doc from com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given char[] object for accessing content.

Parameters
data:char[]

Buffer that contains content to parse

offset:int

Offset to the first character of data to parse

len:int

Number of characters within buffer to parse

ctxt:IOContext

I/O context to use for parsing

recyclable:boolean

Whether input buffer is recycled by the factory

Returns:JsonParser

Actual parser to use

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (read) problem
_createParserback to summary
protected JsonParser _createParser(byte[] data, int offset, int len, IOContext ctxt) throws IOException

Overrides com.fasterxml.jackson.core.JsonFactory._createParser.

Doc from com.fasterxml.jackson.core.JsonFactory._createParser.

Overridable factory method that actually instantiates parser using given Reader object for reading content passed as raw byte array.

This method is specifically designed to remain compatible between minor versions so that sub-classes can count on it being called as expected. That is, it is part of official interface from sub-class perspective, although not a public method available to users of factory implementations.

Parameters
data:byte[]

Buffer that contains content to parse

offset:int

Offset to the first character of data to parse

len:int

Number of characters within buffer to parse

ctxt:IOContext

I/O context to use for parsing

Returns:JsonParser

Actual parser to use

Annotations
@Override
Exceptions
IOException:
if parser initialization fails due to I/O (read) problem
org.keycloak.util back to summary

public Class SystemPropertiesJsonParserFactory.SystemPropertiesAwareJsonParser

extends JsonParserDelegate
Class Inheritance

Field Summary

Inherited from com.fasterxml.jackson.core.util.JsonParserDelegate:
delegate

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getText()

Overrides com.fasterxml.jackson.core.util.JsonParserDelegate.getText.

Method for accessing textual representation of the current token; if no current token (before first call to nextToken, or after encountering end-of-input), returns null.
Inherited from com.fasterxml.jackson.core.util.JsonParserDelegate:
assignCurrentValuecanReadObjectIdcanReadTypeIdcanUseSchemaclearCurrentTokenclosecurrentLocationcurrentNamecurrentTokencurrentTokenIdcurrentTokenLocationcurrentValuedelegatedisableenablefinishTokengetBigIntegerValuegetBinaryValuegetBooleanValuegetByteValuegetCodecgetCurrentLocationgetCurrentNamegetCurrentTokengetCurrentTokenIdgetCurrentValuegetDecimalValuegetDoubleValuegetEmbeddedObjectgetFeatureMaskgetFloatValuegetInputSourcegetIntValuegetLastClearedTokengetLongValuegetNumberTypegetNumberValuegetNumberValueDeferredgetNumberValueExactgetObjectIdgetParsingContextgetReadCapabilitiesgetSchemagetShortValuegetTextgetTextCharactersgetTextLengthgetTextOffsetgetTokenLocationgetTypeIdgetValueAsBooleangetValueAsBooleangetValueAsDoublegetValueAsDoublegetValueAsIntgetValueAsIntgetValueAsLonggetValueAsLonggetValueAsStringgetValueAsStringhasCurrentTokenhasTextCharactershasTokenhasTokenIdisClosedisEnabledisExpectedNumberIntTokenisExpectedStartArrayTokenisExpectedStartObjectTokenisNaNnextTokennextValueoverrideCurrentNameoverrideFormatFeaturesoverrideStdFeaturesreadBinaryValuerequiresCustomCodecsetCodecsetCurrentValuesetFeatureMasksetSchemaskipChildrenstreamReadConstraintsversion

Constructor Detail

SystemPropertiesAwareJsonParserback to summary
public SystemPropertiesAwareJsonParser(JsonParser d)

Method Detail

getTextback to summary
public String getText() throws IOException

Overrides com.fasterxml.jackson.core.util.JsonParserDelegate.getText.

Doc from com.fasterxml.jackson.core.JsonParser.getText.

Method for accessing textual representation of the current token; if no current token (before first call to nextToken, or after encountering end-of-input), returns null. Method can be called for any token type.

Returns:String

Textual value associated with the current token (one returned by nextToken() or other iteration methods)

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems, including if the text is too large, see com.fasterxml.jackson.core.StreamReadConstraints.Builder#maxStringLength(int)