|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.exolab.castor.builder.BuilderConfiguration org.exolab.castor.builder.SourceGenerator
A Java Source generation tool which uses XML Schema definitions to create an Object model.
Nested Class Summary |
Nested classes inherited from class org.exolab.castor.builder.BuilderConfiguration |
BuilderConfiguration.Property |
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,
org.exolab.castor.builder.binding.ExtendedBinding binding)
Creates a SourceGenerator using the specific field info Factory and the given Binding element . |
Method Summary | |
void |
generateSource(org.xml.sax.InputSource source,
java.lang.String packageName)
Creates Java Source code (Object model) for the given XML Schema |
void |
generateSource(java.io.Reader reader,
java.lang.String packageName)
Creates Java Source code (Object model) for the given XML Schema. |
void |
generateSource(org.exolab.castor.xml.schema.Schema schema,
java.lang.String packageName)
Creates Java Source code (Object model) for the given XML Schema. |
void |
generateSource(java.lang.String filename,
java.lang.String packageName)
Creates Java Source code (Object model) for the given XML Schema. |
static java.lang.String |
getVersion()
Returns the version number of this SourceGenerator |
static void |
main(java.lang.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(org.exolab.castor.builder.binding.ExtendedBinding binding)
Sets the binding to use with this instance of the SourceGenerator. |
void |
setBinding(org.xml.sax.InputSource source)
Sets the binding to use given an InputSource identifying a Castor Binding File. |
void |
setBinding(java.lang.String fileName)
Sets the binding to use given the path name of 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(java.lang.String destDir)
Sets the destination directory. |
void |
setGenerateImportedSchemas(boolean generate)
Sets whether or not to generate Java sources for imported XML Schema. |
void |
setLineSeparator(java.lang.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 create the XML marshalling framework specific methods (marshall, unmarshall, validate) in the generated classes. |
void |
setVerbose(boolean verbose)
Sets whether or not the source code generator prints additional messages during generating source code |
static java.lang.String |
toURIRepresentation(java.lang.String path)
Returns a string which is the URI of a file. |
Methods inherited from class org.exolab.castor.builder.BuilderConfiguration |
boundPropertiesEnabled, classDescFieldNames, equalsMethod, generateExtraCollectionMethods, getDefault, getProperty, lookupPackageByLocation, lookupPackageByNamespace, setClassDescFieldNames, setDefaultProperties, setEqualsMethod, setLocationPackageMapping, setNamespacePackageMapping, setPrimitiveWrapper, usePrimitiveWrapper |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SourceGenerator()
public SourceGenerator(FieldInfoFactory infoFactory)
infoFactory
- the FieldInfoFactory to use.public SourceGenerator(FieldInfoFactory infoFactory, org.exolab.castor.builder.binding.ExtendedBinding binding)
infoFactory
- the FieldInfoFactory to use.binding
- the binding element to use.Method Detail |
public void generateSource(org.exolab.castor.xml.schema.Schema schema, java.lang.String packageName)
schema
- the XML schema to generate the Java sources for.packageName
- the package for the generated source files.public void generateSource(org.xml.sax.InputSource source, java.lang.String packageName)
packageName
- the package for the generated source filespublic void generateSource(java.io.Reader reader, java.lang.String packageName)
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 filespublic void generateSource(java.lang.String filename, java.lang.String packageName) throws java.io.FileNotFoundException
filename
- the full path to the XML Schema definitionpackageName
- the package for the generated source files
java.io.FileNotFoundException
public static java.lang.String getVersion()
public void setSAX1(boolean sax1)
public void setSuppressNonFatalWarnings(boolean suppress)
public void setVerbose(boolean verbose)
verbose
- a boolean, when true indicates to
print additional messagespublic void setDescriptorCreation(boolean createDescriptors)
createDescriptors
- a boolean, when true indicates
to generated ClassDescriptorspublic void setDestDir(java.lang.String destDir)
destDir
- the destination directory.public void setCreateMarshalMethods(boolean createMarshalMethods)
createMarshalMethods
- a boolean, when true indicates
to generated the marshalling framework methodspublic void setGenerateImportedSchemas(boolean generate)
generate
- true to generate the java classes for the imported XML Schemapublic void setTestable(boolean testable)
public void setBinding(org.exolab.castor.builder.binding.ExtendedBinding binding)
binding
- the binding to use, null indicates that the default
binding will be used.public void setBinding(java.lang.String fileName)
fileName
- the file that represents a Bindingpublic void setBinding(org.xml.sax.InputSource source)
source
- an InputSource identifying a Castor Binding File.public static void main(java.lang.String[] args)
args
- the String[] consisting of the command line argumentspublic void setLineSeparator(java.lang.String lineSeparator)
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.
windows systems use: "\r\n" unix systems use: "\n" mac systems use: "\r"
public boolean mappingSchemaElement2Java()
mappingSchemaElement2Java
in class BuilderConfiguration
public boolean mappingSchemaType2Java()
mappingSchemaType2Java
in class BuilderConfiguration
public static java.lang.String toURIRepresentation(java.lang.String path)
Returns a string which is the URI of a file.
path
- the absolute path of the file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |