You can use the schemagen tool and commands to generate a schema for every namespace that’s referenced in your Java classes.
Synopsis
schemagen [ options ] java-files
optionsThe command-line options. See Options for the schemagen Tool.
java-filesThe Java class files to be processed.
Description
The schema generator creates a schema file for each name space referenced in your Java classes. Currently, you can’t control the name of the generated schema files.
Start the schema generator with the appropriate schemagen shell script in the bin directory for your platform. The current schema generator can process either Java source files or class files.
schemagen.sh Foo.java Bar.java ... Note: Writing schema1.xsd
If your Java files reference other classes, then those classes must be accessible on your system CLASSPATH environment variable, or they need to be specified in the schemagen command line with the class path options. If the referenced files aren’t accessible or specified, then you get errors when you generate the schema.
Options for the schemagen Tool
-d pathThis option sets the location where the schemagen command places processor-generated and javac-generated class files.
-cp path or -classpath pathThis option sets the location where the schemagen command places user-specified files.
-encoding encodingThis option specifies the encoding to use for apt or javac command invocations.
-episode fileThis option generates an episode file for separate compilation.
-disableXmlSecurityThis option disables XML security features for usage on XML parsing APIs.
-versionThis option displays release information.
-fullversionThis option displays full version information.
-helpThis option displays a help message.