com.fasterxml.jackson.databind.jsonSchema.types
Class JsonSchema

java.lang.Object
  extended by com.fasterxml.jackson.databind.jsonSchema.types.JsonSchema
Direct Known Subclasses:
HyperSchema, SimpleTypeSchema, UnionTypeSchema

public abstract class JsonSchema
extends Object

The type wraps the json schema specification at : Json JsonSchema Draft

JSON (JavaScript Object Notation) JsonSchema defines the media type "application/schema+json", a JSON based format for defining the structure of JSON data. JSON JsonSchema provides a contract for what JSON data is required for a given application and how to interact with it. JSON JsonSchema is intended to define validation, documentation, hyperlink navigation, and interaction control of JSON data.
JSON (JavaScript Object Notation) JsonSchema is a JSON media type for defining the structure of JSON data. JSON JsonSchema provides a contract for what JSON data is required for a given application and how to interact with it. JSON JsonSchema is intended to define validation, documentation, hyperlink navigation, and interaction control of JSON data.
An example JSON JsonSchema provided by the JsonSchema draft:
        {
          "name":"Product",
          "properties":{
            "id":{
              "type":"number",
              "description":"Product identifier",
              "required":true
            },
            "name":{
              "description":"Name of the product",
              "type":"string",
              "required":true
            },
            "price":{
              "required":true,
              "type": "number",
              "minimum":0,
              "required":true
            },
            "tags":{
              "type":"array",
              "items":{
                "type":"string"
              }
            }
          },
          "links":[
            {
              "rel":"full",
              "href":"{id}"
            },
            {
              "rel":"comments",
              "href":"comments/?id={id}"
            }
          ]
        }
 

Author:
jphelan

Nested Class Summary
static class JsonSchema.JsonSchemaIdResolver
           
 
Constructor Summary
JsonSchema()
           
 
Method Summary
 AnySchema asAnySchema()
          Attempt to return this JsonSchema as an AnySchema
 ArraySchema asArraySchema()
          Attempt to return this JsonSchema as an ArraySchema
 BooleanSchema asBooleanSchema()
          Attempt to return this JsonSchema as a BooleanSchema
 ContainerTypeSchema asContainerSchema()
          Attempt to return this JsonSchema as a ContainerTypeSchema
 IntegerSchema asIntegerSchema()
          Attempt to return this JsonSchema as an IntegerSchema
 NullSchema asNullSchema()
          Attempt to return this JsonSchema as a NullSchema
 NumberSchema asNumberSchema()
          Attempt to return this JsonSchema as a NumberSchema
 ObjectSchema asObjectSchema()
          Attempt to return this JsonSchema as an ObjectSchema
 SimpleTypeSchema asSimpleTypeSchema()
          Attempt to return this JsonSchema as a SimpleTypeSchema
 StringSchema asStringSchema()
          Attempt to return this JsonSchema as a StringSchema
 UnionTypeSchema asUnionTypeSchema()
          Attempt to return this JsonSchema as an UnionTypeSchema
 ValueTypeSchema asValueSchemaSchema()
          Attempt to return this JsonSchema as a ValueTypeSchema
 boolean equals(Object obj)
           
 String get$ref()
          $ref
 String get$schema()
          $schema
 JsonSchema[] getDisallow()
          disallow
 JsonSchema[] getExtends()
          extendsextends
 String getId()
          id
 Boolean getRequired()
          required
abstract  com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes getType()
           
 boolean isAnySchema()
          determine if this JsonSchema is an AnySchema.
 boolean isArraySchema()
          determine if this JsonSchema is an ArraySchema.
 boolean isBooleanSchema()
          determine if this JsonSchema is an BooleanSchema.
 boolean isContainerTypeSchema()
          determine if this JsonSchema is an ContainerTypeSchema.
 boolean isIntegerSchema()
          determine if this JsonSchema is an IntegerSchema.
 boolean isNullSchema()
          determine if this JsonSchema is an NullSchema.
 boolean isNumberSchema()
          determine if this JsonSchema is an NumberSchema.
 boolean isObjectSchema()
          determine if this JsonSchema is an ObjectSchema.
 boolean isSimpleTypeSchema()
          determine if this JsonSchema is an SimpleTypeSchema.
 boolean isStringSchema()
          determine if this JsonSchema is an StringSchema.
 boolean isUnionTypeSchema()
          determine if this JsonSchema is an UnionTypeSchema.
 boolean isValueTypeSchema()
          determine if this JsonSchema is an ValueTypeSchema.
static JsonSchema minimalForFormat(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes format)
          Create a schema which verifies only that an object is of the given format.
 void set$ref(String $ref)
          $ref
 void set$schema(String $schema)
          $schema
 void setDisallow(JsonSchema[] disallow)
          disallow
 void setExtends(JsonSchema[] extendsextends)
          extendsextends
 void setId(String id)
          id
 void setRequired(Boolean required)
          required
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonSchema

public JsonSchema()
Method Detail

asAnySchema

public AnySchema asAnySchema()
Attempt to return this JsonSchema as an AnySchema

Returns:
this as an AnySchema if possible, or null otherwise

asArraySchema

public ArraySchema asArraySchema()
Attempt to return this JsonSchema as an ArraySchema

Returns:
this as an ArraySchema if possible, or null otherwise

asBooleanSchema

public BooleanSchema asBooleanSchema()
Attempt to return this JsonSchema as a BooleanSchema

