JsonSchemaValidatorConfig.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */
  20. package org.openspcoop2.utils.json;

  21. import java.util.List;

  22. import com.networknt.schema.SpecVersion;

  23. /**
  24.  * @author Bussu Giovanni (bussu@link.it)
  25.  * @author  $Author$
  26.  * @version $Rev$, $Date$
  27.  *
  28.  */
  29. public class JsonSchemaValidatorConfig {

  30.     public enum ADDITIONAL {DEFAULT, IF_NULL_DISABLE, IF_NULL_STRING, FORCE_DISABLE, FORCE_STRING }
  31.    
  32.     public enum POLITICA_INCLUSIONE_TIPI {DEFAULT, ANY, ALL}
  33.    
  34.     private boolean verbose = false;
  35.     private boolean emitLogError = true;
  36.    
  37.     private ADDITIONAL additionalProperties = ADDITIONAL.DEFAULT;

  38.     private POLITICA_INCLUSIONE_TIPI politicaInclusioneTipi = POLITICA_INCLUSIONE_TIPI.DEFAULT;
  39.    
  40.     private List<String> tipi;

  41.     private SpecVersion.VersionFlag jsonSchemaVersion; // se non fornito viene comprenso dallo schema
  42.    
  43.     public SpecVersion.VersionFlag getJsonSchemaVersion() {
  44.         return this.jsonSchemaVersion;
  45.     }

  46.     public void setJsonSchemaVersion(SpecVersion.VersionFlag jsonSchemaVersion) {
  47.         this.jsonSchemaVersion = jsonSchemaVersion;
  48.     }

  49.     public ADDITIONAL getAdditionalProperties() {
  50.         return this.additionalProperties;
  51.     }

  52.     public void setAdditionalProperties(ADDITIONAL defaultAdditionalProperties) {
  53.         this.additionalProperties = defaultAdditionalProperties;
  54.     }

  55.     public POLITICA_INCLUSIONE_TIPI getPoliticaInclusioneTipi() {
  56.         return this.politicaInclusioneTipi;
  57.     }

  58.     public void setPoliticaInclusioneTipi(POLITICA_INCLUSIONE_TIPI politica) {
  59.         this.politicaInclusioneTipi = politica;
  60.     }

  61.     public List<String> getTipi() {
  62.         return this.tipi;
  63.     }

  64.     public void setTipi(List<String> tipi) {
  65.         this.tipi = tipi;
  66.     }
  67.    
  68.     public boolean isVerbose() {
  69.         return this.verbose;
  70.     }

  71.     public void setVerbose(boolean verbose) {
  72.         this.verbose = verbose;
  73.     }
  74.    
  75.     public boolean isEmitLogError() {
  76.         return this.emitLogError;
  77.     }

  78.     public void setEmitLogError(boolean emitLogError) {
  79.         this.emitLogError = emitLogError;
  80.     }
  81. }