]> git.mxchange.org Git - jcore-utils.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 3 Sep 2017 15:56:13 +0000 (17:56 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 3 Sep 2017 15:56:13 +0000 (17:56 +0200)
- 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 <roland@mxchange.org>
lib/cache/cache-api-1.1.0-SNAPSHOT-javadoc.jar [new file with mode: 0644]
lib/cache/cache-api-1.1.0-SNAPSHOT.jar [new file with mode: 0644]
lib/nblibraries.properties
nbproject/project.properties
src/META-INF/beans.xml [new file with mode: 0644]
src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
src/org/mxchange/jcoreee/validator/date/BaseDateValidator.java
src/org/mxchange/jcoreee/validator/number/BaseNumberValidator.java
src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java

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 (file)
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 (file)
index 0000000..ec48e1b
Binary files /dev/null and b/lib/cache/cache-api-1.1.0-SNAPSHOT.jar differ
index db705eb747cb12a5b83d03a250ebafe48138549c..dcfd35d418f4239982b647c56c15f8023cdbe7e0 100644 (file)
@@ -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
index 9da5665ada66debe2b577bffdf5d379196be045c..38ebe6b19d38056e411a3c75ffa4d068a480ebcb 100644 (file)
@@ -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 (file)
index 0000000..a8365bf
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2016, 2017 Roland Häder
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+-->
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+          bean-discovery-mode="annotated">
+</beans>
index 7cbad80942bae6cf74643a9cbda25f280b946643..ebc17f33588bd8ef7fd44cbb915e221b0f6114e2 100644 (file)
@@ -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<roland@mxchange.org>
  */
-public abstract class BaseBooleanValidator extends BaseObjectValidator implements Validator {
+public abstract class BaseBooleanValidator extends BaseObjectValidator<Object> {
 
        /**
         * Serial number
index 37be7f2a8376e9e941936f06690beddc302c8a14..754bb8745015546d1eb0baa38322c2b8262f3cc0 100644 (file)
@@ -29,7 +29,7 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public abstract class BaseDateValidator extends BaseObjectValidator {
+public abstract class BaseDateValidator extends BaseObjectValidator<Object> {
 
        /**
         * Serial number
index f5ddf2250413b84c378b11fa23b7cd1b4bd7e9a0..9cfaed5636ef01f53fb44d72904a4e29025b1b44 100644 (file)
@@ -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;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public abstract class BaseNumberValidator extends BaseObjectValidator implements Validator {
+public abstract class BaseNumberValidator extends BaseObjectValidator<Object> {
 
        /**
         * Serial number
index 84fc78131e4fb5a675b73c743335f8c0f54d448a..c2a7911e44d1186bce1f9740e5fc32165b35f3a4 100644 (file)
@@ -29,7 +29,7 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator;
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
-public abstract class BaseStringValidator extends BaseObjectValidator {
+public abstract class BaseStringValidator extends BaseObjectValidator<Object> {
 
        /**
         * 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
                                }