org.exolab.castor.builder
public class SourceGenerator extends BuilderConfiguration
Version: $Revision: 1.20 $ $Date: 2005/06/07 04:02:28 $
Field Summary | |
---|---|
static String | APP_DESC
The application description
|
static String | APP_NAME
The application name
|
static String | APP_URI
The application URI
|
static String | VERSION
The application version
|
Constructor Summary | |
---|---|
SourceGenerator()
Creates a SourceGenerator using the default FieldInfo factory | |
SourceGenerator(FieldInfoFactory infoFactory)
Creates a SourceGenerator using the specific field info Factory.
| |
SourceGenerator(FieldInfoFactory infoFactory, ExtendedBinding binding)
Creates a SourceGenerator using the specific field info Factory and the
given Binding element .
|
Method Summary | |
---|---|
void | generateSource(Schema schema, String packageName)
Creates Java Source code (Object model) for the given XML Schema.
|
void | generateSource(InputSource source, String packageName)
Creates Java Source code (Object model) for the given XML Schema
|
void | generateSource(Reader reader, String packageName)
Creates Java Source code (Object model) for the given XML Schema.
|
void | generateSource(String filename, String packageName)
Creates Java Source code (Object model) for the given XML Schema.
|
static String | getVersion()
Returns the version number of this SourceGenerator
|
static void | main(String[] args)
main class used for command line invocation |
boolean | mappingSchemaElement2Java()
Tests the org.exolab.castor.builder.javaclassmapping property for the 'element' value.
|
boolean | mappingSchemaType2Java()
Tests the org.exolab.castor.builder.javaclassmapping property for the 'type' value.
|
void | setBinding(ExtendedBinding binding)
Sets the binding to use with this instance of the SourceGenerator.
|
void | setBinding(String fileName)
Sets the binding to use given the path name of a Castor Binding File.
|
void | setBinding(InputSource source)
Sets the binding to use given an InputSource identifying
a Castor Binding File.
|
void | setCreateMarshalMethods(boolean createMarshalMethods)
Sets whether or not to create the XML marshalling framework specific
methods (marshall, unmarshall, validate) in the generated classes.
|
void | setDescriptorCreation(boolean createDescriptors)
Sets whether or not to create ClassDescriptors for
the generated classes. |
void | setDestDir(String destDir)
Sets the destination directory.
|
void | setGenerateImportedSchemas(boolean generate)
Sets whether or not to generate Java sources for imported XML Schema.
|
void | setGenerateMappingFile(boolean generateMapping)
Sets whether or not a mapping file should be generated, this
is false by default. |
void | setLineSeparator(String lineSeparator)
Sets the line separator to use when printing the source code |
void | setSAX1(boolean sax1)
Set to true if SAX1 should be used in the marshall method |
void | setSuppressNonFatalWarnings(boolean suppress) |
void | setTestable(boolean testable)
Sets whether or not to implement CastorTestable
|
void | setVerbose(boolean verbose)
Sets whether or not the source code generator prints
additional messages during generating source code |
static String | toURIRepresentation(String path) Returns a string which is the URI of a file. |
Parameters: infoFactory the FieldInfoFactory to use.
Parameters: infoFactory the FieldInfoFactory to use. binding the binding element to use.
Parameters: schema the XML schema to generate the Java sources for. packageName the package for the generated source files.
Parameters: source - the InputSource representing the XML schema. packageName the package for the generated source files
Parameters: reader the Reader with which to read the XML Schema definition. The caller should close the reader, since thie method will not do so. packageName the package for the generated source files
Parameters: filename the full path to the XML Schema definition packageName the package for the generated source files
Returns: the version number of this SourceGenerator
Parameters: args the String[] consisting of the command line arguments
Returns: True if the Source Generator is mapping schema elements to Java classes.
Returns: True if the Source Generator is mapping schema types to Java classes.
Parameters: binding the binding to use, null indicates that the default binding will be used.
Parameters: fileName the file that represents a Binding
Parameters: source an InputSource identifying a Castor Binding File.
Parameters: createMarshalMethods a boolean, when true indicates to generated the marshalling framework methods
Parameters: createDescriptors a boolean, when true indicates to generated ClassDescriptors
Parameters: destDir the destination directory.
Parameters: generate true to generate the java classes for the imported XML Schema
Parameters: generateMapping a flag that indicates whether or not a mapping file should be generated.
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: testable a boolean, when true indicates to implement CastorTestable
Parameters: verbose a boolean, when true indicates to print additional messages
Returns a string which is the URI of a file.
Parameters: path the absolute path of the file.
UNKNOWN: a string representing the URI of the file