org.exolab.castor.builder
public class SingleClassGenerator extends Object
Version: $Revision: 0000 $ $Date: $
Constructor Summary | |
---|---|
SingleClassGenerator(ConsoleDialog dialog, SourceGenerator sourceGenerator)
Creates an instance of this class. |
Method Summary | |
---|---|
boolean | process(JClass[] classes, SGStateInfo state)
Processes the given JClasses, one by one, stopping if the SourceGenerator
state indicates STOP after processing one class.
|
boolean | process(JClass jClass, SGStateInfo state)
Processes the given JClass by checking for class name conflicts, and if
there are none, making the class as processed and then printing the class
and, if appropriate, its class descriptors.
|
boolean | processIfNotAlreadyProcessed(Enumeration classKeys, SGStateInfo state)
Processes the JClass mapped by the provided key unless the JClass has
already been processed.
|
void | setDescriptorCreation(boolean createDescriptors)
Sets whether or not to create ClassDescriptors for the generated classes.
|
void | setDestDir(String destDir)
Sets the destination directory.
|
void | setLineSeparator(String lineSeparator)
Sets the line separator to use when printing the source code
|
void | setPromptForOverwrite(boolean promptForOverwrite)
Sets whether or not to prompt when we would otherwise overwrite an
existing JClass. |
Parameters: dialog A ConsoleDialog instance sourceGenerator A SourceGenerator instance
Parameters: classes Array of classes to process state SourceGenerator state
Returns: true if processing is allowed to continue, false if the SourceGenerator state is STOP_STATUS,
Throws: IOException If an already existing '.castor.cdr' file can not be loaded or found
If there is a class name conflict, at best the user stops the source generation and at worst the user continues, skipping this class.
Parameters: jClass the class to process state SourceGenerator state
Returns: true if processing is allowed to continue, false if the SourceGenerator state is STOP_STATUS,
Throws: IOException If an already existing '.castor.cdr' file can not be loaded or found
Parameters: state SourceGenerator state classKeys Enumeration over a collection of keys to ClassInfos
Returns: true if processing is allowed to continue, false if the SourceGenerator state is STOP_STATUS,
Throws: IOException If an already existing '.castor.cdr' file can not be loaded or found
Parameters: createDescriptors a boolean, when true indicates to generated ClassDescriptors
Parameters: destDir the destination directory.
Parameters: lineSeparator
the line separator to use when printing the source code. This
method is useful if you are generating source on one platform,
but will be compiling the source on a different platform.
Note:This can be any string, so be careful. I
recommend either using the default or using one of the
following:
windows systems use: "\r\n"
unix systems use: "\n"
mac systems use: "\r"
Parameters: promptForOverwrite the new value