Class LocationMap

  • All Implemented Interfaces:
    java.io.Serializable, LocationProvider

    public class LocationMap
    extends java.lang.Object
    implements LocationProvider, java.io.Serializable
    A LocationMap allocates integer codes to (systemId, lineNumber) pairs. The integer codes are held inside an Expression object to track the location of the expression in the source code
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      LocationMap()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int allocateLocationId​(java.lang.String module, int lineNumber)
      Allocate a location identifier to an expression
      int getLineNumber​(int locationId)
      Get the line number corresponding to a locationId
      java.lang.String getSystemId​(int locationId)
      Get the system identifier corresponding to a locationId
      • Methods inherited from class java.lang.Object

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

      • LocationMap

        public LocationMap()
    • Method Detail

      • allocateLocationId

        public int allocateLocationId​(java.lang.String module,
                                      int lineNumber)
        Allocate a location identifier to an expression
      • getSystemId

        public java.lang.String getSystemId​(int locationId)
        Get the system identifier corresponding to a locationId
        Specified by:
        getSystemId in interface LocationProvider
        Parameters:
        locationId - identifier of the location in question (as passed down the Receiver pipeline)
        Returns:
        the URI of the document or module.
      • getLineNumber

        public int getLineNumber​(int locationId)
        Get the line number corresponding to a locationId
        Specified by:
        getLineNumber in interface LocationProvider
        Parameters:
        locationId - identifier of the location in question (as passed down the Receiver pipeline)
        Returns:
        the line number within the document or module.