3.2.1: 2012-12-13

net.sf.basedb.util.fileset
Class ValidatingFileSetMember

java.lang.Object
  extended by net.sf.basedb.util.fileset.ValidatingFileSetMember

public class ValidatingFileSetMember
extends Object

This class is a proxy used for holding information about a file set member that is currently undergoing validation.

Since:
3.0
Author:
Nicklas
Last modified
$Date: 2011-05-06 14:09:13 +0200 (Fri, 06 May 2011) $

Field Summary
private  boolean hasBeenAccepted
           
private  boolean isValidSoFar
           
private  FileSetMember member
           
private  String message
           
 
Constructor Summary
ValidatingFileSetMember(FileSetMember member)
          Create a new instance for the given real member file.
 
Method Summary
 FileSetMember getMember()
          Get the file set member that this proxy represents.
 String getMessage()
          Get the error message if the file failed validation.
 boolean hasBeenAccepted()
          Has this member been accepted for validation by at least one validator?
 Accept isAcceptedByValidator(ValidationAction action)
          Check if the member is accepted by the given validator.
 boolean isValidSoFar()
          Is the member considered valid so far in the validation process?
 void setResult(boolean isValid, String message)
          Set the result of the validation for this file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

member

private final FileSetMember member

hasBeenAccepted

private boolean hasBeenAccepted

isValidSoFar

private boolean isValidSoFar

message

private String message
Constructor Detail

ValidatingFileSetMember

public ValidatingFileSetMember(FileSetMember member)
Create a new instance for the given real member file.

Method Detail

getMember

public FileSetMember getMember()
Get the file set member that this proxy represents.


hasBeenAccepted

public boolean hasBeenAccepted()
Has this member been accepted for validation by at least one validator? When the validation has ended, the core will update the validation status only for members that was accepted at least once.


isValidSoFar

public boolean isValidSoFar()
Is the member considered valid so far in the validation process? Members that has been marked as invalid by a validator will not be processed by other validators.


getMessage

public String getMessage()
Get the error message if the file failed validation.


isAcceptedByValidator

public Accept isAcceptedByValidator(ValidationAction action)
Check if the member is accepted by the given validator. Members that have already been validated and marked as invalid will never be accepted by other actions.

Parameters:
action - The next validation action
Returns:
An Accept value or null if the file wasn't accepted

setResult

public void setResult(boolean isValid,
                      String message)
Set the result of the validation for this file.

Parameters:
isValid - TRUE if the file passed validation
message - A message about the validation

3.2.1: 2012-12-13