Returns:
this as a BooleanSchema if possible, or null otherwise

asContainerSchema

public ContainerTypeSchema asContainerSchema()
Attempt to return this JsonSchema as a ContainerTypeSchema

Returns:
this as an ContainerTypeSchema if possible, or null otherwise

asIntegerSchema

public IntegerSchema asIntegerSchema()
Attempt to return this JsonSchema as an IntegerSchema

Returns:
this as an IntegerSchema if possible, or null otherwise

asNullSchema

public NullSchema asNullSchema()
Attempt to return this JsonSchema as a NullSchema

Returns:
this as a NullSchema if possible, or null otherwise

asNumberSchema

public NumberSchema asNumberSchema()
Attempt to return this JsonSchema as a NumberSchema

Returns:
this as a NumberSchema if possible, or null otherwise

asObjectSchema

public ObjectSchema asObjectSchema()
Attempt to return this JsonSchema as an ObjectSchema

Returns:
this as an ObjectSchema if possible, or null otherwise

asSimpleTypeSchema

public SimpleTypeSchema asSimpleTypeSchema()
Attempt to return this JsonSchema as a SimpleTypeSchema

Returns:
this as a SimpleTypeSchema if possible, or null otherwise

asStringSchema

public StringSchema asStringSchema()
Attempt to return this JsonSchema as a StringSchema

Returns:
this as a StringSchema if possible, or null otherwise

asUnionTypeSchema

public UnionTypeSchema asUnionTypeSchema()
Attempt to return this JsonSchema as an UnionTypeSchema

Returns:
this as a UnionTypeSchema if possible, or null otherwise

asValueSchemaSchema

public ValueTypeSchema asValueSchemaSchema()
Attempt to return this JsonSchema as a ValueTypeSchema

Returns:
this as a ValueTypeSchema if possible, or null otherwise

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

get$ref

public String get$ref()
$ref

Returns:
the $ref

get$schema

public String get$schema()
$schema

Returns:
the $schema

getDisallow

public JsonSchema[] getDisallow()
disallow

Returns:
the disallow

getExtends

public JsonSchema[] getExtends()
extendsextends

Returns:
the extendsextends

getId

public String getId()
id

Returns:
the id

getRequired

public Boolean getRequired()
required

Returns:
the required

getType

public abstract com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes getType()

isAnySchema

public boolean isAnySchema()
determine if this JsonSchema is an AnySchema.

Returns:
true if this JsonSchema is an AnySchema, false otherwise

isArraySchema

public boolean isArraySchema()
determine if this JsonSchema is an ArraySchema.

Returns:
true if this JsonSchema is an ArraySchema, false otherwise

isBooleanSchema

public boolean isBooleanSchema()
determine if this JsonSchema is an BooleanSchema.

Returns:
true if this JsonSchema is an BooleanSchema, false otherwise

isContainerTypeSchema

public boolean isContainerTypeSchema()
determine if this JsonSchema is an ContainerTypeSchema.

Returns:
true if this JsonSchema is an ContainerTypeSchema, false otherwise

isIntegerSchema

public boolean isIntegerSchema()
determine if this JsonSchema is an IntegerSchema.

Returns:
true if this JsonSchema is an IntegerSchema, false otherwise

isNullSchema

public boolean isNullSchema()
determine if this JsonSchema is an NullSchema.

Returns:
true if this JsonSchema is an NullSchema, false otherwise

isNumberSchema

public boolean isNumberSchema()
determine if this JsonSchema is an NumberSchema.

Returns:
true if this JsonSchema is an NumberSchema, false otherwise

isObjectSchema

public boolean isObjectSchema()
determine if this JsonSchema is an ObjectSchema.

Returns:
true if this JsonSchema is an ObjectSchema, false otherwise

isSimpleTypeSchema

public boolean isSimpleTypeSchema()
determine if this JsonSchema is an SimpleTypeSchema.

Returns:
true if this JsonSchema is an SimpleTypeSchema, false otherwise

isStringSchema

public boolean isStringSchema()
determine if this JsonSchema is an StringSchema.

Returns:
true if this JsonSchema is an StringSchema, false otherwise

isUnionTypeSchema

public boolean isUnionTypeSchema()
determine if this JsonSchema is an UnionTypeSchema.

Returns:
true if this JsonSchema is an UnionTypeSchema, false otherwise

isValueTypeSchema

public boolean isValueTypeSchema()
determine if this JsonSchema is an ValueTypeSchema.

Returns:
true if this JsonSchema is an ValueTypeSchema, false otherwise

set$ref

public void set$ref(String $ref)
$ref

Parameters:
$ref - the $ref to set

set$schema

public void set$schema(String $schema)
$schema

Parameters:
$schema - the $schema to set

setDisallow

public void setDisallow(JsonSchema[] disallow)
disallow

Parameters:
disallow - the disallow to set

setExtends

public void setExtends(JsonSchema[] extendsextends)
extendsextends

Parameters:
extendsextends - the extendsextends to set

setId

public void setId(String id)
id

Parameters:
id - the id to set

setRequired

public void setRequired(Boolean required)
required

Parameters:
required - the required to set

minimalForFormat

public static JsonSchema minimalForFormat(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatTypes format)
Create a schema which verifies only that an object is of the given format.

Parameters:
format - the format to expect
Returns:
the schema verifying the given format


Copyright © 2012 fasterxml.com. All Rights Reserved.