Class PrefixMapBase

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.jena.atlas.lib.Pair<java.lang.String,​java.lang.String> abbrev​(java.lang.String uriStr)
      Abbreviate an IRI and return a pair of prefix and local parts, or null.
      java.lang.String abbreviate​(java.lang.String uriStr)
      Abbreviate an IRI or return null
      java.lang.String expand​(java.lang.String prefixedName)
      Expand a prefix named, return null if it can't be expanded
      java.lang.String expand​(java.lang.String prefix, java.lang.String localName)
      Expand a prefix, return null if it can't be expanded
      void forEach​(java.util.function.BiConsumer<java.lang.String,​java.lang.String> action)
      Apply a BiConsumer<String, String> to each entry in the PrefixMap.
      java.util.Map<java.lang.String,​java.lang.String> getMappingCopy()
      Return a fresh copy of the underlying mapping, should be safe to modify unlike the mapping returned from PrefixMap.getMapping()
      void putAll​(java.util.Map<java.lang.String,​java.lang.String> mapping)
      Add a prefix, overwrites any existing association
      void putAll​(PrefixMap pmap)
      Add a prefix, overwrites any existing association
      void putAll​(PrefixMapping pmap)
      Add a prefix, overwrites any existing association
      java.util.stream.Stream<PrefixEntry> stream()
      Return a stream of PrefixEntry, pairs of prefix and URI.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getMappingCopy

        public java.util.Map<java.lang.String,​java.lang.String> getMappingCopy()
        Description copied from interface: PrefixMap
        Return a fresh copy of the underlying mapping, should be safe to modify unlike the mapping returned from PrefixMap.getMapping()
        Specified by:
        getMappingCopy in interface PrefixMap
        Returns:
        Copy of the mapping
      • forEach

        public void forEach​(java.util.function.BiConsumer<java.lang.String,​java.lang.String> action)
        Description copied from interface: PrefixMap
        Apply a BiConsumer<String, String> to each entry in the PrefixMap.
        Specified by:
        forEach in interface PrefixMap
      • putAll

        public void putAll​(PrefixMap pmap)
        Description copied from interface: PrefixMap
        Add a prefix, overwrites any existing association
        Specified by:
        putAll in interface PrefixMap
        Parameters:
        pmap - Prefix Map
      • putAll

        public void putAll​(PrefixMapping pmap)
        Description copied from interface: PrefixMap
        Add a prefix, overwrites any existing association
        Specified by:
        putAll in interface PrefixMap
        Parameters:
        pmap - Prefix Mapping
      • putAll

        public void putAll​(java.util.Map<java.lang.String,​java.lang.String> mapping)
        Description copied from interface: PrefixMap
        Add a prefix, overwrites any existing association
        Specified by:
        putAll in interface PrefixMap
        Parameters:
        mapping - A Map of prefix name to IRI string
      • abbreviate

        public java.lang.String abbreviate​(java.lang.String uriStr)
        Description copied from interface: PrefixMap
        Abbreviate an IRI or return null
        Specified by:
        abbreviate in interface PrefixMap
        Parameters:
        uriStr - URI to abbreviate
        Returns:
        URI in prefixed name form if possible, null otherwise
      • expand

        public java.lang.String expand​(java.lang.String prefix,
                                       java.lang.String localName)
        Description copied from interface: PrefixMap
        Expand a prefix, return null if it can't be expanded
        Specified by:
        expand in interface PrefixMap
        Parameters:
        prefix - Prefix
        localName - Local name
        Returns:
        Expanded URI if possible, null otherwise
      • abbrev

        public org.apache.jena.atlas.lib.Pair<java.lang.String,​java.lang.String> abbrev​(java.lang.String uriStr)
        Description copied from interface: PrefixMap
        Abbreviate an IRI and return a pair of prefix and local parts, or null.
        Specified by:
        abbrev in interface PrefixMap
        Parameters:
        uriStr - URI string to abbreviate
        Returns:
        Pair of prefix and local name
        See Also:
        PrefixMap.abbreviate(java.lang.String)
      • expand

        public java.lang.String expand​(java.lang.String prefixedName)
        Description copied from interface: PrefixMap
        Expand a prefix named, return null if it can't be expanded
        Specified by:
        expand in interface PrefixMap
        Parameters:
        prefixedName - Prefixed Name
        Returns:
        Expanded URI if possible, null otherwise
      • toString

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