Public Member Functions | |
SourceGenerator () | |
SourceGenerator (FieldInfoFactory infoFactory) | |
SourceGenerator (FieldInfoFactory infoFactory, ExtendedBinding binding) | |
void | generateSource (Schema schema, String packageName) |
void | generateSource (InputSource source, String packageName) |
void | generateSource (Reader reader, String packageName) |
void | generateSource (String filename, String packageName) throws java.io.FileNotFoundException |
void | setSAX1 (boolean sax1) |
void | setSuppressNonFatalWarnings (boolean suppress) |
void | setVerbose (boolean verbose) |
void | setDescriptorCreation (boolean createDescriptors) |
void | setDestDir (String destDir) |
void | setCreateMarshalMethods (boolean createMarshalMethods) |
void | setGenerateImportedSchemas (boolean generate) |
void | setTestable (boolean testable) |
void | setBinding (ExtendedBinding binding) |
void | setBinding (String fileName) |
void | setBinding (InputSource source) |
void | setLineSeparator (String lineSeparator) |
boolean | mappingSchemaElement2Java () |
boolean | mappingSchemaType2Java () |
Static Public Member Functions | |
static String | getVersion () |
static void | main (String[] args) |
static String | toURIRepresentation (String path) |
Static Package Attributes | |
static final String | APP_NAME = "Castor" |
static final String | APP_DESC = "XML data binder for Java" |
static final String | VERSION = Version.VERSION |
static final String | APP_URI = "http://www.castor.org" |
A Java Source generation tool which uses XML Schema definitions to create an Object model.
org.exolab.castor.builder.SourceGenerator.SourceGenerator | ( | ) |
Creates a SourceGenerator using the default FieldInfo factory
Referenced by org.exolab.castor.builder.SourceGenerator.main().
org.exolab.castor.builder.SourceGenerator.SourceGenerator | ( | FieldInfoFactory | infoFactory | ) |
Creates a SourceGenerator using the specific field info Factory.
infoFactory | the FieldInfoFactory to use. |
org.exolab.castor.builder.SourceGenerator.SourceGenerator | ( | FieldInfoFactory | infoFactory, | |
ExtendedBinding | binding | |||
) |
Creates a SourceGenerator using the specific field info Factory and the given Binding element .
infoFactory | the FieldInfoFactory to use. | |
binding | the binding element to use. |
References org.exolab.javasource.JComment.appendComment(), org.exolab.castor.builder.BuilderConfiguration.load(), and org.exolab.castor.builder.SourceGenerator.setBinding().
void org.exolab.castor.builder.SourceGenerator.generateSource | ( | Schema | schema, | |
String | packageName | |||
) |
Creates Java Source code (Object model) for the given XML Schema.
schema | the XML schema to generate the Java sources for. | |
packageName | the package for the generated source files. |
References org.exolab.castor.core.exceptions.CastorException.getMessage(), org.exolab.castor.xml.schema.Schema.getSchemaLocation(), org.exolab.castor.builder.SGStateInfo.packageName, org.exolab.castor.builder.SGStateInfo.setDialog(), org.exolab.castor.builder.BuilderConfiguration.setLocationPackageMapping(), org.exolab.castor.builder.SGStateInfo.setPromptForOverwrite(), org.exolab.castor.builder.SGStateInfo.setSuppressNonFatalWarnings(), org.exolab.castor.builder.SGStateInfo.setVerbose(), and org.exolab.castor.xml.schema.Schema.validate().
Referenced by org.exolab.castor.tools.XSDCompiler.execute(), org.exolab.castor.builder.SourceGenerator.generateSource(), and org.exolab.castor.builder.SourceGenerator.main().
void org.exolab.castor.builder.SourceGenerator.generateSource | ( | InputSource | source, | |
String | packageName | |||
) |
Creates Java Source code (Object model) for the given XML Schema
source | - the InputSource representing the XML schema. | |
packageName | the package for the generated source files |
References org.exolab.castor.builder.SourceGenerator.generateSource(), org.exolab.castor.util.Configuration.getParser(), org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.getSchema(), org.exolab.castor.builder.util.ConsoleDialog.notify(), and org.exolab.castor.core.exceptions.CastorException.printStackTrace().
void org.exolab.castor.builder.SourceGenerator.generateSource | ( | String | filename, | |
String | packageName | |||
) | throws java.io.FileNotFoundException |
Creates Java Source code (Object model) for the given XML Schema.
filename | the full path to the XML Schema definition | |
packageName | the package for the generated source files |
References org.exolab.castor.builder.SourceGenerator.generateSource(), and org.exolab.castor.builder.SourceGenerator.toURIRepresentation().
void org.exolab.castor.builder.SourceGenerator.generateSource | ( | Reader | reader, | |
String | packageName | |||
) |
Creates Java Source code (Object model) for the given XML Schema.
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 |
References org.exolab.castor.builder.SourceGenerator.generateSource().
static String org.exolab.castor.builder.SourceGenerator.getVersion | ( | ) | [static] |
Returns the version number of this SourceGenerator
References org.exolab.castor.builder.SourceGenerator.VERSION.
static void org.exolab.castor.builder.SourceGenerator.main | ( | String[] | args | ) | [static] |
main class used for command line invocation
args | the String[] consisting of the command line arguments |
References org.exolab.castor.util.CommandLineOptions.addFlag(), org.exolab.castor.builder.SourceGenerator.APP_NAME, org.exolab.castor.builder.SourceGenerator.generateSource(), org.exolab.castor.util.CommandLineOptions.getOptions(), org.exolab.castor.util.CommandLineOptions.printHelp(), org.exolab.castor.builder.binding.BindingException.printStackTrace(), org.exolab.castor.util.CommandLineOptions.printUsage(), org.exolab.castor.builder.SourceGenerator.setBinding(), org.exolab.castor.builder.SourceGenerator.setCreateMarshalMethods(), org.exolab.castor.builder.SourceGenerator.setDescriptorCreation(), org.exolab.castor.builder.SourceGenerator.setDestDir(), org.exolab.castor.builder.SourceGenerator.setGenerateImportedSchemas(), org.exolab.castor.builder.SourceGenerator.setLineSeparator(), org.exolab.castor.builder.SourceGenerator.setSAX1(), org.exolab.castor.builder.SourceGenerator.setSuppressNonFatalWarnings(), org.exolab.castor.builder.SourceGenerator.setTestable(), org.exolab.castor.builder.SourceGenerator.setVerbose(), and org.exolab.castor.builder.SourceGenerator.SourceGenerator().
boolean org.exolab.castor.builder.SourceGenerator.mappingSchemaElement2Java | ( | ) |
Tests the org.exolab.castor.builder.javaclassmapping property for the 'element' value.
Reimplemented from org.exolab.castor.builder.BuilderConfiguration.
References org.exolab.castor.builder.binding.XMLBindingComponent.getBinding(), org.exolab.castor.builder.binding.Binding.getDefaultBindingType(), and org.exolab.castor.builder.binding.types.BindingType.getType().
boolean org.exolab.castor.builder.SourceGenerator.mappingSchemaType2Java | ( | ) |
Tests the org.exolab.castor.builder.javaclassmapping property for the 'type' value.
Reimplemented from org.exolab.castor.builder.BuilderConfiguration.
References org.exolab.castor.builder.binding.XMLBindingComponent.getBinding(), org.exolab.castor.builder.binding.Binding.getDefaultBindingType(), and org.exolab.castor.builder.binding.types.BindingType.getType().
void org.exolab.castor.builder.SourceGenerator.setBinding | ( | InputSource | source | ) |
Sets the binding to use given an InputSource identifying a Castor Binding File.
source | an InputSource identifying a Castor Binding File. |
References org.exolab.castor.builder.binding.BindingException.getMessage(), org.exolab.castor.builder.util.ConsoleDialog.notify(), and org.exolab.castor.builder.SourceGenerator.setBinding().
void org.exolab.castor.builder.SourceGenerator.setBinding | ( | ExtendedBinding | binding | ) |
Sets the binding to use with this instance of the SourceGenerator.
binding | the binding to use, null indicates that the default binding will be used. |
References org.exolab.castor.builder.binding.Binding.getPackage(), and org.exolab.castor.builder.binding.XMLBindingComponent.setBinding().
Referenced by org.exolab.castor.builder.SourceGenerator.main(), org.exolab.castor.builder.SourceGenerator.setBinding(), and org.exolab.castor.builder.SourceGenerator.SourceGenerator().
void org.exolab.castor.builder.SourceGenerator.setBinding | ( | String | fileName | ) |
Sets the binding to use given the path name of a Castor Binding File.
fileName | the file that represents a Binding |
References org.exolab.castor.builder.binding.BindingException.getMessage(), org.exolab.castor.builder.util.ConsoleDialog.notify(), and org.exolab.castor.builder.SourceGenerator.setBinding().
void org.exolab.castor.builder.SourceGenerator.setCreateMarshalMethods | ( | boolean | createMarshalMethods | ) |
Sets whether or not to create the XML marshalling framework specific methods (marshall, unmarshall, validate) in the generated classes. By default, these methods are generated.
createMarshalMethods | a boolean, when true indicates to generated the marshalling framework methods |
References org.exolab.castor.builder.SourceFactory.setCreateMarshalMethods().
Referenced by org.exolab.castor.builder.SourceGenerator.main(), and alma.tools.entitybuilder.CastorBuilder.run().
void org.exolab.castor.builder.SourceGenerator.setDescriptorCreation | ( | boolean | createDescriptors | ) |
Sets whether or not to create ClassDescriptors for the generated classes. By default, descriptors are generated.
createDescriptors | a boolean, when true indicates to generated ClassDescriptors |
Referenced by org.exolab.castor.builder.SourceGenerator.main(), and alma.tools.entitybuilder.CastorBuilder.run().
void org.exolab.castor.builder.SourceGenerator.setDestDir | ( | String | destDir | ) |
Sets the destination directory.
destDir | the destination directory. |
Referenced by org.exolab.castor.tools.XSDCompiler.execute(), org.exolab.castor.builder.SourceGenerator.main(), and alma.tools.entitybuilder.CastorBuilder.run().
void org.exolab.castor.builder.SourceGenerator.setGenerateImportedSchemas | ( | boolean | generate | ) |
Sets whether or not to generate Java sources for imported XML Schema. By default Java sources for imported XML schemas are not generated.
generate | true to generate the java classes for the imported XML Schema |
Referenced by org.exolab.castor.builder.SourceGenerator.main().
void org.exolab.castor.builder.SourceGenerator.setLineSeparator | ( | String | lineSeparator | ) |
Sets the line separator to use when printing the source code
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" |
Referenced by org.exolab.castor.tools.XSDCompiler.execute(), org.exolab.castor.builder.SourceGenerator.main(), and alma.tools.entitybuilder.CastorBuilder.run().
void org.exolab.castor.builder.SourceGenerator.setSAX1 | ( | boolean | sax1 | ) |
Set to true if SAX1 should be used in the marshall method
References org.exolab.castor.builder.SourceFactory.setSAX1().
Referenced by org.exolab.castor.builder.SourceGenerator.main().
void org.exolab.castor.builder.SourceGenerator.setSuppressNonFatalWarnings | ( | boolean | suppress | ) |
void org.exolab.castor.builder.SourceGenerator.setTestable | ( | boolean | testable | ) |
Sets whether or not to create the XML marshalling framework specific methods (marshall, unmarshall, validate) in the generated classes. By default, these methods are generated.
createMarshall | a boolean, when true indicates to generated the marshalling framework methods |
References org.exolab.castor.builder.SourceFactory.setTestable().
Referenced by org.exolab.castor.builder.SourceGenerator.main(), and alma.tools.entitybuilder.CastorBuilder.run().
void org.exolab.castor.builder.SourceGenerator.setVerbose | ( | boolean | verbose | ) |
Sets whether or not the source code generator prints additional messages during generating source code
verbose | a boolean, when true indicates to print additional messages |
Referenced by org.exolab.castor.builder.SourceGenerator.main(), and alma.tools.entitybuilder.CastorBuilder.run().
static String org.exolab.castor.builder.SourceGenerator.toURIRepresentation | ( | String | path | ) | [static] |
Returns a string which is the URI of a file.
No validation is done to check wether the file exists or not. This method will be no longer used when the JDK URL.toString() is fixed.
path | the absolute path of the file. |
Referenced by org.exolab.castor.builder.SourceGenerator.generateSource().
final String org.exolab.castor.builder.SourceGenerator.APP_DESC = "XML data binder for Java" [static, package] |
The application description
final String org.exolab.castor.builder.SourceGenerator.APP_NAME = "Castor" [static, package] |
The application name
Referenced by org.exolab.castor.builder.SourceGenerator.main().
final String org.exolab.castor.builder.SourceGenerator.APP_URI = "http://www.castor.org" [static, package] |
The application URI
final String org.exolab.castor.builder.SourceGenerator.VERSION = Version.VERSION [static, package] |
The application version
Referenced by org.exolab.castor.builder.SourceGenerator.getVersion().