Version: 1.1.1

Package org.biomoby.shared.parser

The package org.biomoby.shared.parser contains classes for parsing Biomoby data from an XML format (a Biomoby XML envelope) into Java objects, and back to XML.

See:
          Description

Interface Summary
MobyTags An interface containing all Biomoby XML element and attribute names.
 

Class Summary
JDOMUtils  
MobyCollection A specialized "envelope" that can carry a collection of other envelopes (represented by MobySimples objects), and giving them a name known as an article name for top-level object.
MobyDataElement A general "envelope" that can carry real Biomoby data objects.
MobyJob This class represents one BioMoby query (in a client request), or a result of one query (in a service response).
MobyPackage This is the main container for Biomoby data once they are extracted from an XML format.
MobyParameter A mixture of an "envelope" (because it inherits from a general envelope MobyDataElement, and Biomoby data, representing a secondary input - a secondary means that it is not used in a service discovery process.
MobyParser The MobyParser is able to read a Biomoby service/client XML data, parse them and create from them an instance of MobyPackage.
MobySimple A specialized "envelope" that can carry one real Biomoby data object, and gives it (usually) a name, also known as an article name for top-level object.
 

Exception Summary
ServiceException A container for an exception raised by a service provider when something wrong has to be reported back to a client.
 

Package org.biomoby.shared.parser Description

The package org.biomoby.shared.parser contains classes for parsing Biomoby data from an XML format (a Biomoby XML envelope) into Java objects, and back to XML.

The parser itself is in the class MobyParser that is accompanied by a list of all Biomoby's XML tags and attribute names stored in the MobyTags class.

Java objects representing parsed data start with MobyPackage - the main container (that also invokes parser itself). A MobyPackage instance corresponds to one network call to a Biomoby service, or to a response from such service.

Here is a full example how to get parsed Biomoby XML data into a MobyPackage (note that the input XML - the variable data in the example - can be given as a String, byte[], or a File which conveniently corresponds with the requirement from the Biomoby API):

  try {
      MobyPackage mobyInput = MobyPackage.createFromXML (data);

      // here do something with 'mobyInput'

  } catch (MobyException e) {
      System.out.println (e.getMessage());
  }
To bring data back into XML is again simple:
  try {
      // fill response data into a mobyOutput...
      MobyPackage mobyOutput = new MobyPackage();
      ...

      // and convert it into XML
      String xml = mobyOutput.toXML();

  } catch (MobyException e) {
      System.out.println (e.getMessage());
  }
A MobyPackage then contains one or more MobyJobs each of them containing one "execution" (or a "query" in a Biomoby speak). Note that a Biomoby service must be able to accept more invocations (jobs, queries) from one network request. A MobyJob can also carry a response from a service. Again, data coming from a service can consist from more responses - actually the number of the MobyJob objects in a response must be exactly the same as a number of the MobyJob objects in the originated request.

A MobyJob has the data themselves - they are either stored in MobySimples or in MobyCollections. The number and types of these MobyDataElements are defined for each Biomoby service in a Biomoby registry.

The MobySimples have data stored in various data objects - their classes are in the package org.biomoby.shared.datatypes. The primitive data types are there available directly, the other types can be generated (see details in the package itself).

Here is a picture showing how the entities are relates:

Data containers for parsed data


Version: 1.1.1

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