Package com.github.fge.jsonschema.core.load.uri

Examples of com.github.fge.jsonschema.core.load.uri.URITranslatorConfigurationBuilder


         * @throws IllegalStateException if {@link #setSchemaLocation(String)} was not invoked
         */
        public JsonSchemaValidator build()
        {
            checkState(schemaLocation != null, "schemaLocation has not been provided");
            final URITranslatorConfigurationBuilder translatorConfigurationBuilder = URITranslatorConfiguration.newBuilder();
            for (Map.Entry<String, String> redirect : schemaRedirects.entrySet())
            {
                translatorConfigurationBuilder.addSchemaRedirect(redirect.getKey(), redirect.getValue());
            }

            final LoadingConfigurationBuilder loadingConfigurationBuilder = LoadingConfiguration.newBuilder()
                    .dereferencing(dereferencing == JsonSchemaDereferencing.CANONICAL
                                   ? Dereferencing.CANONICAL
                                   : Dereferencing.INLINE)
                    .setURITranslatorConfiguration(translatorConfigurationBuilder.freeze());

            JsonSchemaFactory factory = JsonSchemaFactory.newBuilder()
                    .setLoadingConfiguration(loadingConfigurationBuilder.freeze())
                    .freeze();

View Full Code Here


    }

    Main(final String fakeRoot)
        throws IOException
    {
        final URITranslatorConfigurationBuilder builder
            = URITranslatorConfiguration.newBuilder()
                .setNamespace(getCwd());
        if (fakeRoot != null)
            builder.addPathRedirect(fakeRoot, getCwd());
        final LoadingConfiguration cfg = LoadingConfiguration.newBuilder()
            .setURITranslatorConfiguration(builder.freeze()).freeze();
        factory = JsonSchemaFactory.newBuilder()
            .setLoadingConfiguration(cfg).freeze();
        syntaxValidator = factory.getSyntaxValidator();
    }
View Full Code Here

TOP

Related Classes of com.github.fge.jsonschema.core.load.uri.URITranslatorConfigurationBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.