com.izforge.izpack.panels.userinput.field
Class FieldValidator

java.lang.Object
  extended by com.izforge.izpack.panels.userinput.field.FieldValidator

public class FieldValidator
extends Object

FieldValidator is a wrapper around a Validator.

Author:
Tim Anderson

Constructor Summary
FieldValidator(Class<? extends Validator> type, String message, ObjectFactory factory)
          Constructs a FieldValidator.
FieldValidator(com.izforge.izpack.panels.userinput.field.FieldValidatorReader validatorReader, ObjectFactory factory)
          Constructs a FieldValidator.
FieldValidator(String className, Configurable configurable, String message, ObjectFactory factory)
          Constructs a FieldValidator.
 
Method Summary
 String getMessage()
          Returns the validation error message.
 void setInstallData(InstallData installData)
           
 boolean validate(String[] values)
          Validates field values.
 boolean validate(ValuesProcessingClient values)
          Validates field values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldValidator

public FieldValidator(Class<? extends Validator> type,
                      String message,
                      ObjectFactory factory)
Constructs a FieldValidator.

Parameters:
type - the validator class
message - the validation error message. May be null
factory - the factory for creating the validator

FieldValidator

public FieldValidator(String className,
                      Configurable configurable,
                      String message,
                      ObjectFactory factory)
Constructs a FieldValidator.

Parameters:
className - the validator class name
configurable - the validation parameters. May be null
message - the validation error message. May be null
factory - the factory for creating the validator

FieldValidator

public FieldValidator(com.izforge.izpack.panels.userinput.field.FieldValidatorReader validatorReader,
                      ObjectFactory factory)
Constructs a FieldValidator.

Parameters:
validatorReader - the validator XML reader
factory - the factory for creating the validator
Method Detail

getMessage

public String getMessage()
Returns the validation error message.

Returns:
the validation error message. May be null

validate

public boolean validate(String[] values)
Validates field values.

Parameters:
values - the values to validate
Returns:
true if the values are valid, otherwise false

setInstallData

public void setInstallData(InstallData installData)

validate

public boolean validate(ValuesProcessingClient values)
Validates field values.

Parameters:
values - the values to validate
Returns:
true if the values are valid, otherwise false


Copyright © 2018. All rights reserved.