
com.github.fge.jsonschema.library.LibraryBuilder Maven / Gradle / Ivy
/*
* 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
* 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 .
*/
package com.github.fge.jsonschema.library;
import com.github.fge.jsonschema.format.FormatAttribute;
import com.github.fge.jsonschema.keyword.digest.Digester;
import com.github.fge.jsonschema.keyword.syntax.SyntaxChecker;
import com.github.fge.jsonschema.keyword.validator.KeywordValidator;
import com.github.fge.jsonschema.util.Thawed;
import java.lang.reflect.Constructor;
public final class LibraryBuilder
implements Thawed
{
DictionaryBuilder syntaxCheckers;
DictionaryBuilder digesters;
DictionaryBuilder> validators;
DictionaryBuilder formatAttributes;
LibraryBuilder()
{
syntaxCheckers = Dictionary.newBuilder();
digesters = Dictionary.newBuilder();
validators = Dictionary.newBuilder();
formatAttributes = Dictionary.newBuilder();
}
LibraryBuilder(final Library library)
{
syntaxCheckers = library.syntaxCheckers.thaw();
digesters = library.digesters.thaw();
validators = library.validators.thaw();
formatAttributes = library.formatAttributes.thaw();
}
@Override
public Library freeze()
{
return new Library(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy