]> git.mxchange.org Git - jcoreee.git/blobdiff - src/org/mxchange/jsfcore/validator/BaseObjectValidator.java
Some improvements
[jcoreee.git] / src / org / mxchange / jsfcore / validator / BaseObjectValidator.java
index c0b5fe5c4abf7db6dcd54c28abf69760750e3d81..4c7e8fbd986c2481d0c8f00f0241c608128d9448 100644 (file)
@@ -56,7 +56,7 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements
                // Is it set?
                if (null == this.getBundle()) {
                        // Set it now
-                       setBundle(ResourceBundle.getBundle("org.mxchange.localization.messages", context.getViewRoot().getLocale()));
+                       setBundle(ResourceBundle.getBundle("org.mxchange.localization.bundle", context.getViewRoot().getLocale()));
                }
        }
 
@@ -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},requiredFields={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,18 +97,19 @@ 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));
-
-                                       // Abort here?
                                }
+
+                               // Abort here
+                               break;
                        }
                }
 
                // Debug message
-               this.getLogger().debug("isValidField=" + isValidField);
+               this.getLogger().debug(MessageFormat.format("isValidField={0}", isValidField)); //NOI18N
 
                // Valid field?
                if (!isValidField) {
@@ -117,7 +118,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 +126,6 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements
                }
 
                // Trace message
-               this.getLogger().trace("EXIT!");
+               this.getLogger().trace("EXIT!"); //NOI18N
        }
 }