3.0.1: 2011-11-10

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

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

public class ExtractValidator
extends NameableNodeValidator<Extract>

Validator implementation for extracts. Validation rules:

Version:
2.10
Author:
Nicklas
Last modified
$Date: 2011-10-18 11:24:06 +0200 (Tue, 18 Oct 2011) $

Nested Class Summary
(package private) static class ExtractValidator.TagPosition
           
 
Constructor Summary
ExtractValidator()
           
 
Method Summary
private  void checkExtractOnBioAssay(DbControl dc, OverviewContext context, Node extractNode, Node bioAssayNode)
           
static void checkExtractTag(DbControl dc, OverviewContext context, Node childNode, Node parentNode)
          Check the tag of the child extract in relation to a parent extract.
static void checkParentExtractSubtype(DbControl dc, OverviewContext context, Node childNode, Node parentNode)
          Check the subtype of the extract that is the parent to another extract.
static void checkParentSampleSubtype(DbControl dc, OverviewContext context, Node extractNode, Node sampleNode)
          Check the subtype of the sample that is the parent to an extract.
protected  Fix getMissingItemFix(DbControl dc, Node parentNode)
          The suggested fix is to add parent extracts to the physical bioassay or one or more extracts to the pooled extract.
 void postValidate(DbControl dc, OverviewContext context, Node node, Node parentNode)
          Do nothing.
 void postValidateFolder(DbControl dc, OverviewContext context, Node folderNode, Node parentNode)
          If the parent is a physical bioassay, check that extracts on the same position has different tags.
 boolean preMissingItem(DbControl dc, OverviewContext context, Node parentNode)
          Do not report missing items if the parent node is a derived or raw bioassay.
 
Methods inherited from class net.sf.basedb.util.overview.validator.BasicNodeValidator
getDeniedItemFix, postDeniedItem, postMissingItem, preDeniedItem, preValidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtractValidator

public ExtractValidator()
Method Detail

preMissingItem

public boolean preMissingItem(DbControl dc,
                              OverviewContext context,
                              Node parentNode)
Do not report missing items if the parent node is a derived or raw bioassay.

Specified by:
preMissingItem in interface NodeValidator<Extract>
Overrides:
preMissingItem in class BasicNodeValidator<Extract>
Parameters:
dc - A DbControl to use if the validation needs to access the database
context - The current overview context
parentNode - The parent node that is missing the item
Returns:
Always false

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<Extract>
Overrides:
postValidate in class NameableNodeValidator<Extract>
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 parent extracts to the physical bioassay or one or more extracts to the pooled extract.

Specified by:
getMissingItemFix in class BasicNodeValidator<Extract>

postValidateFolder

public void postValidateFolder(DbControl dc,
                               OverviewContext context,
                               Node folderNode,
                               Node parentNode)
If the parent is a physical bioassay, check that extracts on the same position has different tags.

Specified by:
postValidateFolder in interface NodeValidator<Extract>
Overrides:
postValidateFolder in class BasicNodeValidator<Extract>
Parameters:
dc - A DbControl to use for database access
context - The current overview context
folderNode - The folder node, or null if no folder has been created
parentNode - The parent node (never null)

checkParentSampleSubtype

public static void checkParentSampleSubtype(DbControl dc,
                                            OverviewContext context,
                                            Node extractNode,
                                            Node sampleNode)
Check the subtype of the sample that is the parent to an extract. Given that the extract 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 extract, any subtype for the parent is accepted.

Since:
3.0

checkParentExtractSubtype

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

Since:
3.0

checkExtractTag

public static void checkExtractTag(DbControl dc,
                                   OverviewContext context,
                                   Node childNode,
                                   Node parentNode)
Check the tag of the child extract in relation to a parent extract. If the parent extract has a tag, the child must have the same tag. If the parent is not tagged, then the child may have any tag or no tag.

Since:
3.0

checkExtractOnBioAssay

private void checkExtractOnBioAssay(DbControl dc,
                                    OverviewContext context,
                                    Node extractNode,
                                    Node bioAssayNode)

3.0.1: 2011-11-10