org.eaglei.datatools.etl.utils
Class NamespaceManager

java.lang.Object
  extended by org.eaglei.datatools.etl.utils.NamespaceManager

public class NamespaceManager
extends java.lang.Object

A small utility class for managing namespaces and qnames


Method Summary
static void add(java.lang.String prefix, java.lang.String url)
          Adds a single namespace key/value pair to the list
static void addAll(java.util.Map m)
          Adds all the namespace key/value pairs in the map to the list of all current namespaces
static void clear()
          Clear all known namespaces from the manager
static java.lang.String getPrefixForURI(java.lang.String url)
          Returns the namespace abbreviation used for the specified identifier
static java.lang.String getQNameFor(java.lang.String id)
          Encodes an rdf:ID URL as a Qname
static java.lang.String getURIForQName(java.lang.String qname)
          Returns the full expanded URI for a given qname
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addAll

public static void addAll(java.util.Map m)
Adds all the namespace key/value pairs in the map to the list of all current namespaces

Parameters:
m - Map - a set of namespace key/value pairs

add

public static void add(java.lang.String prefix,
                       java.lang.String url)
Adds a single namespace key/value pair to the list

Parameters:
prefix - String - the abbreviation for the namespace
url - String - the url of the namespace

getQNameFor

public static java.lang.String getQNameFor(java.lang.String id)
Encodes an rdf:ID URL as a Qname

Parameters:
id - String - the id to convert
Returns:
String - the resulting qname

getPrefixForURI

public static java.lang.String getPrefixForURI(java.lang.String url)
Returns the namespace abbreviation used for the specified identifier

Parameters:
url - String - the Id
Returns:
String - the abbreviation for the id

getURIForQName

public static java.lang.String getURIForQName(java.lang.String qname)
Returns the full expanded URI for a given qname

Parameters:
qname - String the qname to expand
Returns:
String the expanded URI, or null if the expansion cannot be performed

clear

public static void clear()
Clear all known namespaces from the manager



Copyright © 2009-2010 Eagle-I. All Rights Reserved.