|
3.2.1: 2012-12-13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.util.overview.validator.BasicNodeValidator<I>
net.sf.basedb.util.overview.validator.NameableNodeValidator<Hardware>
net.sf.basedb.util.overview.validator.HardwareValidator
public class HardwareValidator
Validator implementation for hardware. Validation rules:
Validator.MISSING_HARDWARE
Validator.DENIED_HARDWARE
Validator.INCORRECT_HARDWARETYPE
Validator.NONDEFAULT_HARDWARE
Constructor Summary | |
---|---|
HardwareValidator()
|
Method Summary | |
---|---|
protected ItemSubtype |
getExpectedHardwareSubtype(DbControl dc,
BasicItem parentItem)
Get the subtype of the associated hardware 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 HARDWARE subtype, report the missing item as a Validator.MISSING_HARDWARE failure. |
Methods inherited from class net.sf.basedb.util.overview.validator.BasicNodeValidator |
---|
getDeniedItemFix, postDeniedItem, postMissingItem, postValidateFolder, preDeniedItem, preValidate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HardwareValidator()
Method Detail |
---|
public boolean preMissingItem(DbControl dc, OverviewContext context, Node parentNode)
Validator.MISSING_HARDWARE
failure. Otherwise,
ignore the missing hardware.
preMissingItem
in interface NodeValidator<Hardware>
preMissingItem
in class BasicNodeValidator<Hardware>
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
public void postValidate(DbControl dc, OverviewContext context, Node node, Node parentNode)
postValidate
in interface NodeValidator<Hardware>
postValidate
in class NameableNodeValidator<Hardware>
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<Hardware>
protected ItemSubtype getExpectedHardwareSubtype(DbControl dc, BasicItem parentItem)
|
3.2.1: 2012-12-13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |