| java.lang.Object com.hp.hpl.jena.shared.impl.PrefixMappingImpl
All known Subclasses: com.hp.hpl.jena.graph.compose.PolyadicPrefixMappingImpl, com.hp.hpl.jena.db.impl.DBPrefixMappingImpl,
PrefixMappingImpl | public class PrefixMappingImpl implements PrefixMapping(Code) | | An implementation of PrefixMapping. The mappings are stored in a pair
of hash tables, one per direction. The test for a legal prefix is left to
xerces's XMLChar.isValidNCName() predicate.
author: kers |
locked | protected boolean locked(Code) | | |
PrefixMappingImpl | public PrefixMappingImpl()(Code) | | |
checkUnlocked | protected void checkUnlocked()(Code) | | |
expandPrefix | public String expandPrefix(String prefixed)(Code) | | Expand a prefixed URI. There's an assumption that any URI of the form
Head:Tail is subject to mapping if Head is in the prefix mapping. So, if
someone takes it into their heads to define eg "http" or "ftp" we have problems.
|
getNsPrefixMap | public Map getNsPrefixMap()(Code) | | |
qnameFor | public String qnameFor(String uri)(Code) | | Answer the qname for uri 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.
See Also: com.hp.hpl.jena.shared.PrefixMapping.qnameFor(java.lang.String) |
regenerateReverseMapping | protected void regenerateReverseMapping()(Code) | | |
setNsPrefixes | public PrefixMapping setNsPrefixes(PrefixMapping other)(Code) | | Add the bindings of other to our own. We defer to the general case
because we have to ensure the URIs are checked.
Parameters: other - the PrefixMapping whose bindings we are to add to this. |
setNsPrefixes | public PrefixMapping setNsPrefixes(Map other)(Code) | | Add the bindings in the prefixToURI to our own. This will fail with a ClassCastException
if any key or value is not a String; we make no guarantees about order or
completeness if this happens. It will fail with an IllegalPrefixException if
any prefix is illegal; similar provisos apply.
Parameters: other - the Map whose bindings we are to add to this. |
shortForm | public String shortForm(String uri)(Code) | | Compress the URI using the prefix mapping. This version of the code looks
through all the maplets and checks each candidate prefix URI for being a
leading substring of the argument URI. There's probably a much more
efficient algorithm available, preprocessing the prefix strings into some
kind of search table, but for the moment we don't need it.
|
toString | public String toString()(Code) | | Answer a readable (we hope) representation of this prefix mapping.
|
withDefaultMappings | public PrefixMapping withDefaultMappings(PrefixMapping other)(Code) | | Answer this PrefixMapping after updating it with the (p, u)
mappings in other where neither p nor
u appear in this mapping.
|
|
|