Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright (c) 2012, 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.examples;
Base abstract class for all examples
public abstract class ExampleBase
    private static final String PKGBASE;
    static {
        final String pkgName = ExampleBase.class.getPackage().getName();
         = '/' + pkgName.replace(".""/");

Print a validation report to stdout

Will print whether validation succeeded. In the event of a failure, dumps validation error messages.

report the report
    protected static void printReport(final ProcessingReport report)
        final boolean success = report.isSuccess();
        ..println("Validation " + (success ? "succeeded" : "failed"));
        if (!success) {
            ..println("---- BEGIN REPORT ----");
            for (final ProcessingMessage message : report)
            ..println("---- END REPORT ----");

Load one resource from the current package as a com.fasterxml.jackson.databind.JsonNode

name name of the resource (MUST start with /
a JSON document
Throws: resource not found
    protected static JsonNode loadResource(final String name)
        throws IOException
        return JsonLoader.fromResource( + name);
New to GrepCode? Check out our FAQ X