|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.generator.Generator
The Generator is reading an input schema. The schema is converted into a DOM tree. Finally one or more source writers are executed.
Constructor Summary | |
Generator()
Creates new Generator |
Method Summary | |
void |
addOption(SchemaOption pOption)
Adds an option to the list of options. |
void |
addSourceWriter(SourceWriter pWriter)
Adds a SourceWriter to the end of the list of registered SourceWriters. |
void |
clearOptions()
Clears the list of options. |
void |
clearSourceWriters()
Clears the list of currently registered SourceWriters. |
void |
configure(Configurable pConfigurable)
Configures the given Configurable with the options returned by getOptions() . |
void |
generate(java.io.File pFile)
Opens the given file, calls the specified SchemaReaders () method and SourceWriters write() method. |
void |
generate(java.lang.String pSchema)
Calls the specified SchemaReaders parse() method and the SourceWriters write() method. |
void |
generate(java.net.URL pURL)
Opens the given URL, calls the specified SchemaReaders () method and SourceWriters write() method. |
protected SchemaReader |
getConfiguredSchemaReader()
Returns a SchemaReader configured with the options returned by getOptions . |
java.io.File |
getDestFile()
Returns the destination file. |
boolean |
getForce()
Returns whether generated files should be overwritten. |
static java.lang.String |
getJaxMeRuntimePackage()
Returns the JaxMe runtime package. |
java.util.Iterator |
getOptions()
Returns an iterator to the list of options. |
java.util.Date |
getSchemaDate()
Returns the schema creation date. |
SchemaReader |
getSchemaReader()
Returns the SchemaReader. |
java.io.File |
getSourceDirectory()
Returns the Generators target directory. |
java.util.Iterator |
getSourceWriters()
Returns an Iterator to the list of currently registered SourceWriters. |
void |
setDestFile(java.io.File pDestFile)
Sets the destination file. |
void |
setForce(boolean pForce)
Sets whether generated files should be overwritten. |
void |
setSchemaDate(java.util.Date pDate)
Sets the schema creation date. |
void |
setSchemaReader(SchemaReader pReader)
Sets the SchemaReader. |
void |
setSourceDirectory(java.io.File pDirectory)
Sets the Generators target directory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Generator()
Method Detail |
public void setSchemaReader(SchemaReader pReader)
Sets the SchemaReader.
public SchemaReader getSchemaReader()
Returns the SchemaReader.
public void setDestFile(java.io.File pDestFile)
Sets the destination file. If such a file is set and exists and the Generator can determine the time and date of the input file, then the Generator won't do anything, unless the schema file is newer than the destination file.
public java.io.File getDestFile()
Returns the destination file. If such a file is set and exists and the Generator can determine the time and date of the input file, then the Generator won't do anything, unless the schema file is newer than the destination file.
public void setSchemaDate(java.util.Date pDate)
Sets the schema creation date.
public boolean getForce()
Returns whether generated files should be overwritten. Defaults to false.
public void setForce(boolean pForce)
Sets whether generated files should be overwritten. Defaults to false.
public java.util.Date getSchemaDate()
Returns the schema creation date. May be null, if the date is unknown.
public void addSourceWriter(SourceWriter pWriter)
Adds a SourceWriter to the end of the list of registered SourceWriters.
clearSourceWriters()
,
getSourceWriters()
public java.util.Iterator getSourceWriters()
Returns an Iterator to the list of currently registered SourceWriters. This iterator is not "live": Changes in the actual list won't be reflected in the iteration. Likewise, calling the iterators remove() method won't affect the actual list.
addSourceWriter(de.ispsoft.jaxme.generator.SourceWriter)
,
clearSourceWriters()
public void clearSourceWriters()
Clears the list of currently registered SourceWriters.
getSourceWriters()
,
addSourceWriter(de.ispsoft.jaxme.generator.SourceWriter)
public void setSourceDirectory(java.io.File pDirectory)
Sets the Generators target directory. Generated sources will appear in that directory.
pDirectory
- Directory where to create sources; may be null,
in which case the current directory is used (default).public java.io.File getSourceDirectory()
Returns the Generators target directory. Generated sources will appear in that directory.
public void clearOptions()
Clears the list of options.
public void addOption(SchemaOption pOption)
Adds an option to the list of options.
public java.util.Iterator getOptions()
Returns an iterator to the list of options.
public void configure(Configurable pConfigurable)
Configures the given Configurable with the options
returned by getOptions()
.
protected SchemaReader getConfiguredSchemaReader()
Returns a SchemaReader configured with the options
returned by getOptions
.
public void generate(java.lang.String pSchema) throws java.lang.Exception
Calls the specified SchemaReaders parse() method and the SourceWriters write() method.
java.lang.Exception
public void generate(java.io.File pFile) throws java.lang.Exception
Opens the given file, calls the specified SchemaReaders () method and SourceWriters write() method.
java.lang.Exception
public void generate(java.net.URL pURL) throws java.lang.Exception
Opens the given URL, calls the specified SchemaReaders () method and SourceWriters write() method.
java.lang.Exception
public static java.lang.String getJaxMeRuntimePackage()
Returns the JaxMe runtime package.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |