public class PasswordGroup extends Object implements ProcessingClient
UserInputPanel
to manage communication with the validator and processor for
password fields.UserInputPanel
Modifier and Type | Field and Description |
---|---|
private Vector |
fields |
private Processor |
processor |
private Validator |
validator |
Constructor and Description |
---|
PasswordGroup(String validator,
String processor)
Creates a passowrd group to manage one or more password fields.
|
Modifier and Type | Method and Description |
---|---|
void |
addField(JPasswordField field)
Adds a
JPasswordField to the group of fields being managed by this object. |
String |
getFieldContents(int index)
Returns the contents of the field indicated by
index . |
int |
getNumFields()
Returns the number of sub-fields.
|
String |
getPassword()
Returns the password.
|
boolean |
validateContents()
This method validates the group content.
|
public PasswordGroup(String validator, String processor)
validator
- A string that specifies a class that provides a password validation service.
The class must implement the Validator
interface. If an attempt to instantiate
this class fails, no validation will be performed.processor
- A string that specifies a class that provides a password processing service,
such as password encryption. The class must implement the Processor
interface.
If an attempt to instantiate this class fails, no processing will be performed. Insted the
contents of the first field will be returned.public int getNumFields()
getNumFields
in interface ProcessingClient
public String getFieldContents(int index) throws IndexOutOfBoundsException
index
.getFieldContents
in interface ProcessingClient
index
- the index of the sub-field from which the contents is requested.IndexOutOfBoundsException
- if the index is out of bounds.public void addField(JPasswordField field)
JPasswordField
to the group of fields being managed by this object.field
- JPasswordField
to addpublic boolean validateContents()
true
if the validation passes or no implementation of a validation
rule exists. Otherwise false
is returned.public String getPassword()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses