Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (c) 2013, Francis Galiegue <fgaliegue@gmail.com>
   *
   * 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
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * 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 <http://www.gnu.org/licenses/>.
  */
 
 package com.github.fge.jsonschema.main;
 
 
 import static com.github.fge.jsonschema.messages.ConfigurationMessages.*;

Thawed instance of a JsonSchemaFactory

This is the class you will use to configure a schema factory before use, should you need to. In most cases, the default factory will be enough.

In order to obtain an instance of this builder class, use JsonSchemaFactory.newBuilder().

 
 public final class JsonSchemaFactoryBuilder
     implements Thawed<JsonSchemaFactory>
 {
A builder with the default configuration

 
     {
          = LoadingConfiguration.byDefault();
          = ValidationConfiguration.byDefault();
     }

    
A builder spawned from an existing JsonSchemaFactory

Parameters:
factory the factory
See also:
JsonSchemaFactory.thaw()
 
     {
          = factory.reportProvider;
          = factory.loadingCfg;
          = factory.validationCfg;
     }

    
Set a new report provider for this factory

Parameters:
reportProvider the report provider
Returns:
this
Throws:
com.github.fge.jsonschema.exceptions.unchecked.FactoryConfigurationError provider is null
 
         final ReportProvider reportProvider)
     {
         if (reportProvider == null)
             throw new FactoryConfigurationError(new ProcessingMessage()
                 .message());
         this. = reportProvider;
         return this;
     }

    
Set a new loading configuration for this factory

Parameters:
loadingCfg the loading configuration
Returns:
this
Throws:
com.github.fge.jsonschema.exceptions.unchecked.FactoryConfigurationError configuration is null
        final LoadingConfiguration loadingCfg)
    {
        if (loadingCfg == null)
            throw new FactoryConfigurationError(new ProcessingMessage()
                .message());
        this. = loadingCfg;
        return this;
    }

    
Set a new validation configuration for this factory

Parameters:
validationCfg the validation configuration
Returns:
this
Throws:
com.github.fge.jsonschema.exceptions.unchecked.FactoryConfigurationError configuration is null
        final ValidationConfiguration validationCfg)
    {
        if (validationCfg == null)
            throw new FactoryConfigurationError(new ProcessingMessage()
                .message());
        this. = validationCfg;
        return this;
    }

    
Build a frozen instance of this factory configuration

    @Override
    public JsonSchemaFactory freeze()
    {
        return new JsonSchemaFactory(this);
    }
New to GrepCode? Check out our FAQ X