it.eng.spago.validation
Class SyntaxChecker
java.lang.Object
it.eng.spago.validation.SyntaxChecker
- public class SyntaxChecker
- extends java.lang.Object
Method Summary |
static boolean |
allOrNo(java.lang.String[] params,
java.lang.String paramsNames,
EMFErrorHandler errorHandler)
Torna true se i parametri params sono tutti valorizzati o tutti nulli
(ovvero stringa vuota) |
static boolean |
check(boolean mandatory,
int maxlength,
int tipoCampo,
java.lang.String value,
java.lang.String nomeCampo,
java.lang.String range,
int cifreDecimali,
int maxCifreDecimali,
EMFErrorHandler errorHandler)
Method check. |
static boolean |
dependence(java.lang.String[] paramsCondition,
java.lang.String[] paramsConsequence,
boolean bAndCondition,
boolean bAndConsequence,
java.lang.String ConditionNames,
java.lang.String ConsequenceNames,
EMFErrorHandler errorHandler)
Caso 1: bAndCondition=true;bAndConsequence=true;
Se tutti i valori di paramsCondition sono non vuoti
allora tutti i valori di paramsConsequence devono essere non vuoti
Caso 2: bAndCondition=true;bAndConsequence=false;
Se tutti i valori di paramsCondition sono non vuoti
allora almeno un valore di paramsConsequence deve essere non vuoto
Caso 3: bAndCondition=false;bAndConsequence=true;
Se almeno un valore di paramsCondition è non vuoto
allora tutti i valori di paramsConsequence devono essere non vuoti
Caso 4: bAndCondition=false;bAndConsequence=false;
Se almeno un valore di paramsCondition è non vuoto
allora almeno un valore di paramsConsequence deve essere non vuoto |
static java.lang.String |
riempiZero(java.lang.String value,
int lng)
Aggiunge a sinistra della stringa di input un numero
di zeri pari alla lunghezza specificata meno la
lunghezza della stringa. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CAMPO_GENERICO
public static final int CAMPO_GENERICO
- See Also:
- Constant Field Values
CAMPO_CODICE_FISCALE
public static final int CAMPO_CODICE_FISCALE
- See Also:
- Constant Field Values
CAMPO_EMAIL
public static final int CAMPO_EMAIL
- See Also:
- Constant Field Values
CAMPO_SITO
public static final int CAMPO_SITO
- See Also:
- Constant Field Values
CAMPO_DATA
public static final int CAMPO_DATA
- See Also:
- Constant Field Values
CAMPO_NUMERICO
public static final int CAMPO_NUMERICO
- See Also:
- Constant Field Values
CAMPO_ALFANUMERICO
public static final int CAMPO_ALFANUMERICO
- See Also:
- Constant Field Values
CAMPO_LETTERALE
public static final int CAMPO_LETTERALE
- See Also:
- Constant Field Values
CAMPO_RANGE
public static final int CAMPO_RANGE
- See Also:
- Constant Field Values
CAMPO_RE
public static final int CAMPO_RE
- See Also:
- Constant Field Values
CAMPO_IMPORTO
public static final int CAMPO_IMPORTO
- See Also:
- Constant Field Values
CAMPO_NOMINATIVO
public static final int CAMPO_NOMINATIVO
- See Also:
- Constant Field Values
reDigit
public static final java.lang.String reDigit
- See Also:
- Constant Field Values
reEmail
public static final java.lang.String reEmail
- See Also:
- Constant Field Values
reSito
public static final java.lang.String reSito
- See Also:
- Constant Field Values
reCodiceFiscale
public static final java.lang.String reCodiceFiscale
- See Also:
- Constant Field Values
reLetterale
public static final java.lang.String reLetterale
- See Also:
- Constant Field Values
reAlfanumerico
public static final java.lang.String reAlfanumerico
- See Also:
- Constant Field Values
reNominativo
public static final java.lang.String reNominativo
- See Also:
- Constant Field Values
ERRORE_CAMPO_OBBLIGATORIO
public static final int ERRORE_CAMPO_OBBLIGATORIO
- See Also:
- Constant Field Values
ERRORE_CAMPO_CODICE_FISCALE
public static final int ERRORE_CAMPO_CODICE_FISCALE
- See Also:
- Constant Field Values
ERRORE_CAMPO_PARTITA_IVA
public static final int ERRORE_CAMPO_PARTITA_IVA
- See Also:
- Constant Field Values
ERRORE_CAMPO_EMAIL
public static final int ERRORE_CAMPO_EMAIL
- See Also:
- Constant Field Values
ERRORE_CAMPO_SITO
public static final int ERRORE_CAMPO_SITO
- See Also:
- Constant Field Values
ERRORE_CAMPO_DATA
public static final int ERRORE_CAMPO_DATA
- See Also:
- Constant Field Values
ERRORE_CAMPO_NUMERICO
public static final int ERRORE_CAMPO_NUMERICO
- See Also:
- Constant Field Values
ERRORE_CAMPO_ALFANUMRICO
public static final int ERRORE_CAMPO_ALFANUMRICO
- See Also:
- Constant Field Values
ERRORE_CAMPO_LETTERALE
public static final int ERRORE_CAMPO_LETTERALE
- See Also:
- Constant Field Values
ERRORE_CAMPO_RANGE
public static final int ERRORE_CAMPO_RANGE
- See Also:
- Constant Field Values
ERRORE_CAMPO_RE
public static final int ERRORE_CAMPO_RE
- See Also:
- Constant Field Values
ERRORE_CAMPO_IMPORTO
public static final int ERRORE_CAMPO_IMPORTO
- See Also:
- Constant Field Values
ERRORE_CODICE_CONTROLLO
public static final int ERRORE_CODICE_CONTROLLO
- See Also:
- Constant Field Values
ERRORE_CAMPO_NOMINATIVO
public static final int ERRORE_CAMPO_NOMINATIVO
- See Also:
- Constant Field Values
ERRORE_CIFRE_DECIMALI
public static final int ERRORE_CIFRE_DECIMALI
- See Also:
- Constant Field Values
ERRORE_CODICE_DIPENDENZE
public static final int ERRORE_CODICE_DIPENDENZE
- See Also:
- Constant Field Values
ERRORE_CODICE_ALL_OR_NO
public static final int ERRORE_CODICE_ALL_OR_NO
- See Also:
- Constant Field Values
ERRORE_MAXLENGTH
public static final int ERRORE_MAXLENGTH
- See Also:
- Constant Field Values
DEFAULT_RANGE
public static final java.lang.String DEFAULT_RANGE
- See Also:
- Constant Field Values
DEFAULT_CIFREDECIMALI
public static final int DEFAULT_CIFREDECIMALI
- See Also:
- Constant Field Values
DEFAULT_MAXCIFREDECIMALI
public static final int DEFAULT_MAXCIFREDECIMALI
- See Also:
- Constant Field Values
SyntaxChecker
public SyntaxChecker()
check
public static boolean check(boolean mandatory,
int maxlength,
int tipoCampo,
java.lang.String value,
java.lang.String nomeCampo,
java.lang.String range,
int cifreDecimali,
int maxCifreDecimali,
EMFErrorHandler errorHandler)
- Method check. Verifica la validità di un campo di input.
- Parameters:
mandatory
- true se è il campo è obbligatorio, false altrimenti.tipoCampo
- tipo del campo, deve essere uno dei valori CAMPO_CODICE_FISCALE..CAMPO_DATAvalue
- valore da verificare
- Returns:
- boolean true se il campo supera i controlli formali, false altrimenti
dependence
public static boolean dependence(java.lang.String[] paramsCondition,
java.lang.String[] paramsConsequence,
boolean bAndCondition,
boolean bAndConsequence,
java.lang.String ConditionNames,
java.lang.String ConsequenceNames,
EMFErrorHandler errorHandler)
- Caso 1: bAndCondition=true;bAndConsequence=true;
Se tutti i valori di paramsCondition sono non vuoti
allora tutti i valori di paramsConsequence devono essere non vuoti
Caso 2: bAndCondition=true;bAndConsequence=false;
Se tutti i valori di paramsCondition sono non vuoti
allora almeno un valore di paramsConsequence deve essere non vuoto
Caso 3: bAndCondition=false;bAndConsequence=true;
Se almeno un valore di paramsCondition è non vuoto
allora tutti i valori di paramsConsequence devono essere non vuoti
Caso 4: bAndCondition=false;bAndConsequence=false;
Se almeno un valore di paramsCondition è non vuoto
allora almeno un valore di paramsConsequence deve essere non vuoto
allOrNo
public static boolean allOrNo(java.lang.String[] params,
java.lang.String paramsNames,
EMFErrorHandler errorHandler)
- Torna true se i parametri params sono tutti valorizzati o tutti nulli
(ovvero stringa vuota)
riempiZero
public static java.lang.String riempiZero(java.lang.String value,
int lng)
- Aggiunge a sinistra della stringa di input un numero
di zeri pari alla lunghezza specificata meno la
lunghezza della stringa.