Class RefChecker

  • All Implemented Interfaces:
    AttributeChecker
    Direct Known Subclasses:
    FieldRefChecker

    public class RefChecker
    extends java.lang.Object
    implements AttributeChecker
    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

      Constructors 
      Constructor Description
      RefChecker​(java.lang.String legalReferent)
      Constructs a RefChecker which can only sensibly reference a single given element type.
      RefChecker​(java.lang.String[] legalReferents)
      Constructs a RefChecker which can only sensibly reference a given list of element types.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void check​(java.lang.String id, ElementHandler handler)
      Performs a syntactic and/or semantic check on an attribute value for a given element.
      void checkLink​(VotLintContext context, java.lang.String id, ElementRef from, ElementRef to)
      Checks that an IDREF->ID arc is sensible.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RefChecker

        public RefChecker​(java.lang.String[] legalReferents)
        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

        public RefChecker​(java.lang.String legalReferent)
        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 Detail

      • check

        public void check​(java.lang.String id,
                          ElementHandler handler)
        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 through handler's context.
        Specified by:
        check in interface AttributeChecker
        Parameters:
        id - the value of the attribute to check
        handler - the element on which attValue appears
      • checkLink

        public void checkLink​(VotLintContext context,
                              java.lang.String id,
                              ElementRef from,
                              ElementRef to)
        Checks that an IDREF->ID arc is sensible.
        Parameters:
        context - lint context
        id - ID value
        from - element with IDREF value of id
        to - element with ID value of id