All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.cnr.contab.anagraf00.util.PartitaIVAControllo Maven / Gradle / Ivy

/*
 * Copyright (C) 2019  Consiglio Nazionale delle Ricerche
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Affero 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
 *     GNU Affero General Public License for more details.
 *
 *     You should have received a copy of the GNU Affero General Public License
 *     along with this program.  If not, see .
 */

package it.cnr.contab.anagraf00.util;

/**
 * Classe per il controllo dell'esattezza della partita i.v.a.
 */

public class PartitaIVAControllo extends CodiceFiscaleControllo {
	 static String CODICE_NON_VALIDO = "Partita IVA non valida: ";
/**
 * Controlla la partita IVA
 *
 * Le stringhe in ingresso sono filtrate sulla base dei dizionari statici impostati nella classe.
 *
 * In particolare viene controllata la lunghezza, il fatto che sia formato solo da numeri 
 * e la correttezza del carattere di controllo finale
 *
 * @param codice codice partita IVA da controllare
 */

 public static int makePartitaIVA_CC(
  String codice
 ) throws ExPartitaIVA {

  if(codice == null)
   throw new ExPartitaIVA(CODICE_NON_VALIDO + "codice nullo!");

  if(codice.length() != 10)
   throw new ExPartitaIVA(CODICE_NON_VALIDO + "lunghezza del codice errata!");

  for(int i=0;i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy