|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Methods for recording namepsace prefix mappings and applying and unapplying them to URIs.
Note that a Model *is* a PrefixMapping, so all the PrefixMapping operations apply to Models, and a Model can be used to supply the PrefixMapping argument to setNsPrefixes.
Nested Class Summary | |
static class |
PrefixMapping.Factory
Factory class to create an unspecified kind of PrefixMapping. |
static class |
PrefixMapping.IllegalPrefixException
Exception to throw when the prefix argument to setNsPrefix is illegal for some reason. |
static class |
PrefixMapping.JenaLockedException
Exception to throw when trying to update a locked PrefixMapping. |
Field Summary | |
static PrefixMapping |
Standard
A PrefixMapping that contains the "standard" prefixes we know about, viz rdf, rdfs, dc, rss, vcard, and owl. |
Method Summary | |
java.lang.String |
expandPrefix(java.lang.String prefixed)
Expand the uri using the prefix mappings if possible. |
java.util.Map |
getNsPrefixMap()
Return a copy of the internal mapping from names to URI strings. |
java.lang.String |
getNsPrefixURI(java.lang.String prefix)
Get the URI bound to a specific prefix, null if there isn't one. |
java.lang.String |
getNsURIPrefix(java.lang.String uri)
Answer the prefix for the given URI, or null if there isn't one. |
PrefixMapping |
lock()
Lock the PrefixMapping so that changes can no longer be made to it. |
PrefixMapping |
removeNsPrefix(java.lang.String prefix)
Remove any existing maplet with the given prefix name and answer this mapping. |
PrefixMapping |
setNsPrefix(java.lang.String prefix,
java.lang.String uri)
Specify the prefix name for a URI prefix string. |
PrefixMapping |
setNsPrefixes(java.util.Map map)
Copies the prefix mapping from other into this. |
PrefixMapping |
setNsPrefixes(PrefixMapping other)
Copies the prefixes from other into this. |
java.lang.String |
usePrefix(java.lang.String uri)
Compress the URI using the prefix mappings if possible. |
Field Detail |
public static final PrefixMapping Standard
Method Detail |
public PrefixMapping setNsPrefix(java.lang.String prefix, java.lang.String uri)
A prefix name must be a valid NCName, or the empty string. The empty string is reserved to mean "the default namespace".
Any URI may be ignored; for example URIs that end in an NCName char may be discarded.
Does not check the RFC2396 validity of the URI. Bad URIs are either silently ignored or behave as if they were good.
prefix
- the string to be used for the prefix.uri
- the URI prefix to be named
PrefixMapping.IllegalPrefixException
- if the prefix is not an XML NCNamepublic PrefixMapping removeNsPrefix(java.lang.String prefix)
prefix
- the prefix string to remove
public PrefixMapping setNsPrefixes(PrefixMapping other)
other
- the PrefixMapping to add
public PrefixMapping setNsPrefixes(java.util.Map map)
map
- the Map whose maplets are to be added
public java.lang.String getNsPrefixURI(java.lang.String prefix)
prefix
- the prefix name to be looked up
public java.lang.String getNsURIPrefix(java.lang.String uri)
uri
- the uri whose prefix is to be found
public java.util.Map getNsPrefixMap()
public java.lang.String expandPrefix(java.lang.String prefixed)
prefixed
- a QName or URI
public java.lang.String usePrefix(java.lang.String uri)
uri
- the URI string to try and prefix-compress
public PrefixMapping lock()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |