public static final class JsonSchemaFactory.Builder extends Object
JsonSchemaFactory
Constructor and Description |
---|
JsonSchemaFactory.Builder()
Constructor
|
Modifier and Type | Method and Description |
---|---|
JsonSchemaFactory.Builder |
addKeywordRegistry(JsonRef schemaURI,
KeywordRegistry keywordRegistry,
boolean byDefault)
Deprecated.
|
JsonSchemaFactory.Builder |
addMetaSchema(MetaSchema metaSchema,
boolean byDefault) |
JsonSchemaFactory.Builder |
addRedirection(String from,
String to)
Add an URI redirection
|
JsonSchemaFactory.Builder |
addressingMode(AddressingMode addressingMode)
Sets the addressing mode for this factory
|
JsonSchemaFactory.Builder |
addSchema(String uri,
JsonNode schema)
Register a schema
|
JsonSchemaFactory.Builder |
addSchema(URI uri,
JsonNode schema)
Register a schema
|
JsonSchemaFactory |
build()
Build the factory
|
JsonSchemaFactory.Builder |
registerScheme(String scheme,
URIDownloader downloader)
Register a
URIDownloader for a given scheme |
JsonSchemaFactory.Builder |
setNamespace(String namespace)
Set the schema registry's namespace
|
JsonSchemaFactory.Builder |
unregisterScheme(String scheme)
Unregister a scheme
|
public JsonSchemaFactory.Builder registerScheme(String scheme, URIDownloader downloader)
URIDownloader
for a given schemescheme
- the URI schemedownloader
- the downloaderNullPointerException
- scheme is nullIllegalArgumentException
- illegal schemepublic JsonSchemaFactory.Builder unregisterScheme(String scheme)
scheme
- the scheme to desupportpublic JsonSchemaFactory.Builder addressingMode(AddressingMode addressingMode)
addressingMode
- the addressing modepublic JsonSchemaFactory.Builder setNamespace(String namespace)
namespace
- the namespace, as a stringIllegalArgumentException
- invalid URI (see URI.create(String)
)SchemaRegistry
public JsonSchemaFactory.Builder addRedirection(String from, String to)
This allows you to add an alias for a schema location so that it point to another of your choice. It may be useful if you have to resolve absolute JSON References normally unreachable, but you have a copy of this schema locally.
Note that both URIs must be absolute.
from
- the source URI, as a stringto
- the target URI, as a stringIllegalArgumentException
- either from
or to
is an invalid URI, or it is not an absolute JSON ReferenceJsonRef
@Deprecated public JsonSchemaFactory.Builder addKeywordRegistry(JsonRef schemaURI, KeywordRegistry keywordRegistry, boolean byDefault)
schemaURI
- the URI for the new registrykeywordRegistry
- the keyword registrybyDefault
- whether this registry will be the defaultNullPointerException
- the URI or registry are nullpublic JsonSchemaFactory.Builder addMetaSchema(MetaSchema metaSchema, boolean byDefault)
public JsonSchemaFactory.Builder addSchema(URI uri, JsonNode schema)
uri
- the URI of this schemaschema
- the schemaSchemaBundle.addSchema(URI, JsonNode)
public JsonSchemaFactory.Builder addSchema(String uri, JsonNode schema)
uri
- the URI of this schemaschema
- the schemaSchemaBundle.addSchema(String, JsonNode)
public JsonSchemaFactory build()
Copyright © 2013. All Rights Reserved.