Package uk.ac.starlink.ttools.votlint
Class RefChecker
java.lang.Object
uk.ac.starlink.ttools.votlint.RefChecker
- All Implemented Interfaces:
AttributeChecker
- Direct Known Subclasses:
FieldRefChecker
Attribute checker for checking XML IDREF type attributes.
Facilities are provided for checking that the reference is to elements
of a certain sort (for instance, there's no sense in getting a
GROUP to reference an INFO).
- Since:
- 7 Apr 2005
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionRefChecker
(String legalReferent) Constructs a RefChecker which can only sensibly reference a single given element type.RefChecker
(String[] legalReferents) Constructs a RefChecker which can only sensibly reference a given list of element types. -
Method Summary
Modifier and TypeMethodDescriptionvoid
check
(String id, ElementHandler handler) Performs a syntactic and/or semantic check on an attribute value for a given element.void
checkLink
(VotLintContext context, String id, ElementRef from, ElementRef to) Checks that an IDREF->ID arc is sensible.
-
Constructor Details
-
RefChecker
Constructs a RefChecker which can only sensibly reference a given list of element types.- Parameters:
legalReferents
- list of element local names which this ref can sensibly point to
-
RefChecker
Constructs a RefChecker which can only sensibly reference a single given element type.- Parameters:
legalReferent
- sole element local name which this ref can sensibly point to
-
-
Method Details
-
check
Description copied from interface:AttributeChecker
Performs a syntactic and/or semantic check on an attribute value for a given element. Anything worthy of comment should be logged throughhandler
's context.- Specified by:
check
in interfaceAttributeChecker
- Parameters:
id
- the value of the attribute to checkhandler
- the element on whichattValue
appears
-
checkLink
Checks that an IDREF->ID arc is sensible.- Parameters:
context
- lint contextid
- ID valuefrom
- element with IDREF value of idto
- element with ID value of id
-