org.jrdf.writer.mem
Class RdfNamespaceMapImpl

java.lang.Object
  extended by org.jrdf.writer.mem.RdfNamespaceMapImpl
All Implemented Interfaces:
RdfNamespaceMap

public class RdfNamespaceMapImpl
extends Object
implements RdfNamespaceMap

Contains mappings between namespaces and partial URIs.

Author:
TurnerRX

Constructor Summary
RdfNamespaceMapImpl()
           
 
Method Summary
 Set<Map.Entry<String,String>> getNameEntries()
          Returns the Names mapping entry set.
 String getNamespace(URIReference resource)
          Returns the namespace that is mapped to the resource URI (prefix), or null if the URI is not mapped.
 void load(Graph graph)
          Loads namespaces from the graph.
 String replaceNamespace(URIReference resource)
          Returns a string representing the resource URI with its URI prefix replaced by the mapped namespace.
 void reset()
          Reset the name and uri mappings.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RdfNamespaceMapImpl

public RdfNamespaceMapImpl()
Method Detail

load

public void load(Graph graph)
          throws GraphException
Description copied from interface: RdfNamespaceMap
Loads namespaces from the graph.

Specified by:
load in interface RdfNamespaceMap
Parameters:
graph - Graph containing URIs to load from.
Throws:
GraphException - If the graph cannot be read.

replaceNamespace

public String replaceNamespace(URIReference resource)
                        throws NamespaceException
Description copied from interface: RdfNamespaceMap
Returns a string representing the resource URI with its URI prefix replaced by the mapped namespace.

Specified by:
replaceNamespace in interface RdfNamespaceMap
Parameters:
resource - URIReference resource URI
Returns:
String namespaced representation of resource URI
Throws:
NamespaceException - If there is no mapping for the partial resource URI.

getNamespace

public String getNamespace(URIReference resource)
Description copied from interface: RdfNamespaceMap
Returns the namespace that is mapped to the resource URI (prefix), or null if the URI is not mapped.

Specified by:
getNamespace in interface RdfNamespaceMap
Parameters:
resource - URIReference resource URI to look up.
Returns:
String mapped namespace

getNameEntries

public Set<Map.Entry<String,String>> getNameEntries()
Description copied from interface: RdfNamespaceMap
Returns the Names mapping entry set.

Specified by:
getNameEntries in interface RdfNamespaceMap
Returns:
name map entries.

reset

public void reset()
Description copied from interface: RdfNamespaceMap
Reset the name and uri mappings.

Specified by:
reset in interface RdfNamespaceMap

toString

public String toString()
Overrides:
toString in class Object