From: Roland Haeder Date: Tue, 25 Aug 2015 16:06:32 +0000 (+0200) Subject: Renamed variable to make it more clear X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0a3420c55042ece2ec4b8e33751d4924b232fb68;p=jcoreee.git Renamed variable to make it more clear Signed-off-by:Roland Haeder --- diff --git a/src/org/mxchange/jsfcore/validator/BaseObjectValidator.java b/src/org/mxchange/jsfcore/validator/BaseObjectValidator.java index 30d45f2..5cff975 100644 --- a/src/org/mxchange/jsfcore/validator/BaseObjectValidator.java +++ b/src/org/mxchange/jsfcore/validator/BaseObjectValidator.java @@ -66,12 +66,12 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements * @param context FacesContext instance * @param component UIComponent instance * @param value Value to check - * @param fields Array of valid field names (ending with) + * @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[] fields) throws ValidatorException { + 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(fields))); + 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); @@ -86,7 +86,7 @@ public abstract class BaseObjectValidator extends BaseFrameworkSystem implements // Default is no field is valid boolean isValidField = false; - for (final String field : fields) { + for (final String field : requiredFields) { // Get logger this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId)); diff --git a/src/org/mxchange/jsfcore/validator/string/BaseStringValidator.java b/src/org/mxchange/jsfcore/validator/string/BaseStringValidator.java index b6ac926..6434cb9 100644 --- a/src/org/mxchange/jsfcore/validator/string/BaseStringValidator.java +++ b/src/org/mxchange/jsfcore/validator/string/BaseStringValidator.java @@ -38,16 +38,16 @@ public abstract class BaseStringValidator extends BaseObjectValidator { * @param context FacesContext instance * @param component UIComponent instance * @param value Value to check - * @param fields Array of valid field names (ending with) + * @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[] fields) throws ValidatorException { + 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(fields))); + this.getLogger().trace(MessageFormat.format("context={0},component={1},value={2},fields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); // Pre-validate (e.g. on null) - super.preValidate(context, component, value, fields); + super.preValidate(context, component, value, requiredFields); // Get client id and init message + key String clientId = component.getClientId(); @@ -55,7 +55,7 @@ public abstract class BaseStringValidator extends BaseObjectValidator { String errKey; // So far all fine! - for (final String field : fields) { + for (final String field : requiredFields) { // Debug message this.getLogger().debug(MessageFormat.format("field={0},clientId={1}", field, clientId)); diff --git a/src/org/mxchange/jsfcore/validator/string/names/NameValidator.java b/src/org/mxchange/jsfcore/validator/string/names/NameValidator.java index 4b725ef..45b4cf7 100644 --- a/src/org/mxchange/jsfcore/validator/string/names/NameValidator.java +++ b/src/org/mxchange/jsfcore/validator/string/names/NameValidator.java @@ -34,11 +34,11 @@ public class NameValidator extends BaseStringValidator implements Validator { // Trace message this.getLogger().trace(MessageFormat.format("context={0},component={1},value={2} - CALLED!", context, component, value)); - // All accepted fields - String[] fields = {"firstName", "familyName"}; + // All accepted, required fields + String[] requiredFileds = {"firstName", "familyName"}; // Pre-validation (e.g. not null, not a string, empty string ...) - super.preValidate(context, component, value, fields); + super.preValidate(context, component, value, requiredFileds); // Trace message this.getLogger().trace("EXIT!");