public class PolyadicPrefixMappingImpl extends org.apache.jena.shared.impl.PrefixMappingImpl implements PrefixMapping
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedExceptionExtended, Standard| Constructor and Description |
|---|
PolyadicPrefixMappingImpl(Polyadic p) |
| Modifier and Type | Method and Description |
|---|---|
String |
expandPrefix(String prefixed)
Expand a prefixed URI.
|
Map<String,String> |
getNsPrefixMap()
Return a copy of the internal mapping from names to URI strings.
|
String |
getNsPrefixURI(String prefix)
Get the URI bound to a specific prefix, null if there isn't one.
|
String |
getNsURIPrefix(String uri)
Answer the prefix for the given URI, or null if there isn't one.
|
String |
qnameFor(String uri)
Answer the qname for
uri which uses a prefix from this
mapping, or null if there isn't one. |
PrefixMapping |
removeNsPrefix(String prefix)
Remove any existing maplet with the given prefix name and answer this
mapping.
|
PrefixMapping |
setNsPrefix(String prefix,
String uri)
Specify the prefix name for a URI prefix string.
|
PrefixMapping |
setNsPrefixes(Map<String,String> other)
Add the bindings in the map to our own.
|
PrefixMapping |
setNsPrefixes(PrefixMapping other)
Add the bindings of other to our own.
|
String |
shortForm(String uri)
Compress the URI using the prefix mapping.
|
String |
toString()
Answer a readable (we hope) representation of this prefix mapping.
|
isNiceURI, lock, samePrefixMappingAs, withDefaultMappingsequals, getClass, hashCode, notify, notifyAll, wait, wait, waitlock, samePrefixMappingAs, withDefaultMappingspublic PolyadicPrefixMappingImpl(Polyadic p)
public PrefixMapping setNsPrefix(String prefix, String uri)
PrefixMappingA prefix name must be a valid NCName, or the empty string. The empty string is reserved to mean "the default namespace".
Need not check the RFC2396 validity of the URI. Bad URIs are either silently ignored or behave as if they were good. The earlier restriction that the URI should end with a non-NCName character has been removed.
Note, in particular, that the a prefix mapping can only be used if it includes the URI up to any '#' character because '#' is not legal in the local part of an NCName.
setNsPrefix in interface PrefixMappingsetNsPrefix in class org.apache.jena.shared.impl.PrefixMappingImplprefix - the string to be used for the prefix.uri - the URI prefix to be namedpublic PrefixMapping removeNsPrefix(String prefix)
PrefixMappingThe reverse URI-to-prefix mapping is updated, but if there are multiple prefixes for the removed URI it is unspecified which of them will be chosen.
removeNsPrefix in interface PrefixMappingremoveNsPrefix in class org.apache.jena.shared.impl.PrefixMappingImplprefix - the prefix string to removepublic PrefixMapping setNsPrefixes(PrefixMapping other)
setNsPrefixes in interface PrefixMappingsetNsPrefixes in class org.apache.jena.shared.impl.PrefixMappingImplother - the PrefixMapping whose bindings we are to add to this.public PrefixMapping setNsPrefixes(Map<String,String> other)
setNsPrefixes in interface PrefixMappingsetNsPrefixes in class org.apache.jena.shared.impl.PrefixMappingImplother - the Map whose bindings we are to add to this.public String getNsPrefixURI(String prefix)
PrefixMappinggetNsPrefixURI in interface PrefixMappinggetNsPrefixURI in class org.apache.jena.shared.impl.PrefixMappingImplprefix - the prefix name to be looked uppublic Map<String,String> getNsPrefixMap()
PrefixMappinggetNsPrefixMap in interface PrefixMappinggetNsPrefixMap in class org.apache.jena.shared.impl.PrefixMappingImplpublic String getNsURIPrefix(String uri)
PrefixMappinggetNsURIPrefix in interface PrefixMappinggetNsURIPrefix in class org.apache.jena.shared.impl.PrefixMappingImpluri - the uri whose prefix is to be foundpublic String expandPrefix(String prefixed)
expandPrefix in interface PrefixMappingexpandPrefix in class org.apache.jena.shared.impl.PrefixMappingImplprefixed - a QName or URIpublic String toString()
toString in class org.apache.jena.shared.impl.PrefixMappingImplpublic String shortForm(String uri)
shortForm in interface PrefixMappingshortForm in class org.apache.jena.shared.impl.PrefixMappingImpluri - the URI string to try and prefix-compresspublic String qnameFor(String uri)
org.apache.jena.shared.impl.PrefixMappingImpluri which uses a prefix from this
mapping, or null if there isn't one.
Relies on splitNamespace to carve uri into namespace and
localname components; this ensures that the localname is legal and we just
have to (reverse-)lookup the namespace in the prefix table.
qnameFor in interface PrefixMappingqnameFor in class org.apache.jena.shared.impl.PrefixMappingImplPrefixMapping.qnameFor(java.lang.String)Licenced under the Apache License, Version 2.0