Version: 1.1.1

org.biomoby.shared.extended
Class DataTypeParser

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

public class DataTypeParser
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:


        DataTypeParser p = new DataTypeParser("http://biomoby.org/RESOURCES/MOBY-S/Objects");
                MobyDataType[] types = p.getMobyDataTypesFromRDF();
                for (int i = 0; i < types.length; i++) {
                        System.out.println(types[i]);
                }
   

This would output a textual representation of the datatype.


Constructor Summary
DataTypeParser()
          Default constructor - need to set the URL for the RDF document that describes the Data Type ontology using setURL(String url) or setURL(URL url)
DataTypeParser(String url)
          Parameterized Constructor that takes in a string argument that is the url for the RDF document that describes the Data Type ontology.
DataTypeParser(URL url)
          Parameterized Constructor that takes in a url for the RDF document that describes the Data Type ontology.
 
Method Summary
 InputStream getInputStream()
           
 MobyDataType[] getMobyDataTypesFromRDF()
           
 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

DataTypeParser

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


DataTypeParser

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

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

DataTypeParser

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

Parameters:
url - the URL that resolves to the RDF document that describes the Data Type 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 Data Type ontology
Throws:
MobyException - thrown if the url is malformed

setUrl

public void setUrl(String url)
            throws MobyException
Parameters:
url - the string represention of the URL that resolves to the RDF document that describes the Data Type 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 Data Type 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()

getMobyDataTypesFromRDF

public MobyDataType[] getMobyDataTypesFromRDF()
                                       throws MobyException
Returns:
an array of MobyServiceType objects created by parsing the RDF document
Throws:
MobyException - thrown if the location of the RDF document describing the Data Type 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