Package org.apache.jena.riot.system
Class PrefixMapWrapper
- java.lang.Object
-
- org.apache.jena.riot.system.PrefixMapWrapper
-
- All Implemented Interfaces:
PrefixMap
- Direct Known Subclasses:
PrefixMapProxy,PrefixMapUnmodifiable
public class PrefixMapWrapper extends java.lang.Object implements PrefixMap
-
-
Constructor Summary
Constructors Constructor Description PrefixMapWrapper(PrefixMap other)
-
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 nullvoidadd(java.lang.String prefix, java.lang.String iri)Add a prefix, overwrites any existing associationvoidclear()Clear all prefixes.booleancontainsPrefix(java.lang.String prefix)Gets whether the map contains a given prefixvoiddelete(java.lang.String prefix)Delete a prefixjava.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.lang.Stringget(java.lang.String prefix)Return the URI for the prefix, or null if there is no entry for this prefix.java.util.Map<java.lang.String,java.lang.String>getMapping()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.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()booleanisEmpty()Return whether the prefix map is empty or not.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 associationintsize()Return the number of entries in the prefix map.java.util.stream.Stream<PrefixEntry>stream()Return a stream ofPrefixEntry, pairs of prefix and URI.
-
-
-
Constructor Detail
-
PrefixMapWrapper
public PrefixMapWrapper(PrefixMap other)
-
-
Method Detail
-
getMapping
public java.util.Map<java.lang.String,java.lang.String> getMapping()
Description copied from interface:PrefixMapReturn 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:
getMappingin interfacePrefixMap- Returns:
- Underlying mapping
- See Also:
PrefixMap.getMappingCopy()
-
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.
-
get
public java.lang.String get(java.lang.String prefix)
Description copied from interface:PrefixMapReturn the URI for the prefix, or null if there is no entry for this prefix.
-
add
public void add(java.lang.String prefix, java.lang.String iri)Description copied from interface:PrefixMapAdd a prefix, overwrites any existing association
-
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
-
delete
public void delete(java.lang.String prefix)
Description copied from interface:PrefixMapDelete a prefix
-
clear
public void clear()
Description copied from interface:PrefixMapClear all prefixes.
-
containsPrefix
public boolean containsPrefix(java.lang.String prefix)
Description copied from interface:PrefixMapGets whether the map contains a given prefix- Specified by:
containsPrefixin interfacePrefixMap- Parameters:
prefix- Prefix- Returns:
- True if the prefix is contained in the map, false otherwise
-
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
-
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
-
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
-
isEmpty
public boolean isEmpty()
Description copied from interface:PrefixMapReturn whether the prefix map is empty or not.
-
-