SRJRCFrames
v0.1.296

de.schwarzrot.ui.validation.constraints
Class VCMatchingFile<E extends Entity>

java.lang.Object
  extended by de.schwarzrot.ui.validation.constraints.AbstractValidationConstraint<E>
      extended by de.schwarzrot.ui.validation.constraints.VCMatchingFile<E>
Type Parameters:
E - the type of the bean, managed by a presentation model
All Implemented Interfaces:
ValidationConstraint

public class VCMatchingFile<E extends Entity>
extends AbstractValidationConstraint<E>

checks the value of a beans property against given filename. With the mode parameter it is possible to activate additional checks related to the name and/or file type.

Author:
Reinhard Mantey

Field Summary
static int CONTAINS_NAME
          the name of the file must contain the string from filename parameter of constructor
static int DIRECTORY
          file must be a directory
static int ENDS_WITH
          the name of the file must end with the string from filename parameter of constructor
static int EXACT_NAME
          the name of the file must match exactly the filename parameter from constructor
static int EXECUTABLE
          file must exist and be executable
static int NOT_EXISTS
          file must not exist
static int READABLE
          file must exist and be readable
static int STARTS_WITH
          the name of the file must start with the string from filename parameter of constructor
static int WRITABLE
          file must exist and be writable
 
Constructor Summary
VCMatchingFile(com.jgoodies.binding.PresentationModel<E> model, String propertyName, int mode, String filename)
          create a valiation constraint, that validates the content of a bean property against given filename and validation modes.
 
Method Summary
 boolean matches()
          the validation kernel
 
Methods inherited from class de.schwarzrot.ui.validation.constraints.AbstractValidationConstraint
getLogger, getModel, getPropertyName, getValue, getValue, setModel, setPropertyName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXACT_NAME

public static final int EXACT_NAME
the name of the file must match exactly the filename parameter from constructor

See Also:
Constant Field Values

CONTAINS_NAME

public static final int CONTAINS_NAME
the name of the file must contain the string from filename parameter of constructor

See Also:
Constant Field Values

STARTS_WITH

public static final int STARTS_WITH
the name of the file must start with the string from filename parameter of constructor

See Also:
Constant Field Values

ENDS_WITH

public static final int ENDS_WITH
the name of the file must end with the string from filename parameter of constructor

See Also:
Constant Field Values

READABLE

public static final int READABLE
file must exist and be readable

See Also:
Constant Field Values

WRITABLE

public static final int WRITABLE
file must exist and be writable

See Also:
Constant Field Values

EXECUTABLE

public static final int EXECUTABLE
file must exist and be executable

See Also:
Constant Field Values

NOT_EXISTS

public static final int NOT_EXISTS
file must not exist

See Also:
Constant Field Values

DIRECTORY

public static final int DIRECTORY
file must be a directory

See Also:
Constant Field Values
Constructor Detail

VCMatchingFile

public VCMatchingFile(com.jgoodies.binding.PresentationModel<E> model,
                      String propertyName,
                      int mode,
                      String filename)
create a valiation constraint, that validates the content of a bean property against given filename and validation modes.

mode may be any combination of EXACT_NAME, CONTAINS_NAME, STARTS_WITH, ENDS_WITH, READABLE, WRITABLE and EXECUTABLE.

Parameters:
model - - the presentation model, that manages the bean
propertyName - - the name of the property to check
mode - - validation modes of the file
filename - - the filename to check property content with. May be null
Method Detail

matches

public boolean matches()
Description copied from interface: ValidationConstraint
the validation kernel

Returns:
true - if the property passed validation

false - if the property failed on validation


SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.