Package org.sourceid.saml20.adapter.gui
Class FieldDescriptor
java.lang.Object
org.sourceid.saml20.adapter.gui.FieldDescriptor
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractSelectionFieldDescriptor,AbstractTextFieldDescriptor,CheckBoxFieldDescriptor,FilterableSelectionFieldDescriptor,TextAreaFieldDescriptor,UploadFileFieldDescriptor
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.).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA wrapper class to support the 'skip if' functionality inaddValidator(org.sourceid.saml20.adapter.gui.validation.FieldValidator, boolean). -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValidator(FieldValidator validator) Adds a FieldValidator to the back of the ordered list of validators for this field.voidaddValidator(FieldValidator validator, boolean skipIfEmptyValue) Adds a FieldValidator to the back of the ordered list of validators for this field.This method returns a default value for the field of a plugin instance created before adding the current field.Gets the default value for this field.Gets a description of this field.getFormattedValue(String value) Gets a value that is formatted according to this FieldDescriptor.getLabel()Gets the label of this field that will be rendered in the administrative console configuration pages.getName()Gets the name of this field.Gets the ordered list of FieldValidators.booleanisHidden()This method returns a boolean indicating if the current field is hidden on the user interface.voidsetDefaultForLegacyConfig(String defaultValue) This method allows a newly added field to have a default value specifically for instances of a plugin that were created before adding this field.voidsetDefaultValue(String defaultValue) Sets the default value for this individual field.voidsetHidden(boolean hidden) This method sets whether this field is hidden in the user interface.voidSets the label of this field that will be rendered in the administrative console configuration pages.
-
Method Details
-
getName
Gets the name of this field. The name of the field must be unique per Table or AdapterConfigurationGuiDescriptor. The field is used to identify the field during various processing steps.- Returns:
- the name of the field.
-
setLabel
Sets the label of this field that will be rendered in the administrative console configuration pages. If set, the label will take precedence over the name for how the field is rendered in the administrative console. This is intended to be used as a strategy for renaming fields in future releases of a plugin, while preserving the handling of existing configuration.- Parameters:
label- The desired field label value.- Since:
- 9.0
-
getLabel
Gets the label of this field that will be rendered in the administrative console configuration pages. If it is not explicitly set, the name of the field will be returned as the label.- Returns:
- the label of the field.
- Since:
- 9.0
-
getDescription
Gets a description of this field.- Returns:
- a description
-
getDefaultValue
Gets the default value for this field.- Returns:
- the default value.
-
getFormattedValue
Gets a value that is formatted according to this FieldDescriptor. It is meant to be overridden by subclasses. By default the specified value is simply returned.- Parameters:
value- The value to be formatted.- Returns:
- The formatted value that is understandable to this FieldDescriptor.
-
setDefaultValue
Sets the default value for this individual field.- Parameters:
defaultValue- for this field.
-
setDefaultForLegacyConfig
This method allows a newly added field to have a default value specifically for instances of a plugin that were created before adding this field.- Parameters:
defaultValue- The default value that should be used for legacy configurations.
-
getDefaultForLegacyConfig
This method returns a default value for the field of a plugin instance created before adding the current field.- Returns:
- The default value that should be used for legacy configurations.
-
isHidden
public boolean isHidden()This method returns a boolean indicating if the current field is hidden on the user interface.- Returns:
- True if this field is not shown in the user interface. False otherwise.
-
setHidden
public void setHidden(boolean hidden) This method sets whether this field is hidden in the user interface.- Parameters:
hidden- True if this field is hidden from the user interface. False otherwise.
-
addValidator
Adds a FieldValidator to the back of the ordered list of validators for this field. This method callsaddValidator(org.sourceid.saml20.adapter.gui.validation.FieldValidator, boolean)with false for the last parameter.- Parameters:
validator- the FieldValidator
-
addValidator
Adds a FieldValidator to the back of the ordered list of validators for this field.- Parameters:
validator- validator the FieldValidatorskipIfEmptyValue- 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
Gets the ordered list of FieldValidators.- Returns:
- the validation chain for this field.
-