Class ExtractValidator
java.lang.Object
net.sf.basedb.util.overview.validator.BasicNodeValidator<I>
net.sf.basedb.util.overview.validator.NameableNodeValidator<Extract>
net.sf.basedb.util.overview.validator.ExtractValidator
- All Implemented Interfaces:
NodeValidator<Extract>
Validator implementation for extracts. Validation rules:
- Missing item:
Validator.MISSING_EXTRACT
- Access denied:
Validator.DENIED_EXTRACT
- Subtype of parent extract:
Validator.INCORRECT_EXTRACT_TYPE
- Subtype of parent sample:
Validator.INCORRECT_SAMPLE_TYPE
- Different tag than parent:
Validator.DIFFERENT_TAG
- Parent is tagged, but child is not:
Validator.TAGGED_PARENT
- Duplicates of same tag+position on bioassay:
Validator.NONUNIQUE_TAG
- Incorrect position on bioassay:
Validator.INCORRECT_BIOASSAY_POSITION
- Version:
- 2.10
- Author:
- Nicklas
- Last modified
- $Date: 2019-02-26 11:10:15 +0100 (tis, 26 feb. 2019) $
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate 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.static boolean
isRelated
(DbControl dc, OverviewContext context, Extract parent, Extract child) Check if two given extracts have a parent-child relationship.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 (root) raw bioassay.Methods inherited from class net.sf.basedb.util.overview.validator.BasicNodeValidator
getDeniedItemFix, postDeniedItem, postMissingItem, preDeniedItem, preValidate
-
Constructor Details
-
ExtractValidator
public ExtractValidator()
-
-
Method Details
-
preMissingItem
Do not report missing items if the parent node is a derived or (root) raw bioassay.- Specified by:
preMissingItem
in interfaceNodeValidator<Extract>
- Overrides:
preMissingItem
in classBasicNodeValidator<Extract>
- Parameters:
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextparentNode
- The parent node that is missing the item- Returns:
- Always false
-
postValidate
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 interfaceNodeValidator<Extract>
- Overrides:
postValidate
in classNameableNodeValidator<Extract>
- Parameters:
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextnode
- The node object that represents itemparentNode
- The parent node that is linked with the item
-
getMissingItemFix
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 classBasicNodeValidator<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 interfaceNodeValidator<Extract>
- Overrides:
postValidateFolder
in classBasicNodeValidator<Extract>
- Parameters:
dc
- A DbControl to use for database accesscontext
- The current overview contextfolderNode
- The folder node, or null if no folder has been createdparentNode
- 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)
-