]> git.mxchange.org Git - jcore-utils.git/commitdiff
Some changes for internationalization + jcore.jar updated
authorRoland Haeder <roland@mxchange.org>
Tue, 1 Sep 2015 06:28:31 +0000 (08:28 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 1 Sep 2015 06:28:31 +0000 (08:28 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jcore.jar
src/org/mxchange/jsfcore/BaseServletSystem.java
src/org/mxchange/jsfcore/validator/BaseObjectValidator.java
src/org/mxchange/jsfcore/validator/string/BaseStringValidator.java
src/org/mxchange/jsfcore/validator/string/names/NameValidator.java

index 9571e27b4e0c4f0608ca9c971502c557b5ec73aa..8b05d574954f3d02853e6d4a7108c1987006d686 100644 (file)
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
index f8bdd74e1f3817c645daa2b2a83304ee1a67e345..b9c52956dd18daf2f85ce383b543a4bb6f18fa38 100644 (file)
@@ -36,7 +36,7 @@ public class BaseServletSystem extends BaseFrameworkSystem {
                // context shall not be null
                if (null == context) {
                        // Abort here
-                       throw new NullPointerException("context is null");
+                       throw new NullPointerException("context is null"); //NOI18N
                }
 
                // We need some properties that needs to be set
index c0b5fe5c4abf7db6dcd54c28abf69760750e3d81..ad4ea8b4bf81c00693d804194b003e77425ac34a 100644 (file)
@@ -71,14 +71,14 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements
         */
        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)));
+               this.getLogger().trace(MessageFormat.format("context={0},component={1},value={2},fields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); //NOI18N
 
                // Set resource bundle
                this.initResourceBundle(context);
 
                // Init message and key
                FacesMessage facesMessage = null;
-               String errKey = "error.unknown_id";
+               String errKey = "error.unknown_id"; //NOI18N
 
                // Get client id
                String clientId = component.getClientId();
@@ -88,7 +88,7 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements
 
                for (final String field : requiredFields) {
                        // Get logger
-                       this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId));
+                       this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId)); //NOI18N
 
                        // Is it the same?
                        if (clientId.endsWith(field)) {
@@ -97,7 +97,7 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements
 
                                // Is it null?
                                if (null == value) {
-                                       errKey = String.format("error.%s.is_null", field);
+                                       errKey = String.format("error.%s.is_null", field); //NOI18N
 
                                        // Value it null
                                        facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
@@ -108,7 +108,7 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements
                }
 
                // Debug message
-               this.getLogger().debug("isValidField=" + isValidField);
+               this.getLogger().debug(MessageFormat.format("isValidField={0}", isValidField)); //NOI18N
 
                // Valid field?
                if (!isValidField) {
@@ -117,7 +117,7 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements
                }
 
                // Debug message
-               this.getLogger().debug(MessageFormat.format("facesMessage={0}", facesMessage));
+               this.getLogger().debug(MessageFormat.format("facesMessage={0}", facesMessage)); //NOI18N
 
                // Is it not null?
                if (null != facesMessage) {
@@ -125,6 +125,6 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements
                }
 
                // Trace message
-               this.getLogger().trace("EXIT!");
+               this.getLogger().trace("EXIT!"); //NOI18N
        }
 }
