Class 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: 2019-02-26 11:10:15 +0100 (tis, 26 feb. 2019) $
  • Constructor Details

    • ExtractValidator

      public ExtractValidator()
  • Method Details

    • preMissingItem

      public boolean preMissingItem​(DbControl dc, OverviewContext context, Node parentNode)
      Do not report missing items if the parent node is a derived or (root) 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
    • isRelated

      public static boolean isRelated​(DbControl dc, OverviewContext context, Extract parent, Extract child)
      Check if two given extracts have a parent-child relationship.
      Since:
      3.2
    • checkExtractOnBioAssay

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