Version: 1.1.1

org.biomoby.service.generator
Class DataTypesGenerator

java.lang.Object
  extended by org.biomoby.service.generator.Generator
      extended by org.biomoby.service.generator.DataTypesGenerator

public class DataTypesGenerator
extends Generator

A generator generating classes representing Biomoby data types.

Data types are generated using information stored in a Biomoby registry. In other words, generating is possible only for data types that had been registered.

The best way how to find what it does for you is to use command-line client MosesGenerators. Start MosesGenerators either from a command-line using a script:

 build/run/run-generator -h
 
or using Ant:
 ./build.sh moses-datatypes
 

Version:
$Id: DataTypesGenerator.java,v 1.8 2009/01/05 08:42:18 groscurt Exp $
Author:
Martin Senger

Field Summary
 
Fields inherited from class org.biomoby.service.generator.Generator
GPROP_AUTH, GPROP_DOTLOCATION, GPROP_FILTER, GPROP_NOGEN, GPROP_NOGRAPHS, GPROP_OUTDIR, GPROP_SERVICE, GPROP_VERBOSE
 
Constructor Summary
DataTypesGenerator()
           
DataTypesGenerator(CentralCached worker)
           
DataTypesGenerator(String cacheDir)
           
DataTypesGenerator(String registryEndpoint, String registryURI, String cacheDir)
           
 
Method Summary
 void generate(Properties props)
          Generate classes for all data types from a given Biomoby registry.
 Map<String,File> getTemplateNames()
          Getting names of templates is isolated here so a sub-class can override it (but any new teplate still needs to follow the same patterns as the original template - so it is not too flexible, anyway).
static boolean isPrimitiveType(String dataTypeName)
          Return true if 'dataTypeName' is a Biomoby primitive type.
 
Methods inherited from class org.biomoby.service.generator.Generator
getWorker, makeDirs
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTypesGenerator

public DataTypesGenerator()

DataTypesGenerator

public DataTypesGenerator(String cacheDir)
                   throws MobyException
Throws:
MobyException

DataTypesGenerator

public DataTypesGenerator(String registryEndpoint,
                          String registryURI,
                          String cacheDir)
                   throws MobyException
Throws:
MobyException

DataTypesGenerator

public DataTypesGenerator(CentralCached worker)
Method Detail

getTemplateNames

public Map<String,File> getTemplateNames()
Description copied from class: Generator
Getting names of templates is isolated here so a sub-class can override it (but any new teplate still needs to follow the same patterns as the original template - so it is not too flexible, anyway).

The values of returned Map are files. It their names are relative (which is the best way) then they are looked for in the CLASSPATH (including all jar files there).

Make sure that the returned path is correct for the system where JVM is running.

Specified by:
getTemplateNames in class Generator

generate

public void generate(Properties props)
              throws MobyException
Generate classes for all data types from a given Biomoby registry. This is the main method.

Specified by:
generate in class Generator
Parameters:
props - are properties influencing the generated results
Throws:
MobyException - if anything goes wrong
See Also:
property GPROP_FILTER, property GPROP_OUTDIR, property GPROP_VERBOSE, property GPROP_NOGRAPHS, property GPROP_DOTLOCATION

isPrimitiveType

public static boolean isPrimitiveType(String dataTypeName)
Return true if 'dataTypeName' is a Biomoby primitive type.


Version: 1.1.1

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