From: Roland Häder Date: Sun, 3 Sep 2017 15:56:13 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=40251ba7caf5a0cd4f3ee84e9968784fc7233206;p=jcore-utils.git Please cherry-pick: - removed repeated interface Validator and added generic on Object instead making the Java compiler happy again - added beans.xml but it didn't help CDI finding any factory/producer here - added new depdendency cache-api (jcache) including javadoc JAR Signed-off-by: Roland Häder --- diff --git a/lib/cache/cache-api-1.1.0-SNAPSHOT-javadoc.jar b/lib/cache/cache-api-1.1.0-SNAPSHOT-javadoc.jar new file mode 100644 index 0000000..55d7a1c Binary files /dev/null and b/lib/cache/cache-api-1.1.0-SNAPSHOT-javadoc.jar differ diff --git a/lib/cache/cache-api-1.1.0-SNAPSHOT.jar b/lib/cache/cache-api-1.1.0-SNAPSHOT.jar new file mode 100644 index 0000000..ec48e1b Binary files /dev/null and b/lib/cache/cache-api-1.1.0-SNAPSHOT.jar differ diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties index db705eb..dcfd35d 100644 --- a/lib/nblibraries.properties +++ b/lib/nblibraries.properties @@ -1,7 +1,12 @@ +libs.cache.javadoc=\ + ${base}/cache/cache-api-1.1.0-SNAPSHOT-javadoc.jar!// libs.CopyLibs.classpath=\ ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar libs.CopyLibs.displayName=CopyLibs Task libs.CopyLibs.prop-version=2.0 +libs.cache.classpath=\ + ${base}/cache/cache-api-1.1.0-SNAPSHOT.jar +libs.cache.displayName=Cache 1.1.0 libs.javaee-api-7.0.classpath=\ ${base}/javaee-api-7.0/javaee-api-7.0.jar libs.javaee-api-7.0.displayName=Java EE 7 API Library diff --git a/nbproject/project.properties b/nbproject/project.properties index 9da5665..38ebe6b 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -37,7 +37,8 @@ jar.compress=false jar.index=${jnlp.enabled} javac.classpath=\ ${file.reference.jcore-logger-lib.jar}:\ - ${libs.javaee-api-7.0.classpath} + ${libs.javaee-api-7.0.classpath}:\ + ${libs.cache.classpath} # Space-separated list of extra javac options javac.compilerargs=-Xlint:unchecked -Xlint:deprecation javac.deprecation=true diff --git a/src/META-INF/beans.xml b/src/META-INF/beans.xml new file mode 100644 index 0000000..a8365bf --- /dev/null +++ b/src/META-INF/beans.xml @@ -0,0 +1,22 @@ + + + + diff --git a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java index 7cbad80..ebc17f3 100644 --- a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java +++ b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java @@ -22,7 +22,6 @@ import javax.faces.component.UIComponent; import javax.faces.component.UIInput; import javax.faces.component.ValueHolder; import javax.faces.context.FacesContext; -import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; import org.mxchange.jcoreee.validator.BaseObjectValidator; @@ -32,7 +31,7 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator; * @author BalusC * @author Roland Häder */ -public abstract class BaseBooleanValidator extends BaseObjectValidator implements Validator { +public abstract class BaseBooleanValidator extends BaseObjectValidator { /** * Serial number diff --git a/src/org/mxchange/jcoreee/validator/date/BaseDateValidator.java b/src/org/mxchange/jcoreee/validator/date/BaseDateValidator.java index 37be7f2..754bb87 100644 --- a/src/org/mxchange/jcoreee/validator/date/BaseDateValidator.java +++ b/src/org/mxchange/jcoreee/validator/date/BaseDateValidator.java @@ -29,7 +29,7 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator; *

* @author Roland Häder */ -public abstract class BaseDateValidator extends BaseObjectValidator { +public abstract class BaseDateValidator extends BaseObjectValidator { /** * Serial number diff --git a/src/org/mxchange/jcoreee/validator/number/BaseNumberValidator.java b/src/org/mxchange/jcoreee/validator/number/BaseNumberValidator.java index f5ddf22..9cfaed5 100644 --- a/src/org/mxchange/jcoreee/validator/number/BaseNumberValidator.java +++ b/src/org/mxchange/jcoreee/validator/number/BaseNumberValidator.java @@ -20,7 +20,6 @@ import java.text.MessageFormat; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; -import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; import org.mxchange.jcoreee.validator.BaseObjectValidator; @@ -29,7 +28,7 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator; *

* @author Roland Häder */ -public abstract class BaseNumberValidator extends BaseObjectValidator implements Validator { +public abstract class BaseNumberValidator extends BaseObjectValidator { /** * Serial number diff --git a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java index 84fc781..c2a7911 100644 --- a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java +++ b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java @@ -29,7 +29,7 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator; *

* @author Roland Häder */ -public abstract class BaseStringValidator extends BaseObjectValidator { +public abstract class BaseStringValidator extends BaseObjectValidator { /** * Serial number @@ -65,7 +65,10 @@ public abstract class BaseStringValidator extends BaseObjectValidator { String str = (String) value; // Is it empty? - if (str.isEmpty()) { + if ((!allowNull) && (null == str)) { + // Empty strings are currently not accepted, may indicate flaw in invoker + requiredMessage = MessageFormat.format("Field {0} is null.", field); //NOI18N + } else if ((!allowNull) && (str.isEmpty())) { // Empty strings are currently not accepted, may indicate flaw in invoker requiredMessage = MessageFormat.format("Field {0} is empty.", field); //NOI18N }