public abstract class BaseSchemaParser extends Object implements SchemaParserInternal
Modifier and Type | Field and Description |
---|---|
protected SchemaRouter |
router |
protected List<ValidatorFactory> |
validatorFactories |
Modifier | Constructor and Description |
---|---|
protected |
BaseSchemaParser(SchemaRouter router) |
Modifier and Type | Method and Description |
---|---|
protected SchemaImpl |
createSchema(JsonObject schema,
JsonPointer scope,
MutableStateValidator parent) |
SchemaRouter |
getSchemaRouter()
Get schema router registered to this schema parser
|
protected abstract List<ValidatorFactory> |
initValidatorFactories() |
SchemaInternal |
parse(Object jsonSchema,
JsonPointer scope,
MutableStateValidator parent) |
SchemaInternal |
parseFromString(String unparsedJson,
JsonPointer scope,
MutableStateValidator parent) |
protected Map.Entry<Optional<JsonPointer>,Optional<String>> |
resolveIdAndAlias(JsonObject schema,
URI scope) |
BaseSchemaParser |
withStringFormatValidator(String formatName,
java.util.function.Predicate<String> predicate)
Add a custom format validator
|
BaseSchemaParser |
withValidatorFactory(ValidatorFactory factory)
Add a
ValidatorFactory to this schema parser to support custom keywords |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parse, parse, parse, parse, parse, parse, parse, parseFromString, parseFromString, parseFromString, parseFromString
createDraft201909SchemaParser, createDraft7SchemaParser, createOpenAPI3SchemaParser
protected final List<ValidatorFactory> validatorFactories
protected final SchemaRouter router
protected BaseSchemaParser(SchemaRouter router)
public SchemaRouter getSchemaRouter()
SchemaParser
getSchemaRouter
in interface SchemaParser
public SchemaInternal parse(Object jsonSchema, JsonPointer scope, MutableStateValidator parent)
parse
in interface SchemaParserInternal
protected SchemaImpl createSchema(JsonObject schema, JsonPointer scope, MutableStateValidator parent)
protected abstract List<ValidatorFactory> initValidatorFactories()
protected Map.Entry<Optional<JsonPointer>,Optional<String>> resolveIdAndAlias(JsonObject schema, URI scope)
public BaseSchemaParser withValidatorFactory(ValidatorFactory factory)
SchemaParser
ValidatorFactory
to this schema parser to support custom keywordswithValidatorFactory
in interface SchemaParser
factory
- new factorypublic BaseSchemaParser withStringFormatValidator(String formatName, java.util.function.Predicate<String> predicate)
SchemaParser
withStringFormatValidator
in interface SchemaParser
formatName
- format namepredicate
- predicate for the new formatpublic SchemaInternal parseFromString(String unparsedJson, JsonPointer scope, MutableStateValidator parent)
parseFromString
in interface SchemaParserInternal
Copyright © 2022 Eclipse. All rights reserved.