Package org.apache.jena.riot.system
Class PrefixMapBase
- java.lang.Object
-
- org.apache.jena.riot.system.PrefixMapBase
-
- All Implemented Interfaces:
PrefixMap
- Direct Known Subclasses:
PrefixMapAdapter,PrefixMapStd
public abstract class PrefixMapBase extends java.lang.Object implements PrefixMap
Abstract base implementation of aPrefixMapwhich provides some implementations of API methods.
-
-
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.Stringabbreviate(java.lang.String uriStr)Abbreviate an IRI or return nulljava.lang.Stringexpand(java.lang.String prefixedName)Expand a prefix named, return null if it can't be expandedjava.lang.Stringexpand(java.lang.String prefix, java.lang.String localName)Expand a prefix, return null if it can't be expandedvoidforEach(java.util.function.BiConsumer<java.lang.String,java.lang.String> action)Apply aBiConsumer<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 fromPrefixMap.getMapping()voidputAll(java.util.Map<java.lang.String,java.lang.String> mapping)Add a prefix, overwrites any existing associationvoidputAll(PrefixMap pmap)Add a prefix, overwrites any existing associationvoidputAll(PrefixMapping pmap)Add a prefix, overwrites any existing associationjava.util.stream.Stream<PrefixEntry>stream()Return a stream ofPrefixEntry, pairs of prefix and URI.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.jena.riot.system.PrefixMap
add, clear, containsPrefix, delete, get, getMapping, isEmpty, size
-
-
-
-
Method Detail
-
getMappingCopy
public java.util.Map<java.lang.String,java.lang.String> getMappingCopy()
Description copied from interface:PrefixMapReturn a fresh copy of the underlying mapping, should be safe to modify unlike the mapping returned fromPrefixMap.getMapping()- Specified by:
getMappingCopyin interfacePrefixMap- Returns:
- Copy of the mapping
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.String,java.lang.String> action)
Description copied from interface:PrefixMapApply aBiConsumer<String, String> to each entry in the PrefixMap.
-
stream
public java.util.stream.Stream<PrefixEntry> stream()
Description copied from interface:PrefixMapReturn a stream ofPrefixEntry, pairs of prefix and URI.
-
putAll
public void putAll(PrefixMap pmap)
Description copied from interface:PrefixMapAdd a prefix, overwrites any existing association
-
putAll
public void putAll(PrefixMapping pmap)
Description copied from interface:PrefixMapAdd a prefix, overwrites any existing association
-
putAll
public void putAll(java.util.Map<java.lang.String,java.lang.String> mapping)
Description copied from interface:PrefixMapAdd a prefix, overwrites any existing association
-
abbreviate
public java.lang.String abbreviate(java.lang.String uriStr)
Description copied from interface:PrefixMapAbbreviate an IRI or return null- Specified by:
abbreviatein interfacePrefixMap- 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:PrefixMapExpand a prefix, return null if it can't be expanded
-
abbrev
public org.apache.jena.atlas.lib.Pair<java.lang.String,java.lang.String> abbrev(java.lang.String uriStr)
Description copied from interface:PrefixMapAbbreviate an IRI and return a pair of prefix and local parts, or null.- Specified by:
abbrevin interfacePrefixMap- 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:PrefixMapExpand a prefix named, return null if it can't be expanded
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-