public class KitValidator extends NameableNodeValidator<Kit>
Validator.MISSING_KIT
Validator.DENIED_KIT
Validator.INCORRECT_KITTYPE
Validator.KIT_USED_AFTER_EXPIRATIONDATE
Constructor and Description |
---|
KitValidator() |
Modifier and Type | Method and Description |
---|---|
protected ItemSubtype |
getExpectedKitSubtype(DbControl dc,
BasicItem parentItem,
boolean useDefault)
Get the subtype of the associated kit that we expect for the given
parent item.
|
protected Fix |
getMissingItemFix(DbControl dc,
Node parentNode)
Subclasses should override this method if they have a suggessted fix
for a missing item problem.
|
void |
postValidate(DbControl dc,
OverviewContext context,
Node node,
Node parentNode)
Checks if the hardware is of the correct hardware type
and, if a project is active, the hardware is included as a
default hardware for the project.
|
boolean |
preMissingItem(DbControl dc,
OverviewContext context,
Node parentNode)
If the parent item has a subtype that is related to a KIT subtype, report
the missing item as a
Validator.MISSING_KIT failure. |
getDeniedItemFix, postDeniedItem, postMissingItem, postValidateFolder, preDeniedItem, preValidate
public boolean preMissingItem(DbControl dc, OverviewContext context, Node parentNode)
Validator.MISSING_KIT
failure. Otherwise,
ignore the missing kit.preMissingItem
in interface NodeValidator<Kit>
preMissingItem
in class BasicNodeValidator<Kit>
dc
- A DbControl to use if the validation needs to access the databasecontext
- The current overview contextparentNode
- The parent node that is missing the itempublic void postValidate(DbControl dc, OverviewContext context, Node node, Node parentNode)
postValidate
in interface NodeValidator<Kit>
postValidate
in class NameableNodeValidator<Kit>
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 itemprotected Fix getMissingItemFix(DbControl dc, Node parentNode)
BasicNodeValidator
new Fix("Add item to parent", parentNode.getItem())
getMissingItemFix
in class BasicNodeValidator<Kit>
protected ItemSubtype getExpectedKitSubtype(DbControl dc, BasicItem parentItem, boolean useDefault)