diff options
author | tkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459> | 2012-08-01 09:10:43 +0000 |
---|---|---|
committer | tkellner <tkellner@3a0b52a2-8410-0410-bc02-ff6273a87459> | 2012-08-01 09:10:43 +0000 |
commit | 2c398de4ce47e3725da3f544a5da7e1b62c0156a (patch) | |
tree | 96b03fa1dc895e5db1cde515d0771bd2d7bcf1ec /Spezifikation/PDFSignator Schnittstelle/src/at/asit/pdfover/pdfsignator/profileproperties/validators/IntegerRangeValidator.java | |
parent | 91841d3a3dfaeb272e60c35dda7362e63d6e42e5 (diff) | |
download | pdf-over-2c398de4ce47e3725da3f544a5da7e1b62c0156a.tar.gz pdf-over-2c398de4ce47e3725da3f544a5da7e1b62c0156a.tar.bz2 pdf-over-2c398de4ce47e3725da3f544a5da7e1b62c0156a.zip |
Removed old spezification projekt
git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12242 3a0b52a2-8410-0410-bc02-ff6273a87459
Diffstat (limited to 'Spezifikation/PDFSignator Schnittstelle/src/at/asit/pdfover/pdfsignator/profileproperties/validators/IntegerRangeValidator.java')
-rw-r--r-- | Spezifikation/PDFSignator Schnittstelle/src/at/asit/pdfover/pdfsignator/profileproperties/validators/IntegerRangeValidator.java | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/Spezifikation/PDFSignator Schnittstelle/src/at/asit/pdfover/pdfsignator/profileproperties/validators/IntegerRangeValidator.java b/Spezifikation/PDFSignator Schnittstelle/src/at/asit/pdfover/pdfsignator/profileproperties/validators/IntegerRangeValidator.java deleted file mode 100644 index 504cb482..00000000 --- a/Spezifikation/PDFSignator Schnittstelle/src/at/asit/pdfover/pdfsignator/profileproperties/validators/IntegerRangeValidator.java +++ /dev/null @@ -1,58 +0,0 @@ -package at.asit.pdfover.pdfsignator.profileproperties.validators; - -import at.asit.pdfover.pdfsignator.InvalidPropertyTypeException; -import at.asit.pdfover.pdfsignator.InvalidPropertyValueException; -import at.asit.pdfover.pdfsignator.profileproperties.IntegerProfileProperty; -import at.asit.pdfover.pdfsignator.profileproperties.ProfileProperty; - -public class IntegerRangeValidator extends PropertyValidator { - - /** - * Maximum value of property - */ - protected int max; - - /** - * Minimum value of property - */ - protected int min; - - /** - * Constructor - * @param min The minimum allowed value - * @param max The maximum allowed value - */ - public IntegerRangeValidator(int min, int max) { - this.max = max; - this.min = min; - } - - @Override - public void validate(ProfileProperty property) - throws InvalidPropertyValueException, InvalidPropertyTypeException { - this.CheckPropertyType(property); - - IntegerProfileProperty prop = (IntegerProfileProperty) property; - - if(prop.GetValue() == null) - { - throw new InvalidPropertyValueException(property, "Value is not set!"); - } - - int value = prop.GetValue(); - - if(value < min || value > max) { - throw new InvalidPropertyValueException(property, - String.format("Value has to be between %d and %d", min, max)); - } - } - - @Override - public void CheckPropertyType(ProfileProperty property) - throws InvalidPropertyTypeException { - if(!(property instanceof IntegerProfileProperty)) { - throw new InvalidPropertyTypeException(property, this); - } - } - -} |