|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.biomoby.service.generator.Generator
public abstract class Generator
A common superclass to all Moses generators.
It also contains property names (fields started by GPROP_) used by data types and service instances generators. The descriptions of the property names actually describe what will be the value of such properties.
Field Summary | |
---|---|
static String |
GPROP_AUTH
A regular expression that will be applied against service authority names. |
static String |
GPROP_DOTLOCATION
A path to a Graphviz program dot. |
static String |
GPROP_FILTER
A regular expression that will be applied to a data type name. |
static String |
GPROP_NOGEN
A debugging property: do not generate anything, just print what you would generate. |
static String |
GPROP_NOGRAPHS
Data type generator will not produce any graphs if this property is set to "true". |
static String |
GPROP_OUTDIR
A name of a directory where a generator puts its generated results. |
static String |
GPROP_SERVICE
A regular expression that will be applied against service names. |
static String |
GPROP_VERBOSE
Generator will print some messages if this property is set to "true". |
Constructor Summary | |
---|---|
Generator()
Default constructor. |
|
Generator(CentralCached worker)
Another constructor getting a ready-to-use accessor (the 'worker') to a, hopefully locally cached, BioMoby registry. |
|
Generator(String cacheDir)
Another constructor pointing to a cache directory where the retrieved data types are stored. |
|
Generator(String registryEndpoint,
String registryURI,
String cacheDir)
Another constructor pointing to a cache directory and defining where is a Biomoby registry whoe data types will be generated. |
Method Summary | |
---|---|
abstract void |
generate(Properties props)
Generate "things" from a given Biomoby registry. |
abstract 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). |
CentralCached |
getWorker()
Return an underlying object (a worker) that does all data types retrieving and caching them. |
static File |
makeDirs(String dirName,
String packageName)
Create all needed sub-directories - as required by given Java package name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String GPROP_FILTER
public static final String GPROP_OUTDIR
public static final String GPROP_AUTH
GPROP_SERVICE
. If its value is null or an
empty string filtering is ignored.
public static final String GPROP_SERVICE
GPROP_AUTH
. If its value is null or an empty string
filtering is ignored.
public static final String GPROP_VERBOSE
public static final String GPROP_NOGRAPHS
public static final String GPROP_DOTLOCATION
GPROP_NOGRAPHS
is set to
false) produce graphs showing place of a generated
data type in a tree of other data types. This property is
needed only if the dot program is not already on the
PATH.
public static final String GPROP_NOGEN
Constructor Detail |
---|
public Generator()
default Biomoby
registry
.
public Generator(String cacheDir) throws MobyException
default Biomoby
registry
is used.
cacheDir
- is a directory where to create or read from a
cache; the same directory can be safely shared for various
Biomoby registries
MobyException
- if there is a problem with reading or
creating the cachepublic Generator(String registryEndpoint, String registryURI, String cacheDir) throws MobyException
registryEndpoint
- is a URL of a Biomoby registryregistryURI
- is a namespace/URI of such registrycacheDir
- is a directory where to create or read from a
cache; the same directory can be safely shared for various
Biomoby registries
MobyException
- if there is a problem with reading or
creating the cachepublic Generator(CentralCached worker)
worker
- is an accessor to a BioMoby registryMethod Detail |
---|
public CentralCached getWorker()
public static File makeDirs(String dirName, String packageName) throws MobyException
dirName
- a name of a directory where package-related
subdirectories will be created. 'dirName' itself does not need
to exist either (will be created - unless file permissions will
stop it). If 'dirName' is null, however, its default value will
be used - which is defined by System property 'user.dir'.packageName
- a usual Java dot-separated name for which
all needed subdirectories will be created starting from the
'dirName'
MobyException
- if 'packageName' is empty, or if some
directories could not be createdpublic abstract Map<String,File> getTemplateNames()
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.
public abstract void generate(Properties props) throws MobyException
props
- are properties influencing the generated results
(e.g. where to put them)
MobyException
- if anything goes wrong
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |