Class UniquePromptConnectionName
java.lang.Object
de.xima.fc.gui.common.validator.AUniqueBeanFieldValidator<PromptConnectionViewModel, String>
de.xima.fc.gui.common.validator.AUniqueBeanStringFieldValidator<PromptConnectionViewModel>
de.xima.fc.gui.validator.name.UniquePromptConnectionName
- All Implemented Interfaces:
Serializable, EventListener, javax.faces.validator.Validator
@ApplicationScoped
public class UniquePromptConnectionName
extends AUniqueBeanStringFieldValidator<PromptConnectionViewModel>
implements javax.faces.validator.Validator, Serializable
Validator for the uniqueness of a prompt connection name within its scope. To use this validator, you must add a
"scope" attribute to the input component, which holds the
PromptScope of the connections being validated.
E.g.:
<h:inputText value="#{bean.name}" validator="uniquePromptConnectionName">
<f:attribute name="scope" value="#{bean.scope}" />
</h:inputText>
- Since:
- 8.5.0
- See Also:
-
Field Summary
Fields inherited from class AUniqueBeanFieldValidator
ATTR_VALUE, beanClass, fieldClassFields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID -
Constructor Summary
ConstructorsConstructorDescriptionUniquePromptConnectionName(IPromptManagementService promptManagementService) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanhasDuplicates(PromptConnectionViewModel connection, String name, javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) Checks if any duplicates exists for the given bean with the given field value.Methods inherited from class AUniqueBeanStringFieldValidator
convertValue, hasValueMethods inherited from class AUniqueBeanFieldValidator
createError, createError, findBean, getValueExpressionBase, hasDuplicates, validateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.faces.validator.Validator
validate
-
Constructor Details
-
UniquePromptConnectionName
-
-
Method Details
-
hasDuplicates
protected boolean hasDuplicates(PromptConnectionViewModel connection, String name, javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws FcPromptException Description copied from class:AUniqueBeanFieldValidatorChecks if any duplicates exists for the given bean with the given field value.- Overrides:
hasDuplicatesin classAUniqueBeanFieldValidator<PromptConnectionViewModel, String>- Parameters:
connection- Bean to check for existing duplicates.name- Field value to check for duplicates.context- Current faces context.component- Component to validate.- Throws:
FcPromptException
-