Class LocationMapper


  • public class LocationMapper
    extends java.lang.Object
    Alternative locations for URIs. Maintains two maps: single item alternatives and alternative prefixes. To suggest an alternative location, first check the single items, then check the prefixes. A LocationMapper can be configured by an RDF file. The default for this is "etc/location-mapping.n3". There is a default LocationMapper which is used by the global @link{StreamManager}.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocationMapper()
      Create a LocationMapper with no mapping yet
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAltEntry​(java.lang.String uri, java.lang.String alt)  
      void addAltPrefix​(java.lang.String uriPrefix, java.lang.String altPrefix)  
      java.lang.String altMapping​(java.lang.String uri)  
      java.lang.String altMapping​(java.lang.String uri, java.lang.String otherwise)
      Apply mappings: first try for an exact alternative location, then try to remap by prefix, finally, try the special case of filenames in a specific base directory.
      LocationMapper clone()
      Deep copy of location and prefix maps
      boolean containsMapping​(java.lang.String uri)  
      void copyFrom​(LocationMapper lmap2)  
      boolean equals​(java.lang.Object obj)  
      java.lang.String getAltEntry​(java.lang.String uri)  
      java.lang.String getAltPrefix​(java.lang.String uriPrefix)  
      int hashCode()  
      java.util.Iterator<java.lang.String> listAltEntries()
      Iterate over all the entries registered
      java.util.Iterator<java.lang.String> listAltPrefixes()
      Iterate over all the prefixes registered
      void removeAltEntry​(java.lang.String uri)  
      void removeAltPrefix​(java.lang.String uriPrefix)  
      Model toModel()  
      void toModel​(Model model)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LocationMapper

        public LocationMapper()
        Create a LocationMapper with no mapping yet
    • Method Detail

      • clone

        public LocationMapper clone()
        Deep copy of location and prefix maps
      • containsMapping

        public boolean containsMapping​(java.lang.String uri)
      • altMapping

        public java.lang.String altMapping​(java.lang.String uri)
      • altMapping

        public java.lang.String altMapping​(java.lang.String uri,
                                           java.lang.String otherwise)
        Apply mappings: first try for an exact alternative location, then try to remap by prefix, finally, try the special case of filenames in a specific base directory.
        Parameters:
        uri -
        otherwise -
        Returns:
        The alternative location chosen
      • addAltEntry

        public void addAltEntry​(java.lang.String uri,
                                java.lang.String alt)
      • addAltPrefix

        public void addAltPrefix​(java.lang.String uriPrefix,
                                 java.lang.String altPrefix)
      • listAltEntries

        public java.util.Iterator<java.lang.String> listAltEntries()
        Iterate over all the entries registered
      • listAltPrefixes

        public java.util.Iterator<java.lang.String> listAltPrefixes()
        Iterate over all the prefixes registered
      • removeAltEntry

        public void removeAltEntry​(java.lang.String uri)
      • removeAltPrefix

        public void removeAltPrefix​(java.lang.String uriPrefix)
      • getAltEntry

        public java.lang.String getAltEntry​(java.lang.String uri)
      • getAltPrefix

        public java.lang.String getAltPrefix​(java.lang.String uriPrefix)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toModel

        public Model toModel()
      • toModel

        public void toModel​(Model model)