public final class LoadingConfigurationBuilder extends Object implements Thawed<LoadingConfiguration>
LoadingConfiguration
Modifier and Type | Method and Description |
---|---|
LoadingConfigurationBuilder |
addParserFeature(JsonParser.Feature feature)
Add a JsonParser feature
|
LoadingConfigurationBuilder |
addScheme(String scheme,
URIDownloader downloader)
Add a new URI downloader
|
LoadingConfigurationBuilder |
dereferencing(Dereferencing dereferencing)
Set the dereferencing mode for this loading configuration
|
LoadingConfiguration |
freeze()
Freeze this configuration
|
LoadingConfigurationBuilder |
preloadSchema(JsonNode schema)
Preload a schema
|
LoadingConfigurationBuilder |
preloadSchema(String uri,
JsonNode schema)
Preload a schema at a given URI
|
LoadingConfigurationBuilder |
removeParserFeature(JsonParser.Feature feature)
Remove a JSON parser feature
|
LoadingConfigurationBuilder |
removeScheme(String scheme)
Remove a downloader for a given scheme
|
LoadingConfigurationBuilder |
setCacheSize(int cacheSize)
How many schemas should be cached
|
LoadingConfigurationBuilder |
setEnableCache(boolean enableCache)
Deprecated.
Just for backward compatibility
Use cacheSize setter instead to set the maximum size of the cache
Note that this does not affect preloaded schemas |
LoadingConfigurationBuilder |
setURITranslatorConfiguration(URITranslatorConfiguration translatorCfg) |
@Deprecated public LoadingConfigurationBuilder setEnableCache(boolean enableCache)
Note that this does not affect preloaded schemas
enableCache
- if loaded schemas have to be cachedpublic LoadingConfigurationBuilder setCacheSize(int cacheSize)
Note setting to zero effectively disables the cache
Note settting to -1 creates an unlimited cache
Note that this does not affect preloaded schemas
cacheSize
- if loaded schemas have to be cachedpublic LoadingConfigurationBuilder addScheme(String scheme, URIDownloader downloader)
scheme
- the schemedownloader
- the downloaderNullPointerException
- scheme or downloader is nullIllegalArgumentException
- illegal schemepublic LoadingConfigurationBuilder removeScheme(String scheme)
scheme
- the schemepublic LoadingConfigurationBuilder setURITranslatorConfiguration(URITranslatorConfiguration translatorCfg)
public LoadingConfigurationBuilder dereferencing(Dereferencing dereferencing)
By default, it is Dereferencing.CANONICAL
.
dereferencing
- the dereferencing modeNullPointerException
- dereferencing mode is nullpublic LoadingConfigurationBuilder preloadSchema(String uri, JsonNode schema)
Use this if the schema you wish to preload does not have an absolute
id
at the top level.
Note that the syntax of the schema is not checked at this stage.
uri
- the URI to useschema
- the schemaNullPointerException
- the URI or schema is nullIllegalArgumentException
- a schema already exists at this URIJsonRef
public LoadingConfigurationBuilder preloadSchema(JsonNode schema)
Use this if the schema already has an absolute id
.
schema
- the schemaNullPointerException
- schema is nullIllegalArgumentException
- schema has no id
, or its id
is not an absolute JSON ReferenceJsonRef
public LoadingConfigurationBuilder addParserFeature(JsonParser.Feature feature)
Use this option to enable non-standard JSON schema source including comments, single quotes, unquoted field names, etc.
feature
- the JsonParser feature to enableNullPointerException
- feature is nullJsonParser.Feature
public LoadingConfigurationBuilder removeParserFeature(JsonParser.Feature feature)
Note that attempts to remove JsonParser.Feature.AUTO_CLOSE_SOURCE
will
be ignored for safety reasons.
feature
- the feature to removeNullPointerException
- feature is nulladdParserFeature(JsonParser.Feature)
public LoadingConfiguration freeze()
freeze
in interface Thawed<LoadingConfiguration>