index 6434cb986728b187fbec907bfd92aae06516a7ed..43aa7c1aac05df1dacc13c730ba2358748b52726 100644 (file)
@@ -1,95 +1,95 @@
-/*\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.string;\r
-\r
-import java.text.MessageFormat;\r
-import java.util.Arrays;\r
-import javax.faces.application.FacesMessage;\r
-import javax.faces.component.UIComponent;\r
-import javax.faces.context.FacesContext;\r
-import javax.faces.validator.ValidatorException;\r
-import org.mxchange.jsfcore.validator.BaseObjectValidator;\r
-\r
-/**\r
- * A general string validation class. You normally want to inherit from this\r
- * class for many form fields, e.g. surname, street name, city name and such.\r
- *\r
- * @author Roland Haeder\r
- */\r
-public abstract class BaseStringValidator extends BaseObjectValidator {\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
-       @Override\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
-               // Pre-validate (e.g. on null)\r
-               super.preValidate(context, component, value, requiredFields);\r
-\r
-               // Get client id and init message + key\r
-               String clientId = component.getClientId();\r
-               FacesMessage facesMessage = null;\r
-               String errKey;\r
-\r
-               // So far all fine!\r
-               for (final String field : requiredFields) {\r
-                       // Debug message\r
-                       this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId));\r
-\r
-                       // Is it the same?\r
-                       if (clientId.endsWith(field)) {\r
-                               if (!(value instanceof String)) {\r
-                                       // Value is empty\r
-                                       errKey = String.format("error.%s.is_not_string", field);\r
-\r
-                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));\r
-                               }\r
-\r
-                               // Cast to string\r
-                               String str = (String) value;\r
-\r
-                               // Is it empty?\r
-                               if (str.isEmpty()) {\r
-                                       // Value is empty\r
-                                       errKey = String.format("error.%s.is_empty", field);\r
-\r
-                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));\r
-                               }\r
-                       }\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.string;
+
+import java.text.MessageFormat;
+import java.util.Arrays;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.ValidatorException;
+import org.mxchange.jsfcore.validator.BaseObjectValidator;
+
+/**
+ * A general string validation class. You normally want to inherit from this
+ * class for many form fields, e.g. surname, street name, city name and such.
+ *
+ * @author Roland Haeder
+ */
+public abstract class BaseStringValidator extends BaseObjectValidator {
+
+       /**
+        * 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
+        */
+       @Override
+       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))); //NOI18N
+
+               // Pre-validate (e.g. on null)
+               super.preValidate(context, component, value, requiredFields);
+
+               // Get client id and init message + key
+               String clientId = component.getClientId();
+               FacesMessage facesMessage = null;
+               String errKey;
+
+               // So far all fine!
+               for (final String field : requiredFields) {
+                       // Debug message
+                       this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId)); //NOI18N
+
+                       // Is it the same?
+                       if (clientId.endsWith(field)) {
+                               if (!(value instanceof String)) {
+                                       // Value is empty
+                                       errKey = String.format("error.%s.is_not_string", field); //NOI18N
+
+                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
+                               }
+
+                               // Cast to string
+                               String str = (String) value;
+
+                               // Is it empty?
+                               if (str.isEmpty()) {
+                                       // Value is empty
+                                       errKey = String.format("error.%s.is_empty", field); //NOI18N
+
+                                       facesMessage = new FacesMessage(this.getMessageStringFromKey(errKey));
+                               }
+                       }
+               }
+
+               // Debug message
+               this.getLogger().debug(MessageFormat.format("facesMessage={0}", facesMessage)); //NOI18N
+
+               // Is it not null?
+               if (null != facesMessage) {
+                       throw new ValidatorException(facesMessage);
+               }
+
+               // Trace message
+               this.getLogger().trace("EXIT!"); //NOI18N
+       }
+}
index 45b4cf7919c1acc96fe81da44561c93dd116f71a..4186545492cc8301c97ce1c0acc77c965134771d 100644 (file)
@@ -1,46 +1,46 @@
-/*\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.string.names;\r
-\r
-import java.text.MessageFormat;\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.jsfcore.validator.string.BaseStringValidator;\r
-\r
-/**\r
- * A validation class for names, such as first name or family name.\r
- *\r
- * @author Roland Haeder\r
- */\r
-public class NameValidator extends BaseStringValidator implements Validator {\r
-       @Override\r
-       public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {\r
-               // Trace message\r
-               this.getLogger().trace(MessageFormat.format("context={0},component={1},value={2} - CALLED!", context, component, value));\r
-\r
-               // All accepted, required fields\r
-               String[] requiredFileds = {"firstName", "familyName"};\r
-\r
-               // Pre-validation (e.g. not null, not a string, empty string ...)\r
-               super.preValidate(context, component, value, requiredFileds);\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.string.names;
+
+import java.text.MessageFormat;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import org.mxchange.jsfcore.validator.string.BaseStringValidator;
+
+/**
+ * A validation class for names, such as first name or family name.
+ *
+ * @author Roland Haeder
+ */
+public class NameValidator extends BaseStringValidator implements Validator {
+       @Override
+       public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("context={0},component={1},value={2} - CALLED!", context, component, value)); //NOI18N
+
+               // All accepted, required fields
+               String[] requiredFileds = {"firstName", "familyName"}; //NOI18N
+
+               // Pre-validation (e.g. not null, not a string, empty string ...)
+               super.preValidate(context, component, value, requiredFileds);
+
+               // Trace message
+               this.getLogger().trace("EXIT!"); //NOI18N
+       }
+}