public class UniqueFileNameValidator extends Object implements Validator
A specialized Validator
implementations for checking whether the name
entered for a new file does not exist in the current directory.
In the validation method this class obtains the data object with the content of the current directory (which is available as a typed property from the context). Then it checks whether the name entered by the user already exists in this directory. If this is the case, validation fails and an error message is produced.
Modifier and Type | Field and Description |
---|---|
static String |
ERR_FILE_EXISTS
Constant for the error message produced by this validator.
|
Constructor and Description |
---|
UniqueFileNameValidator() |
Modifier and Type | Method and Description |
---|---|
ValidationResult |
isValid(Object o,
TransformerContext ctx)
Performs the validation.
|
public static final String ERR_FILE_EXISTS
public ValidationResult isValid(Object o, TransformerContext ctx)
Copyright © 2016 The JGUIraffe Team. All rights reserved.