3.2.1: 2012-12-13

net.sf.basedb.util.overview.validator
Class SampleValidator

java.lang.Object
  extended by net.sf.basedb.util.overview.validator.BasicNodeValidator<I>
      extended by net.sf.basedb.util.overview.validator.NameableNodeValidator<Sample>
          extended by net.sf.basedb.util.overview.validator.SampleValidator
All Implemented Interfaces:
NodeValidator<Sample>

public class SampleValidator
extends NameableNodeValidator<Sample>

Validator implementation for sample. Validation rules:

Version:
2.10
Author:
Nicklas
Last modified
$Date: 2012-04-03 09:31:52 +0200 (Tue, 03 Apr 2012) $

Constructor Summary
SampleValidator()
           
 
Method Summary
static void checkParentBioSourceSubtype(DbControl dc, OverviewContext context, Node sampleNode, Node bioSourceNode)
          Check the subtype of the biosurce that is the parent to a sample.
static void checkParentSampleSubtype(DbControl dc, OverviewContext context, Node childNode, Node parentNode)
          Check the subtype of the sample that is the parent to another sample.
protected  Fix getMissingItemFix(DbControl dc, Node parentNode)
          The suggested fix is to add a parent sample to the extract or one or more samples to the pooled sample.
 void postValidate(DbControl dc, OverviewContext context, Node node, Node parentNode)
          Do nothing.
 
Methods inherited from class net.sf.basedb.util.overview.validator.BasicNodeValidator
getDeniedItemFix, postDeniedItem, postMissingItem, postValidateFolder, preDeniedItem, preMissingItem, preValidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleValidator

public SampleValidator()
Method Detail

postValidate

public void postValidate(DbControl dc,
                         OverviewContext context,
                         Node node,
                         Node parentNode)
Description copied from class: BasicNodeValidator
Do nothing. Subclasses should override this method if they need more validation for an existing and accessible item.

Specified by:
postValidate in interface NodeValidator<Sample>
Overrides:
postValidate in class NameableNodeValidator<Sample>
Parameters:
dc - A DbControl to use if the validation needs to access the database
context - The current overview context
node - The node object that represents item
parentNode - The parent node that is linked with the item

getMissingItemFix

protected Fix getMissingItemFix(DbControl dc,
                                Node parentNode)
The suggested fix is to add a parent sample to the extract or one or more samples to the pooled sample.

Specified by:
getMissingItemFix in class BasicNodeValidator<Sample>

checkParentBioSourceSubtype

public static void checkParentBioSourceSubtype(DbControl dc,
                                               OverviewContext context,
                                               Node sampleNode,
                                               Node bioSourceNode)
Check the subtype of the biosurce that is the parent to a sample. Given that the sample has a non-null subtype, which has a related BIOSOURCE subtype, this method checks if the parent biosource has the same subtype. If there is no related subtype for the sample, any subtype for the parent is accepted.

Since:
3.0

checkParentSampleSubtype

public static void checkParentSampleSubtype(DbControl dc,
                                            OverviewContext context,
                                            Node childNode,
                                            Node parentNode)
Check the subtype of the sample that is the parent to another sample. Given that the child sample has a non-null subtype, which has a related SAMPLE subtype, this method checks if the parent sample has the same subtype. If there is no related subtype for the child sample, any subtype for the parent is accepted.

Since:
3.0

3.2.1: 2012-12-13