Class NumberChecker
- java.lang.Object
-
- com.itextpdf.text.zugferd.checkers.CodeValidation
-
- com.itextpdf.text.zugferd.checkers.NumberChecker
-
public class NumberChecker extends CodeValidation
Provide a means to check if a String consist of characters from 0 to 9 and a decimal point in case a decimal is expected.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ANY_DECIMALS
static int
FOUR_DECIMALS
static int
INTEGER
static int
TWO_DECIMALS
protected int
type
The type of checker: INTEGER, ANY_DECIMALS, TWO_DECIMALS, FOUR_DECIMALS.
-
Constructor Summary
Constructors Constructor Description NumberChecker(int type)
Creates a specific number checker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValid(java.lang.String code)
Checks if a specific code is valid.-
Methods inherited from class com.itextpdf.text.zugferd.checkers.CodeValidation
check, isLowercase, isNumeric, isUppercase
-
-
-
-
Field Detail
-
INTEGER
public static final int INTEGER
- See Also:
- Constant Field Values
-
ANY_DECIMALS
public static final int ANY_DECIMALS
- See Also:
- Constant Field Values
-
TWO_DECIMALS
public static final int TWO_DECIMALS
- See Also:
- Constant Field Values
-
FOUR_DECIMALS
public static final int FOUR_DECIMALS
- See Also:
- Constant Field Values
-
type
protected int type
The type of checker: INTEGER, ANY_DECIMALS, TWO_DECIMALS, FOUR_DECIMALS.
-
-
Method Detail
-
isValid
public boolean isValid(java.lang.String code)
Description copied from class:CodeValidation
Checks if a specific code is valid.- Specified by:
isValid
in classCodeValidation
- Parameters:
code
- the value you want to check- Returns:
- true if the code is valid
-
-