Class PrefixMapAdapter

java.lang.Object
org.apache.jena.riot.system.PrefixMapBase
org.apache.jena.riot.system.PrefixMapAdapter
All Implemented Interfaces:
PrefixMap

public final class PrefixMapAdapter extends PrefixMapBase implements PrefixMap
Provided PrefixMap for a PrefixMapping.
See Also:
  • Constructor Details

    • PrefixMapAdapter

      public PrefixMapAdapter(org.apache.jena.shared.PrefixMapping prefixMapping)
  • Method Details

    • getPrefixMapping

      public org.apache.jena.shared.PrefixMapping getPrefixMapping()
    • get

      public String get(String prefix)
      Description copied from interface: PrefixMap
      Return the URI for the prefix, or null if there is no entry for this prefix.
      Specified by:
      get in interface PrefixMap
    • getMappingCopy

      public Map<String,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
      Overrides:
      getMappingCopy in class PrefixMapBase
      Returns:
      Copy of the mapping
    • getMapping

      public Map<String,String> getMapping()
      Description copied from interface: PrefixMap
      Return the underlying mapping, this is generally unsafe to modify and implementations may opt to return an unmodifiable view of the mapping if they wish.
      Specified by:
      getMapping in interface PrefixMap
      Returns:
      Underlying mapping
      See Also:
    • add

      public void add(String prefix, String iriString)
      Description copied from interface: PrefixMap
      Add a prefix, overwrites any existing association
      Specified by:
      add in interface PrefixMap
      Parameters:
      prefix - Prefix
      iriString - Namespace IRI
    • delete

      public void delete(String prefix)
      Description copied from interface: PrefixMap
      Delete a prefix
      Specified by:
      delete in interface PrefixMap
      Parameters:
      prefix - Prefix to delete
    • clear

      public void clear()
      Description copied from interface: PrefixMap
      Clear all prefixes.
      Specified by:
      clear in interface PrefixMap
    • containsPrefix

      public boolean containsPrefix(String prefix)
      Description copied from interface: PrefixMap
      Gets whether the map contains a given prefix
      Specified by:
      containsPrefix in interface PrefixMap
      Parameters:
      prefix - Prefix
      Returns:
      True if the prefix is contained in the map, false otherwise
    • abbreviate

      public String abbreviate(String uriStr)
      Description copied from interface: PrefixMap
      Abbreviate an IRI or return null
      Specified by:
      abbreviate in interface PrefixMap
      Overrides:
      abbreviate in class PrefixMapBase
      Parameters:
      uriStr - URI to abbreviate
      Returns:
      URI in prefixed name form if possible, null otherwise
    • abbrev

      public org.apache.jena.atlas.lib.Pair<String,String> abbrev(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
      Overrides:
      abbrev in class PrefixMapBase
      Parameters:
      uriStr - URI string to abbreviate
      Returns:
      Pair of prefix and local name
      See Also:
    • expand

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

      public boolean isEmpty()
      Description copied from interface: PrefixMap
      Return whether the prefix map is empty or not.
      Specified by:
      isEmpty in interface PrefixMap
    • size

      public int size()
      Description copied from interface: PrefixMap
      Return the number of entries in the prefix map.
      Specified by:
      size in interface PrefixMap
    • toString

      public String toString()
      Overrides:
      toString in class PrefixMapBase