Class JsonSchema
- Direct Known Subclasses:
JsonSchemaProperty
,JsonSchemaRef
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Used during parsing to convert theadditionalItems property to the correct class type.static class
Used during parsing to convert theadditionalProperties property to the correct class type.static class
Used during parsing to convert theitems property to the correct class type.static class
Used during parsing to convert thetype property to the correct class type. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalItems
(JsonSchema... additionalItems) Bean property appender:additionalItems .addAllOf
(JsonSchema... allOf) Bean property appender:allOf .addAnyOf
(JsonSchema... anyOf) Bean property appender:anyOf .addDefinition
(String name, JsonSchema definition) Bean property appender:definitions .addDependency
(String name, JsonSchema dependency) Bean property appender:dependencies .Bean property appender:enum .addItems
(JsonSchema... items) Bean property appender:items .addOneOf
(JsonSchema... oneOf) Bean property appender:oneOf .addPatternProperties
(JsonSchemaProperty... properties) Bean property appender:patternProperties .addProperties
(JsonSchema... properties) Bean property appender:properties .addRequired
(String... required) Bean property appender:required .addRequired
(List<String> required) Bean property appender:required .addRequired
(JsonSchemaProperty... properties) Bean property appender:required .Bean property appender:type .Bean property getter:additionalItems .Bean property getter:additionalItems .Bean property getter:additionalItems .Bean property getter:additionalProperties .Bean property getter:additionalProperties .Bean property getter:additionalProperties .getAllOf()
Bean property getter:allOf .getAnyOf()
Bean property getter:anyOf .Bean property getter:definitions .Bean property getter:dependencies .Bean property getter:description .getEnum()
Bean property getter:enum .getId()
Bean property getter:id .getItems()
Bean property getter:items .Bean property getter:items .Bean property getter:items .Bean property getter:maximum .Bean property getter:maxItems .Bean property getter:maxLength .Bean property getter:maxProperties .Bean property getter:minimum .Bean property getter:minItems .Bean property getter:minLength .Bean property getter:minProperties .Bean property getter:multipleOf .getName()
Bean property getter:name .getNot()
Bean property getter:not .getOneOf()
Bean property getter:oneOf .Bean property getter:pattern .Bean property getter:patternProperties .Bean property getter:properties .getProperty
(String name) Returns the property with the specified name.getProperty
(String name, boolean resolve) Returns the property with the specified name.getRef()
Bean property getter:$ref .Bean property getter:required .Bean property getter:$schema .getTitle()
Bean property getter:title .getType()
Bean property getter:type .Bean property getter:type .Bean property getter:type .Bean property getter:uniqueItems .Bean property getter:exclusiveMaximum .Bean property getter:exclusiveMinimum .resolve()
Resolve schema if reference.setAdditionalItems
(Object additionalItems) Bean property setter:additionalItems .setAdditionalProperties
(Object additionalProperties) Bean property setter:additionalProperties .setAllOf
(List<JsonSchema> allOf) Bean property setter:allOf .setAnyOf
(List<JsonSchema> anyOf) Bean property setter:anyOf .setDefinitions
(Map<String, JsonSchema> definitions) Bean property setter:definitions .setDependencies
(Map<String, JsonSchema> dependencies) Bean property setter:dependencies .setDescription
(String description) Bean property setter:description .Bean property setter:enum .setExclusiveMaximum
(Boolean exclusiveMaximum) Bean property setter:exclusiveMaximum .setExclusiveMinimum
(Boolean exclusiveMinimum) Bean property setter:exclusiveMinimum .Bean property setter:id .Bean property setter:items .protected void
setMaster
(JsonSchema master) Sets the master schema for this schema and all child schema objects.setMaximum
(Number maximum) Bean property setter:maximum .setMaxItems
(Integer maxItems) Bean property setter:maxItems .setMaxLength
(Integer maxLength) Bean property setter:maxLength .setMaxProperties
(Integer maxProperties) Bean property setter:maxProperties .setMinimum
(Number minimum) Bean property setter:minimum .setMinItems
(Integer minItems) Bean property setter:minItems .setMinLength
(Integer minLength) Bean property setter:minLength .setMinProperties
(Integer minProperties) Bean property setter:minProperties .setMultipleOf
(Number multipleOf) Bean property setter:multipleOf .Bean property setter:name .setNot
(JsonSchema not) Bean property setter:not .setOneOf
(List<JsonSchema> oneOf) Bean property setter:oneOf .setPattern
(String pattern) Bean property setter:pattern .setPatternProperties
(Map<String, JsonSchema> patternProperties) Bean property setter:patternProperties .setProperties
(Map<String, JsonSchema> properties) Bean property setter:properties .Bean property setter:$ref .setRequired
(List<String> required) Bean property setter:required .setSchemaMap
(JsonSchemaMap schemaMap) Associates a schema map with this schema for resolving other schemas identified through$ref properties.setSchemaVersionUri
(Object schemaVersion) Bean property setter:$schema .Bean property setter:title .Bean property setter:type .setUniqueItems
(Boolean uniqueItems) Bean property setter:uniqueItems .toString()
-
Constructor Details
-
JsonSchema
public JsonSchema()Default constructor.
-
-
Method Details
-
getName
Bean property getter:name .- Returns:
- The value of the
name property on this bean, ornull if it is not set.
-
setName
Bean property setter:name .- Parameters:
name
- The new value for thename property on this bean.- Returns:
- This object.
-
getId
Bean property getter:id .- Returns:
- The value of the
id property on this bean, ornull if it is not set.
-
setId
Bean property setter:id .The value can be of any of the following types:
URI
,URL
,String
. Strings must be valid URIs.URIs defined by
UriResolver
can be used for values.- Parameters:
id
- The new value for theid property on this bean.- Returns:
- This object.
-
getSchemaVersionUri
Bean property getter:$schema .- Returns:
- The value of the
$schema property on this bean, ornull if it is not set.
-
setSchemaVersionUri
Bean property setter:$schema .The value can be of any of the following types:
URI
,URL
,String
. Strings must be valid URIs.URIs defined by
UriResolver
can be used for values.- Parameters:
schemaVersion
- The new value for theschemaVersion property on this bean.- Returns:
- This object.
-
getTitle
Bean property getter:title .- Returns:
- The value of the
title property, ornull if it is not set.
-
setTitle
Bean property setter:title .- Parameters:
title
- The new value for thetitle property on this bean.- Returns:
- This object.
-
getDescription
Bean property getter:description .- Returns:
- The value of the
description property, ornull if it is not set.
-
setDescription
Bean property setter:description .- Parameters:
description
- The new value for thedescription property on this bean.- Returns:
- This object.
-
getType
Bean property getter:type .- Returns:
- The value of the
type property on this bean, ornull if it is not set. Can be either aJsonType
orJsonTypeArray
depending on what value was used to set it.
-
getTypeAsJsonType
Bean property getter:type .Convenience method for returning the
type property when it is aJsonType
value.- Returns:
- The currently set value, or
null if the property is not set, or is set as aJsonTypeArray
.
-
getTypeAsJsonTypeArray
Bean property getter:type .Convenience method for returning the
type property when it is aJsonTypeArray
value.- Returns:
- The currently set value, or
null if the property is not set, or is set as aJsonType
.
-
setType
Bean property setter:type .- Parameters:
type
- The new value for thetype property on this bean. This object must be of typeJsonType
orJsonTypeArray
.- Returns:
- This object.
- Throws:
BeanRuntimeException
- If invalid object type passed in.
-
addTypes
Bean property appender:type .- Parameters:
types
- The list of items to append to thetype property on this bean.- Returns:
- This object.
-
getDefinitions
Bean property getter:definitions .- Returns:
- The value of the
definitions property on this bean, ornull if it is not set.
-
setDefinitions
Bean property setter:definitions .- Parameters:
definitions
- The new value for thedefinitions property on this bean.- Returns:
- This object.
-
addDefinition
Bean property appender:definitions .- Parameters:
name
- The key in the definitions map entry.definition
- The value in the definitions map entry.- Returns:
- This object.
-
getProperties
Bean property getter:properties .- Returns:
- The value of the
properties property on this bean, ornull if it is not set.
-
getProperty
Returns the property with the specified name.This is equivalent to calling
getProperty(name, .false )- Parameters:
name
- The property name.- Returns:
- The property with the specified name, or
null if no property is specified.
-
getProperty
Returns the property with the specified name.If
resolve istrue , the property object will automatically be resolved by callingresolve()
. Therefore,getProperty(name, is equivalent to callingtrue )getProperty(name).resolve() , except it's safe from a potentialNullPointerException .- Parameters:
name
- The property name.resolve
- Iftrue , callsresolve()
on object before returning.- Returns:
- The property with the specified name, or
null if no property is specified.
-
setProperties
Bean property setter:properties .- Parameters:
properties
- The new value for theproperties property on this bean.- Returns:
- This object.
-
addProperties
Bean property appender:properties .Properties must have their
name property set on them when using this method.- Parameters:
properties
- The list of items to append to theproperties property on this bean.- Returns:
- This object.
- Throws:
BeanRuntimeException
- If property is found without a setname property.
-
getPatternProperties
Bean property getter:patternProperties .- Returns:
- The value of the
patternProperties property on this bean, ornull if it is not set.
-
setPatternProperties
Bean property setter:patternProperties .- Parameters:
patternProperties
- The new value for thepatternProperties property on this bean.- Returns:
- This object.
-
addPatternProperties
Bean property appender:patternProperties .Properties must have their
name property set to the pattern string when using this method.- Parameters:
properties
- The list of items to append to thepatternProperties property on this bean.- Returns:
- This object.
- Throws:
BeanRuntimeException
- If property is found without a setname property.
-
getDependencies
Bean property getter:dependencies .- Returns:
- The value of the
dependencies property on this bean, ornull if it is not set.
-
setDependencies
Bean property setter:dependencies .- Parameters:
dependencies
- The new value for thedependencies property on this bean.- Returns:
- This object.
-
addDependency
Bean property appender:dependencies .- Parameters:
name
- The key of the entry in the dependencies map.dependency
- The value of the entry in the dependencies map.- Returns:
- This object.
-
getItems
Bean property getter:items .- Returns:
- The value of the
items property on this bean, ornull if it is not set. Can be either aJsonSchema
orJsonSchemaArray
depending on what value was used to set it.
-
getItemsAsSchema
Bean property getter:items .Convenience method for returning the
items property when it is aJsonSchema
value.- Returns:
- The currently set value, or
null if the property is not set, or is set as aJsonSchemaArray
.
-
getItemsAsSchemaArray
Bean property getter:items .Convenience method for returning the
items property when it is aJsonSchemaArray
value.- Returns:
- The currently set value, or
null if the property is not set, or is set as aJsonSchema
.
-
setItems
Bean property setter:items .- Parameters:
items
- The new value for theitems property on this bean. This object must be of typeJsonSchema
orJsonSchemaArray
.- Returns:
- This object.
- Throws:
BeanRuntimeException
- If invalid object type passed in.
-
addItems
Bean property appender:items .- Parameters:
items
- The list of items to append to theitems property on this bean.- Returns:
- This object.
-
getMultipleOf
Bean property getter:multipleOf .- Returns:
- The value of the
multipleOf property on this bean, ornull if it is not set.
-
setMultipleOf
Bean property setter:multipleOf .- Parameters:
multipleOf
- The new value for themultipleOf property on this bean.- Returns:
- This object.
-
getMaximum
Bean property getter:maximum .- Returns:
- The value of the
maximum property on this bean, ornull if it is not set.
-
setMaximum
Bean property setter:maximum .- Parameters:
maximum
- The new value for themaximum property on this bean.- Returns:
- This object.
-
isExclusiveMaximum
Bean property getter:exclusiveMaximum .- Returns:
- The value of the
exclusiveMaximum property on this bean, ornull if it is not set.
-
setExclusiveMaximum
Bean property setter:exclusiveMaximum .- Parameters:
exclusiveMaximum
- The new value for theexclusiveMaximum property on this bean.- Returns:
- This object.
-
getMinimum
Bean property getter:minimum .- Returns:
- The value of the
minimum property on this bean, ornull if it is not set.
-
setMinimum
Bean property setter:minimum .- Parameters:
minimum
- The new value for theminimum property on this bean.- Returns:
- This object.
-
isExclusiveMinimum
Bean property getter:exclusiveMinimum .- Returns:
- The value of the
exclusiveMinimum property on this bean, ornull if it is not set.
-
setExclusiveMinimum
Bean property setter:exclusiveMinimum .- Parameters:
exclusiveMinimum
- The new value for theexclusiveMinimum property on this bean.- Returns:
- This object.
-
getMaxLength
Bean property getter:maxLength .- Returns:
- The value of the
maxLength property on this bean, ornull if it is not set.
-
setMaxLength
Bean property setter:maxLength .- Parameters:
maxLength
- The new value for themaxLength property on this bean.- Returns:
- This object.
-
getMinLength
Bean property getter:minLength .- Returns:
- The value of the
minLength property on this bean, ornull if it is not set.
-
setMinLength
Bean property setter:minLength .- Parameters:
minLength
- The new value for theminLength property on this bean.- Returns:
- This object.
-
getPattern
Bean property getter:pattern .- Returns:
- The value of the
pattern property on this bean, ornull if it is not set.
-
setPattern
Bean property setter:pattern .- Parameters:
pattern
- The new value for thepattern property on this bean.- Returns:
- This object.
-
getAdditionalItems
Bean property getter:additionalItems .- Returns:
- The value of the
additionalItems property on this bean, ornull if it is not set. Can be either aBoolean
orJsonSchemaArray
depending on what value was used to set it.
-
getAdditionalItemsAsBoolean
Bean property getter:additionalItems .Convenience method for returning the
additionalItems property when it is aBoolean
value.- Returns:
- The currently set value, or
null if the property is not set, or is set as aJsonSchemaArray
.
-
getAdditionalItemsAsSchemaArray
Bean property getter:additionalItems .Convenience method for returning the
additionalItems property when it is aJsonSchemaArray
value.- Returns:
- The currently set value, or
null if the property is not set, or is set as aBoolean
.
-
setAdditionalItems
Bean property setter:additionalItems .- Parameters:
additionalItems
- The new value for theadditionalItems property on this bean. This object must be of typeBoolean
orJsonSchemaArray
.- Returns:
- This object.
- Throws:
BeanRuntimeException
- If invalid object type passed in.
-
addAdditionalItems
Bean property appender:additionalItems .- Parameters:
additionalItems
- The list of items to append to theadditionalItems property on this bean.- Returns:
- This object.
-
getMaxItems
Bean property getter:maxItems .- Returns:
- The value of the
maxItems property on this bean, ornull if it is not set.
-
setMaxItems
Bean property setter:maxItems .- Parameters:
maxItems
- The new value for themaxItems property on this bean.- Returns:
- This object.
-
getMinItems
Bean property getter:minItems .- Returns:
- The value of the
minItems property on this bean, ornull if it is not set.
-
setMinItems
Bean property setter:minItems .- Parameters:
minItems
- The new value for theminItems property on this bean.- Returns:
- This object.
-
getUniqueItems
Bean property getter:uniqueItems .- Returns:
- The value of the
uniqueItems property on this bean, ornull if it is not set.
-
setUniqueItems
Bean property setter:uniqueItems .- Parameters:
uniqueItems
- The new value for theuniqueItems property on this bean.- Returns:
- This object.
-
getMaxProperties
Bean property getter:maxProperties .- Returns:
- The value of the
maxProperties property on this bean, ornull if it is not set.
-
setMaxProperties
Bean property setter:maxProperties .- Parameters:
maxProperties
- The new value for themaxProperties property on this bean.- Returns:
- This object.
-
getMinProperties
Bean property getter:minProperties .- Returns:
- The value of the
minProperties property on this bean, ornull if it is not set.
-
setMinProperties
Bean property setter:minProperties .- Parameters:
minProperties
- The new value for theminProperties property on this bean.- Returns:
- This object.
-
getRequired
Bean property getter:required .- Returns:
- The value of the
required property on this bean, ornull if it is not set.
-
setRequired
Bean property setter:required .- Parameters:
required
- The new value for therequired property on this bean.- Returns:
- This object.
-
addRequired
Bean property appender:required .- Parameters:
required
- The list of items to append to therequired property on this bean.- Returns:
- This object.
-
addRequired
Bean property appender:required .- Parameters:
required
- The list of items to append to therequired property on this bean.- Returns:
- This object.
-
addRequired
Bean property appender:required .- Parameters:
properties
- The list of items to append to therequired property on this bean.- Returns:
- This object.
-
getAdditionalProperties
Bean property getter:additionalProperties .- Returns:
- The value of the
additionalProperties property on this bean, ornull if it is not set. Can be either aBoolean
orJsonSchemaArray
depending on what value was used to set it.
-
getAdditionalPropertiesAsBoolean
Bean property getter:additionalProperties .Convenience method for returning the
additionalProperties property when it is aBoolean
value.- Returns:
- The currently set value, or
null if the property is not set, or is set as aJsonSchema
.
-
getAdditionalPropertiesAsSchema
Bean property getter:additionalProperties .Convenience method for returning the
additionalProperties property when it is aJsonSchema
value.- Returns:
- The currently set value, or
null if the property is not set, or is set as aBoolean
.
-
setAdditionalProperties
@Beanp(dictionary=JsonSchema.class) public JsonSchema setAdditionalProperties(Object additionalProperties) Bean property setter:additionalProperties .- Parameters:
additionalProperties
- The new value for theadditionalProperties property on this bean. This object must be of typeBoolean
orJsonSchema
.- Returns:
- This object.
- Throws:
BeanRuntimeException
- If invalid object type passed in.
-
getEnum
Bean property getter:enum .- Returns:
- The value of the
enum property on this bean, ornull if it is not set.
-
setEnum
Bean property setter:enum .- Parameters:
_enum
- The new value for theenum property on this bean.- Returns:
- This object.
-
addEnum
Bean property appender:enum .- Parameters:
_enum
- The list of items to append to theenum property on this bean.- Returns:
- This object.
-
getAllOf
Bean property getter:allOf .- Returns:
- The value of the
allOf property on this bean, ornull if it is not set.
-
setAllOf
Bean property setter:allOf .- Parameters:
allOf
- The new value for theallOf property on this bean.- Returns:
- This object.
-
addAllOf
Bean property appender:allOf .- Parameters:
allOf
- The list of items to append to theallOf property on this bean.- Returns:
- This object.
-
getAnyOf
Bean property getter:anyOf .- Returns:
- The value of the
anyOf property on this bean, ornull if it is not set.
-
setAnyOf
Bean property setter:anyOf .- Parameters:
anyOf
- The new value of theanyOf property on this bean.- Returns:
- This object.
-
addAnyOf
Bean property appender:anyOf .- Parameters:
anyOf
- The list of items to append to theanyOf property on this bean.- Returns:
- This object.
-
getOneOf
Bean property getter:oneOf .- Returns:
- The value of the
oneOf property on this bean, ornull if it is not set.
-
setOneOf
Bean property setter:oneOf .- Parameters:
oneOf
- The new value for theoneOf property on this bean.- Returns:
- This object.
-
addOneOf
Bean property appender:oneOf .- Parameters:
oneOf
- The list of items to append to theoneOf property on this bean.- Returns:
- This object.
-
getNot
Bean property getter:not .- Returns:
- The value of the
not property on this bean, ornull if it is not set.
-
setNot
Bean property setter:not .- Parameters:
not
- The new value for thenot property on this bean.- Returns:
- This object.
-
getRef
Bean property getter:$ref .- Returns:
- The value of the
$ref property on this bean, ornull if it is not set.
-
setRef
Bean property setter:$ref .The value can be of any of the following types:
URI
,URL
,String
. Strings must be valid URIs.URIs defined by
UriResolver
can be used for values.- Parameters:
ref
- The new value for the$ref property on this bean.- Returns:
- This object.
-
setMaster
Sets the master schema for this schema and all child schema objects.All child elements in a schema should point to a single "master" schema in order to locate registered JsonSchemaMap objects for resolving external schemas.
- Parameters:
master
- The master schema to associate on this and all children. Can benull .
-
resolve
Resolve schema if reference.If this schema is a reference to another schema (has its
$ref property set), this method will retrieve the referenced schema from the schema map registered with this schema.If this schema is not a reference, or no schema map is registered with this schema, this method is a no-op and simply returns this object.
- Returns:
- The referenced schema, or
null .
-
setSchemaMap
Associates a schema map with this schema for resolving other schemas identified through$ref properties.- Parameters:
schemaMap
- The schema map to associate with this schema. Can benull .- Returns:
- This object.
-
toString
-