com.github.fge.jsonschema
Enum SchemaVersion

java.lang.Object
  extended by java.lang.Enum<SchemaVersion>
      extended by com.github.fge.jsonschema.SchemaVersion
All Implemented Interfaces:
Serializable, Comparable<SchemaVersion>

public enum SchemaVersion
extends Enum<SchemaVersion>

JSON Schema versions

Members of this enum offer two informations about JSON Schemas:


Enum Constant Summary
DRAFTV3
          Draft v3
DRAFTV4
          Draft v4 (default version)
DRAFTV4_HYPERSCHEMA
          Draft v4 hyperschema
 
Method Summary
 URI getLocation()
          Return the value of $schema as a JsonRef
 JsonNode getSchema()
          Return the meta schema as JSON
static SchemaVersion valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SchemaVersion[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DRAFTV4

public static final SchemaVersion DRAFTV4
Draft v4 (default version)


DRAFTV3

public static final SchemaVersion DRAFTV3
Draft v3


DRAFTV4_HYPERSCHEMA

public static final SchemaVersion DRAFTV4_HYPERSCHEMA
Draft v4 hyperschema

Method Detail

values

public static SchemaVersion[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SchemaVersion c : SchemaVersion.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SchemaVersion valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getLocation

public URI getLocation()
Return the value of $schema as a JsonRef

Returns:
the JSON Reference for that schema version

getSchema

public JsonNode getSchema()
Return the meta schema as JSON

Note: since JsonNode is mutable, this method returns a copy.

Returns:
the meta schema
See Also:
JsonNode.deepCopy()