Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   * Copyright (c) 2013, Francis Galiegue <>
   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the Lesser GNU General Public License as
   * published by the Free Software Foundation, either version 3 of the
   * License, or (at your option) any later version.
   * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * Lesser GNU General Public License for more details.
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <>.
 package com.github.fge.jsonschema.metaschema;
 import java.util.Map;

Enumeration of builtin metaschemas

This enum centralizes all metaschemas defined by the different JSON Schema specifications (draft v3 and draft v4).

 public enum BuiltinSchemas
Draft v3 core schema
         "draft v3 core schema", KeywordRegistries.draftV3Core()),
Draft v4 core schema
         "draft v4 core schema", KeywordRegistries.draftV4Core()),
Draft v3 LDO (Link Description Object) schema
         "draft v3 link description object (LDO) schema",
Draft v3 hyper-schema
         "/draftv3/hyper-schema""draft v3 hyper schema",
     private final JsonRef locator;
     private final JsonNode rawSchema;
     private final String desc;
     // The following are package-visible to allow direct access by MetaSchema
     final Map<StringSyntaxCheckercheckers;
     final Map<StringClass<? extends KeywordValidator>> validators;
     BuiltinSchemas(final String urifinal String resourcefinal String desc,
         final KeywordRegistry registry)
         try {
              = JsonRef.fromString(uri);
              = JsonLoader.fromResource(resource);
         } catch (JsonSchemaException e) {
             throw new ExceptionInInitializerError(e);
         } catch (IOException e) {
             throw new ExceptionInInitializerError(e);
         this. = desc;
         // All .get() methods return immutable map instances, but that is
         // no less ugly
          = registry.getSyntaxCheckers();
          = registry.getValidators();
          = registry.getFormatAttributes();

Return the default metaschema (currently DRAFTV3_HYPERSCHEMA

a BuiltinSchemas instance
     public static BuiltinSchemas byDefault()
         return ;

Get the locator for this schema

the locator as a URI
    public URI getURI()
        return .toURI();

Get the raw JSON document for that schema

    public JsonNode getRawSchema()
        return ;
    public String toString()
        return  + " (" +  + ')';
New to GrepCode? Check out our FAQ X