/**
 * 
 */
package tool.regEx;

import java.text.Normalizer;
/******************************************************************************
 * DataNormalizer (toolbox Pattern)
 * 
 * toutes les données doivent être exclusivement en majuscule
 * les accents sont prohibé
 * les apostrophe sont prohibé
 * les tirets sont accepté
 *  
 * 
 * Projet Orford
 *****************************************************************************
 *modification
 *nom date     explication
 *martin 2 sept  retourner null si la valeurs est "" (denullification)
 ****************************************************************************/
/**
 * @author alexis
 *
 */
public class DataNormalizer{

	/**
	 * constructeur priver
	 */
	private DataNormalizer() {}
	
	/**
	 * Normalize le text selon certain critere
	 * @param text String
	 * @return String du text sans accent, sans "'" et en majuscule
	 */
	public static String normalize(String text){
		if (text == null)
			return "";
		return Normalizer.normalize(text.toLowerCase(), Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "").replaceAll("'|�", "").toUpperCase();
	}
}
