]> git.mxchange.org Git - jcore-utils.git/commitdiff
New jar for new jcore added
authorRoland Haeder <roland@mxchange.org>
Thu, 27 Aug 2015 13:33:35 +0000 (15:33 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 27 Aug 2015 13:34:53 +0000 (15:34 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/commons-lang3-3.4.jar [new file with mode: 0644]
lib/jcore.jar
nbproject/project.properties
src/org/mxchange/jsfcore/validator/BaseObjectValidator.java

diff --git a/lib/commons-lang3-3.4.jar b/lib/commons-lang3-3.4.jar
new file mode 100644 (file)
index 0000000..8ec91d4
Binary files /dev/null and b/lib/commons-lang3-3.4.jar differ
index 79c62fe7312fa84c9d7e9ffaa62a99bf9256ee0c..68d453786dc73ac35ef528ce3a68a76f5ba2bc4e 100644 (file)
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
index 946691ceec1b3c2ebf089bd8bf85b8577b1bb942..957a299569837888fee7c575572a124406b1e8ef 100644 (file)
@@ -31,6 +31,7 @@ dist.javadoc.dir=${dist.dir}/javadoc
 endorsed.classpath=
 excludes=
 file.reference.commons-codec-1.10.jar=lib/commons-codec-1.10.jar
+file.reference.commons-lang3-3.4.jar=lib\\commons-lang3-3.4.jar
 file.reference.jcore.jar=lib/jcore.jar
 file.reference.log4j-api-2.3.jar=lib/log4j-api-2.3.jar
 file.reference.log4j-core-2.3.jar=lib/log4j-core-2.3.jar
@@ -41,7 +42,8 @@ javac.classpath=\
     ${file.reference.log4j-api-2.3.jar}:\
     ${file.reference.log4j-core-2.3.jar}:\
     ${file.reference.jcore.jar}:\
-    ${libs.javaee-api-7.0.classpath}
+    ${libs.javaee-api-7.0.classpath}:\
+    ${file.reference.commons-lang3-3.4.jar}
 # Space-separated list of extra javac options
 javac.compilerargs=-Xlint:unchecked
 javac.deprecation=true
index 5cff97546c5965c935e1407eb4683bd7f89021c2..c0b5fe5c4abf7db6dcd54c28abf69760750e3d81 100644 (file)
-/*\r
- * Copyright (C) 2015 Roland Haeder\r
- *\r
- * This program is free software: you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
- */\r
-package org.mxchange.jsfcore.validator;\r
-\r
-import java.text.MessageFormat;\r
-import java.util.Arrays;\r
-import java.util.ResourceBundle;\r
-import javax.faces.application.FacesMessage;\r
-import javax.faces.component.UIComponent;\r
-import javax.faces.context.FacesContext;\r
-import javax.faces.validator.Validator;\r
-import javax.faces.validator.ValidatorException;\r
-import org.mxchange.jcore.BaseFrameworkSystem;\r
-import org.mxchange.jcore.FrameworkInterface;\r
-\r
-/**\r
- * A general object validation class. Please implement javax.faces.validator.Validator\r
- * (with import line!) and call preValidate(). You also may want to try out some\r
- * other BaseFooValidator classes before directly inheriting from this class.\r
- *\r
- * @author Roland Haeder\r
- */\r
-public abstract class BaseObjectValidator extends BaseFrameworkSystem implements FrameworkInterface, Validator {\r
-\r
-       /**\r
-        * Needs to be implemented as the Validator interface needs to be implemented.\r
-        *\r
-        * @param context\r
-        * @param component\r
-        * @param value\r
-        * @throws ValidatorException \r
-        */\r
-       @Override\r
-       abstract public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException;\r
-\r
-       /**\r
-        * Initializes resource bundle\r
-        *\r
-        * @param FacesContext instance\r
-        */\r
-       private void initResourceBundle (final FacesContext context) {\r
-               // Is it set?\r
-               if (null == this.getBundle()) {\r
-                       // Set it now\r
-                       setBundle(ResourceBundle.getBundle("org.mxchange.localization.messages", context.getViewRoot().getLocale()));\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Pre-validation of value, e.g. not null\r
-        *\r
-        * @param context FacesContext instance\r
-        * @param component UIComponent instance\r
-        * @param value Value to check\r
-        * @param requiredFields Array of required field names (ending with)\r
-        * @throws ValidatorException If something more horrible went wrong\r
-        */\r
-       protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {\r
-               // Trace message\r
-               this.getLogger().trace(MessageFormat.format("context={0},component={1},value={2},fields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields)));\r
-\r
-               // Set resource bundle\r
-               this.initResourceBundle(context);\r
-\r
-               // Init message and key\r
-               FacesMessage facesMessage = null;\r
-               String errKey = "error.unknown_id";\r
-\r
-               // Get client id\r
-               String clientId = component.getClientId();\r
-\r
-               // Default is no field is valid\r
-               boolean isValidField = false;\r
-\r
-               for (final String field : requiredFields) {\r
-                       // Get logger\r
-                       this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId));\r
-\r
-                       // Is it the same?\r
-                       if (clientId.endsWith(field)) {\r
-                               // Is valid field\r
-                               isValidField = true;\r
-\r
-                               // Is it null?\r
-                               if (null == value) {\r
-                                       errKey = String.format("error.%s.is_null", field);\r
-\r
-                                       // Value it null\r
-                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));\r
-                               }\r
-                       }\r
-               }\r
-\r
-               // Debug message\r
-               this.getLogger().debug("isValidField=" + isValidField);\r
-\r
-               // Valid field?\r
-               if (!isValidField) {\r
-                       // Invalid field\r
-                       facesMessage = new FacesMessage(MessageFormat.format(errKey, clientId));\r
-               }\r
-\r
-               // Debug message\r
-               this.getLogger().debug(MessageFormat.format("facesMessage={0}", facesMessage));\r
-\r
-               // Is it not null?\r
-               if (null != facesMessage) {\r
-                       throw new ValidatorException(facesMessage);\r
-               }\r
-\r
-               // Trace message\r
-               this.getLogger().trace("EXIT!");\r
-       }\r
-}\r
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * 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/>.
+ */
+package org.mxchange.jsfcore.validator;
+
+import java.text.MessageFormat;
+import java.util.Arrays;
+import java.util.ResourceBundle;
+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.jcore.BaseFrameworkSystem;
+import org.mxchange.jcore.FrameworkInterface;
+
+/**
+ * A general object validation class. Please implement javax.faces.validator.Validator
+ * (with import line!) and call preValidate(). You also may want to try out some
+ * other BaseFooValidator classes before directly inheriting from this class.
+ *
+ * @author Roland Haeder
+ */
+public abstract class BaseObjectValidator extends BaseFrameworkSystem implements FrameworkInterface, Validator {
+
+       /**
+        * Needs to be implemented as the Validator interface needs to be implemented.
+        *
+        * @param context
+        * @param component
+        * @param value
+        * @throws ValidatorException 
+        */
+       @Override
+       abstract public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException;
+
+       /**
+        * Initializes resource bundle
+        *
+        * @param FacesContext instance
+        */
+       private void initResourceBundle (final FacesContext context) {
+               // Is it set?
+               if (null == this.getBundle()) {
+                       // Set it now
+                       setBundle(ResourceBundle.getBundle("org.mxchange.localization.messages", context.getViewRoot().getLocale()));
+               }
+       }
+
+       /**
+        * Pre-validation of value, e.g. not null
+        *
+        * @param context FacesContext instance
+        * @param component UIComponent instance
+        * @param value Value to check
+        * @param requiredFields Array of required field names (ending with)
+        * @throws ValidatorException If something more horrible went wrong
+        */
+       protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("context={0},component={1},value={2},fields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields)));
+
+               // Set resource bundle
+               this.initResourceBundle(context);
+
+               // Init message and key
+               FacesMessage facesMessage = null;
+               String errKey = "error.unknown_id";
+
+               // Get client id
+               String clientId = component.getClientId();
+
+               // Default is no field is valid
+               boolean isValidField = false;
+
+               for (final String field : requiredFields) {
+                       // Get logger
+                       this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId));
+
+                       // Is it the same?
+                       if (clientId.endsWith(field)) {
+                               // Is valid field
+                               isValidField = true;
+
+                               // Is it null?
+                               if (null == value) {
+                                       errKey = String.format("error.%s.is_null", field);
+
+                                       // Value it null
+                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
+
+                                       // Abort here?
+                               }
+                       }
+               }
+
+               // Debug message
+               this.getLogger().debug("isValidField=" + isValidField);
+
+               // Valid field?
+               if (!isValidField) {
+                       // Invalid field
+                       facesMessage = new FacesMessage(MessageFormat.format(errKey, clientId));
+               }
+
+               // Debug message
+               this.getLogger().debug(MessageFormat.format("facesMessage={0}", facesMessage));
+
+               // Is it not null?
+               if (null != facesMessage) {
+                       throw new ValidatorException(facesMessage);
+               }
+
+               // Trace message
+               this.getLogger().trace("EXIT!");
+       }
+}