2.5.2 csmschemagen command (Mapping from Java to the XML Schema)
(1) Format
csmschemagen [option [option argument] ] [package-info.java file name] Java source file name
You can omit the option and package-info.java file. Always specify the option and package-info.java before the Java source file name.
(2) Function
Schema generator for mapping from Java to the XML Schema.
(3) Options
- -d output-destination-directory
- Specifies the output destination directory of the output schema document and intermediate file. For details on how to specify the output destination directory name, see Characters that can be specified in the file name or directory name of the command, path delimiting characters, and how to specify a path.
- If omitted, the current directory will become the output destination directory.
- -encoding character-encoding
- Specifies the character encoding of the Java source to be input.
- For character encoding that can be specified in Cosminexus XML Processor, see 1.3.2 Character encodings that can be processed.
- If omitted, depending on the OS in use, the operations will differ as follows:
- In Windows
- The default character encoding for the OS is applied.
- In UNIX
- The character encoding specified in the environment variable LANG is applied. Even if the environment variable LANG is not specified, the default character encoding for the OS is applied.
(4) Input Java source
You can specify one Java source file. For details on the characters that can be specified in the file name, path delimiting characters, and how to specify a path, see Characters that can be specified in the file name or directory name of the command, path delimiting characters, and how to specify a path.
(5) Output schema document
Output as file name scheman.xsd (n is a numeric character) in the current directory or directory specified in the -d option. If a file with the same name exists in the output destination directory, then that file will be overwritten.
(6) Intermediate file
- The csmschemagen command is used to compile the Java source file, and generate the .class file that is the intermediate file.
- If the Java source file contains the package statement, create a subdirectory under the output destination directory, and then output the .class file. The subdirectory name is determined based on the package name specified in the package statement.
- If the Java source file does not contain the package statement, output the .class file immediately under the output destination directory.
- The output destination directory of the .class file can be changed with the -d option.
(7) Return value
- 0:
- Normal termination.
- Value other than 0:
- Abnormal termination.
(8) Notes
Even if the Java source file input in the csmschemagen command is invalid in terms of the syntax, the schema document will be output. Do not use the schema document that is output because the schema document might be invalid in terms of the syntax.