org.sourceid.saml20.adapter.gui
Class FieldDescriptor

java.lang.Object
  extended by org.sourceid.saml20.adapter.gui.FieldDescriptor
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AbstractSelectionFieldDescriptor, CheckBoxFieldDescriptor, TextAreaFieldDescriptor, TextFieldDescriptor, UploadFileFieldDescriptor

public abstract class FieldDescriptor
extends java.lang.Object
implements java.io.Serializable

An abstract base type for describing GUI fields to be rendered in the PingFederate administration console. See the various subclasses for specific types (text field, drop down, checkbox, etc.).

Author:
Brian Campbell
See Also:
AdapterConfigurationGuiDescriptor.addField(FieldDescriptor), AdapterConfigurationGuiDescriptor.addAdvancedField(FieldDescriptor), TableDescriptor.addRowField(FieldDescriptor), Serialized Form

Nested Class Summary
 class FieldDescriptor.FieldValidationWrapper
          A wrapper class to support the 'skip if' functionality in addValidator(org.sourceid.saml20.adapter.gui.validation.FieldValidator, boolean)
 
Constructor Summary
protected FieldDescriptor(java.lang.String name, java.lang.String description)
          Create a new FieldDescriptor.
 
Method Summary
 void addValidator(FieldValidator validator)
          Add a FieldValidator to the back of the ordered list of validators for this field.
 void addValidator(FieldValidator validator, boolean skipIfEmptyValue)
          Add a FieldValidator to the back of the ordered list of validators for this field.
 java.lang.String getDefaultValue()
          Gets the default value for this field.
 java.lang.String getDescription()
          Gets a description of this field.
 java.lang.String getName()
          Gets the name of this field.
 java.util.List<FieldDescriptor.FieldValidationWrapper> getValidationChain()
          Gets the ordered list of FieldValidators.
 void setDefaultValue(java.lang.String defaultValue)
          Set the default value for this individual field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldDescriptor

protected FieldDescriptor(java.lang.String name,
                          java.lang.String description)
Create a new FieldDescriptor.

Parameters:
name - the field name (must be unique per AdapterConfigurationGuiDescriptor or TableDescriptor).
description - a helpful description of the field.
Method Detail

getName

public java.lang.String getName()
Gets the name of this field. The name of the field must be unique per Table or AdapterConfigurationGuiDescriptor. The field name is rendered on the GUI configuration page and is also used to uniquely identify the field during various processing steps.

Returns:
the name of the field.

getDescription

public java.lang.String getDescription()
Gets a description of this field.

Returns:
a description

getDefaultValue

public java.lang.String getDefaultValue()
Gets the default value for this field.

Returns:
the default value.

setDefaultValue

public void setDefaultValue(java.lang.String defaultValue)
Set the default value for this individual field.

Parameters:
defaultValue - for this field.

addValidator

public void addValidator(FieldValidator validator)
Add a FieldValidator to the back of the ordered list of validators for this field. This method calls addValidator(org.sourceid.saml20.adapter.gui.validation.FieldValidator, boolean) with false for the last parameter.

Parameters:
validator - the FieldValidator

addValidator

public void addValidator(FieldValidator validator,
                         boolean skipIfEmptyValue)
Add a FieldValidator to the back of the ordered list of validators for this field.

Parameters:
validator - validator the FieldValidator
skipIfEmptyValue - a boolean indicating if validator should be skipped when the field value is null or empty. This is useful for situations where you want to perform some validation on a field only if the user entered a value for the field. For example, you might want a field that is not required but must be an integer if used.

getValidationChain

public java.util.List<FieldDescriptor.FieldValidationWrapper> getValidationChain()
Gets the ordered list of FieldValidators.

Returns:
the validation chain for this field.


Copyright 2007 Ping Identity Corp. All rights reserved.