Class VotLintContext


  • public class VotLintContext
    extends java.lang.Object
    Context for a VOTLint process. This is the object which knows most of the available global information about the parse. It also provides facilities for reporting log information about the parse to the user.
    Author:
    Mark Taylor (Starlink)
    • Constructor Summary

      Constructors 
      Constructor Description
      VotLintContext​(uk.ac.starlink.votable.VOTableVersion version, boolean validate, SaxMessager messager)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void error​(java.lang.String msg)
      Write an error message to the user.
      org.xml.sax.Locator getLocator()
      Returns the SAX document locator for this parse.
      java.util.Map getNamespaceMap()
      Returns prefix->namespaceURI map for the xmlns namespaces currently in scope.
      uk.ac.starlink.votable.VOTableVersion getVersion()
      Returns the version of VOTable this context is parsing.
      void info​(java.lang.String msg)
      Write an informative message to the user.
      boolean isValidating()
      Indicates whether this lint is validating.
      void registerID​(java.lang.String id, ElementHandler handler)
      Register the fact that an XML ID-type attribute has been seen on an element.
      void registerRef​(java.lang.String id, ElementRef from, RefChecker checker)
      Register the fact that an XML IDREF-type attribute has been seen on an element.
      void reportUncheckedRefs()
      Goes through all the unresolved IDREF->ID arcs and reports them.
      void setLocator​(org.xml.sax.Locator locator)
      Sets the SAX document locator for this parse.
      void warning​(java.lang.String msg)
      Write a warning message to the user.
      • Methods inherited from class java.lang.Object

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

      • VotLintContext

        public VotLintContext​(uk.ac.starlink.votable.VOTableVersion version,
                              boolean validate,
                              SaxMessager messager)
        Constructor.
        Parameters:
        version - version of VOTable for which the parse will be done
        validate - if true, validation will be performed against the appropriate DTD/schema
        messager - destination for validation messages
    • Method Detail

      • getVersion

        public uk.ac.starlink.votable.VOTableVersion getVersion()
        Returns the version of VOTable this context is parsing.
        Returns:
        version object
      • isValidating

        public boolean isValidating()
        Indicates whether this lint is validating.
        Returns:
        true for validating lint
      • setLocator

        public void setLocator​(org.xml.sax.Locator locator)
        Sets the SAX document locator for this parse.
        Parameters:
        locator - locator
      • getLocator

        public org.xml.sax.Locator getLocator()
        Returns the SAX document locator for this parse.
        Returns:
        locator
      • getNamespaceMap

        public java.util.Map getNamespaceMap()
        Returns prefix->namespaceURI map for the xmlns namespaces currently in scope.
      • registerID

        public void registerID​(java.lang.String id,
                               ElementHandler handler)
        Register the fact that an XML ID-type attribute has been seen on an element.
        Parameters:
        id - ID value
        handler - element labelled id
      • registerRef

        public void registerRef​(java.lang.String id,
                                ElementRef from,
                                RefChecker checker)
        Register the fact that an XML IDREF-type attribute has been seen on an element.
        Parameters:
        id - ID value
        from - the element on which the ref has been seen
        checker - the checker which knows how to check links of this type
      • reportUncheckedRefs

        public void reportUncheckedRefs()
        Goes through all the unresolved IDREF->ID arcs and reports them. This is done at the end of the parse.
      • info

        public void info​(java.lang.String msg)
        Write an informative message to the user.
        Parameters:
        msg - message
      • warning

        public void warning​(java.lang.String msg)
        Write a warning message to the user.
        Parameters:
        msg - message
      • error

        public void error​(java.lang.String msg)
        Write an error message to the user.
        Parameters:
        msg - message