com.izforge.izpack.panels
Class MultipleFieldValidator

java.lang.Object
  extended by com.izforge.izpack.panels.MultipleFieldValidator
All Implemented Interfaces:
ProcessingClient

public class MultipleFieldValidator
extends java.lang.Object
implements ProcessingClient

Validator helper used for validating a group of related fields, e.g. a password group in console based mode.

Author:
Sergiy Shyrkov

Field Summary
private  ValidatorContainer currentValidator
           
private  java.util.List<java.lang.String> inputs
           
private  java.lang.String message
           
private  java.util.List<ValidatorContainer> validators
           
 
Constructor Summary
MultipleFieldValidator(java.util.List<java.lang.String> inputs, java.util.List<ValidatorContainer> validators)
           
 
Method Summary
 java.lang.String getFieldContents(int index)
          Returns the contents of the field indicated by index.
 int getNumFields()
          Returns the number of sub-fields.
 java.lang.String getText()
          Returns the field contents.
 java.lang.String getValidationMessage()
           
 java.util.Map<java.lang.String,java.lang.String> getValidatorParams()
          Returns the validator parameters, if any.
 boolean hasParams()
           
 boolean validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputs

private java.util.List<java.lang.String> inputs

validators

private java.util.List<ValidatorContainer> validators

currentValidator

private ValidatorContainer currentValidator

message

private java.lang.String message
Constructor Detail

MultipleFieldValidator

public MultipleFieldValidator(java.util.List<java.lang.String> inputs,
                              java.util.List<ValidatorContainer> validators)
Method Detail

getFieldContents

public java.lang.String getFieldContents(int index)
Description copied from interface: ProcessingClient
Returns the contents of the field indicated by index.

Specified by:
getFieldContents in interface ProcessingClient
Parameters:
index - the index of the sub-field from which the contents is requested.
Returns:
the contents of the indicated sub-field.

getNumFields

public int getNumFields()
Description copied from interface: ProcessingClient
Returns the number of sub-fields.

Specified by:
getNumFields in interface ProcessingClient
Returns:
the number of sub-fields

getText

public java.lang.String getText()
Description copied from interface: ProcessingClient
Returns the field contents.

Specified by:
getText in interface ProcessingClient
Returns:
the field contents

getValidatorParams

public java.util.Map<java.lang.String,java.lang.String> getValidatorParams()
Description copied from interface: ProcessingClient
Returns the validator parameters, if any. The caller should check for the existence of validator parameters via the hasParams() method prior to invoking this method.

Specified by:
getValidatorParams in interface ProcessingClient
Returns:
a java.util.Map containing the validator parameters.

hasParams

public boolean hasParams()
Specified by:
hasParams in interface ProcessingClient
Returns:
true if this instance has any parameters to pass to the Validator instance.

validate

public boolean validate()

getValidationMessage

public java.lang.String getValidationMessage()