Version: 1.1.1

org.biomoby.shared.extended
Class NamespaceParser

java.lang.Object
  extended by org.biomoby.shared.extended.NamespaceParser

public class NamespaceParser
extends Object

Author:
Eddie created Oct 18, 2005 This class parses the RDF document that describes the namespace ontology.

An example of how to use this class is below:


       NamespaceParser p = new NamespaceParser("http://biomoby.org/RESOURCES/MOBY-S/Namespaces");
                MobyNamespace[] namespaces = p.getMobyNamespacesFromRDF();
                for (int i = 0; i < namespaces.length; i++) {
                        System.out.println(namespaces[i]);
                }
  

This would output the following: the name and description for each namespace in the document


Constructor Summary
NamespaceParser()
          Default constructor - need to set the URL for the RDF document that describes the Namespace ontology using setURL(String url) or setURL(URL url)
NamespaceParser(String url)
          Parameterized Constructor that takes in a string argument that is the url for the RDF document that describes the Namespace ontology.
NamespaceParser(URL url)
          Parameterized Constructor that takes in a url for the RDF document that describes the Namespace ontology.
 
Method Summary
 InputStream getInputStream()
           
 MobyNamespace[] getMobyNamespacesFromRDF()
           
 URL getUrl()
           
static void main(String[] args)
           
 void setInputStream(InputStream is)
          If not null, overrides the URL when reading the definitions (e.g. if you have the RDF as a String, not a URL use this).
 void setUrl(String url)
           
 void setUrl(URL url)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceParser

public NamespaceParser()
Default constructor - need to set the URL for the RDF document that describes the Namespace ontology using setURL(String url) or setURL(URL url)


NamespaceParser

public NamespaceParser(String url)
                throws MobyException
Parameterized Constructor that takes in a string argument that is the url for the RDF document that describes the Namespace ontology.

Parameters:
url - a string representation for the URL that resolves to the RDF document that describes the Namespace ontology
Throws:
MobyException - thrown if the url is malformed

NamespaceParser

public NamespaceParser(URL url)
                throws MobyException
Parameterized Constructor that takes in a url for the RDF document that describes the Namespace ontology.

Parameters:
url - the URL that resolves to the RDF document that describes the Namespace ontology
Throws:
MobyException - thrown if the url is malformed
Method Detail

setUrl

public void setUrl(URL url)
            throws MobyException
Parameters:
url - the URL that resolves to the RDF document that describes the Namespace ontology
Throws:
MobyException - thrown if the url is malformed

setUrl

public void setUrl(String url)
            throws MobyException
Parameters:
url - the string representation of the URL that resolves to the RDF document that describes the Namespace ontology
Throws:
MobyException - thrown if the url is malformed

getUrl

public URL getUrl()
Returns:
the url used to retrieve the RDF document that describes the Namespace ontology.

setInputStream

public void setInputStream(InputStream is)
If not null, overrides the URL when reading the definitions (e.g. if you have the RDF as a String, not a URL use this).


getInputStream

public InputStream getInputStream()

getMobyNamespacesFromRDF

public MobyNamespace[] getMobyNamespacesFromRDF()
                                         throws MobyException
Returns:
an array of MobyNamespace objects created by parsing the RDF document
Throws:
MobyException - thrown if the location of the RDF document describing the Namsepace ontology is invalid

main

public static void main(String[] args)
                 throws MobyException
Throws:
MobyException

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010