com.github.fge.jsonschema.core.load
Enum Dereferencing

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

public enum Dereferencing
extends Enum<Dereferencing>

Dereferencing modes

Draft v4 defines two dereferencing modes: canonical and inline. This enum defines those two modes, along with methods to generate appropriate schema trees.

See Also:
InlineSchemaTree, CanonicalSchemaTree

Enum Constant Summary
CANONICAL
          Canonical dereferencing
INLINE
          Inline dereferencing
 
Method Summary
 SchemaTree newTree(JsonNode node)
          Create a new schema tree with an empty loading URI
abstract  SchemaTree newTree(JsonRef ref, JsonNode node)
          Create a new schema tree with a given loading URI and JSON Schema
 String toString()
           
static Dereferencing valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Dereferencing[] 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, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CANONICAL

public static final Dereferencing CANONICAL
Canonical dereferencing

See Also:
CanonicalSchemaTree

INLINE

public static final Dereferencing INLINE
Inline dereferencing

See Also:
InlineSchemaTree
Method Detail

values

public static Dereferencing[] 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 (Dereferencing c : Dereferencing.values())
    System.out.println(c);

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

valueOf

public static Dereferencing 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

newTree

public abstract SchemaTree newTree(JsonRef ref,
                                   JsonNode node)
Create a new schema tree with a given loading URI and JSON Schema

Parameters:
ref - the location
node - the schema
Returns:
a new tree

newTree

public SchemaTree newTree(JsonNode node)
Create a new schema tree with an empty loading URI

Parameters:
node - the schema
Returns:
a new tree

toString

public String toString()
Overrides:
toString in class Enum<Dereferencing>