public interface SchemaBuilder extends ComplexTypeBuilder<SchemaBuilder>, CommonBuilder<SchemaBuilder>
JSONUtil.SchemaVersion#DRAFT_04
version of the json
schema specification. Documents built with this builder will adhere to this
version but are not guaranteed with other versions of the specification.
Actions taken on this builder will affect the root of the document.
The builder is intented to be used by chaining method calls. Each action will
return an appropriate builder based on the context of the action.
Additionally, nested builders (i.e., builders other than the root instance)
provide a NestedBuilder.finish()
method to return to the parent
builder. Actions available at the root are based on common actions available
to all builders and the actions available for complex types.
The general pattern is that methods prefixed with "build" will begin a new
definition and return a new builder instance. A call to
NestedBuilder.finish()
is required to return to the original builder.
Methods prefixed with "with" will add to the current definition and return
the same builder instance.
The initial schema document will contain the "$schema" property set to the
the supported version of json schema specification, the "type" property set
to "object", and the "properties" property set to an empty json object.CommonBuilder
,
ComplexTypeBuilder
Modifier and Type | Method and Description |
---|---|
JsonNode |
getSchema()
This method returns the schema document as a
JsonNode . |
void |
reset()
This method removes any attributes that have been added and returns the
schema document to its original state.
|
buildFieldSpec, buildProperty, withMaxProperties, withMinProperties, withRequired
getObjectRoot
withDescription, withId, withIgnoreForFilters, withIgnoreForSelection, withIgnoreForSort, withTitle
JsonNode getSchema()
JsonNode
. The method
can be called multiple times and will return the current state of the
schema.void reset()