public final class LoadingConfigurationBuilder extends Object implements com.github.fge.Thawed<LoadingConfiguration>
LoadingConfiguration
Modifier and Type | Method and Description |
---|---|
LoadingConfigurationBuilder |
addParserFeature(com.fasterxml.jackson.core.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(com.fasterxml.jackson.databind.JsonNode schema)
Preload a schema
|
LoadingConfigurationBuilder |
preloadSchema(String uri,
com.fasterxml.jackson.databind.JsonNode schema)
Preload a schema at a given URI
|
LoadingConfigurationBuilder |
removeParserFeature(com.fasterxml.jackson.core.JsonParser.Feature feature)
Remove a JSON parser feature
|
LoadingConfigurationBuilder |
removeScheme(String scheme)
Remove a downloader for a given scheme
|
LoadingConfigurationBuilder |
setEnableCache(boolean enableCache)
Should we enable caching of downloaded schemas
|
LoadingConfigurationBuilder |
setURITranslatorConfiguration(URITranslatorConfiguration translatorCfg) |
public LoadingConfigurationBuilder setEnableCache(boolean enableCache)
Note that this does not affect preloaded schemas
enableCache
- 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, com.fasterxml.jackson.databind.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(com.fasterxml.jackson.databind.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(com.fasterxml.jackson.core.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(com.fasterxml.jackson.core.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 com.github.fge.Thawed<LoadingConfiguration>
Copyright © 2016. All rights reserved.