|
3.1.2: 2012-07-31 | ||||||||
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<Tag>
net.sf.basedb.util.overview.validator.TagValidator
public class TagValidator
Validator implementation for tags. Validation rules:
Validator.DENIED_TAG
Validator.INCORRECT_TAGTYPE
Constructor Summary | |
---|---|
TagValidator()
|
Method Summary | |
---|---|
protected ItemSubtype |
getExpectedTagSubtype(DbControl dc,
BasicItem parentItem)
Get the subtype of the associated tag 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 tag is of the correct subtype. |
boolean |
preMissingItem(DbControl dc,
OverviewContext context,
Node parentNode)
If the parent item has a subtype that is related to a TAG subtype, report the missing item as a Validator.MISSING_TAG 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 TagValidator()
Method Detail |
---|
public boolean preMissingItem(DbControl dc, OverviewContext context, Node parentNode)
Validator.MISSING_TAG
failure. Otherwise,
ignore the missing tag.
preMissingItem
in interface NodeValidator<Tag>
preMissingItem
in class BasicNodeValidator<Tag>
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<Tag>
postValidate
in class NameableNodeValidator<Tag>
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<Tag>
protected ItemSubtype getExpectedTagSubtype(DbControl dc, BasicItem parentItem)
|
3.1.2: 2012-07-31 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |