castor:generate

A mojo that uses Castor to generate a collection of javabeans from an XSD. Detailed explanations of many of these can be found in the details for the Castor SourceGenerator.

Mojo Attributes:

  • Requires a Maven 2.0 project to execute.
  • Automatically executes within the lifecycle phase: generate-sources

Required Parameters

Name Type Description
project MavenProject No description.

Optional Parameters

Name Type Description
bindingfile String The binding file to use for mapping xml to java.
descriptors boolean If true, generate descriptors Default value is true.
dest String The directory to output the generated sources to
generateImportedSchemas boolean Whether to generate Java classes fro imported XML schemas or not. Default value is false.
lineSeparator String The line separator to use in generated source. Can be either win, unix, or mac
marshal boolean if false, don't generate the marshaller Default value is true.
packaging String The package for the generated source
properties String The castorbuilder.properties file to use
schema String A schema file to process. If this is not set then all .xsd files in schemaDirectory will be processed.
schemaDirectory String The source directory containing *.xsd files
staleMillis int The granularity in milliseconds of the last modification date for testing whether a source needs recompilation Default value is 0.
tstamp String The directory to store the processed xsds. The timestamps of these xsds are used to determine if the source for that xsd need to be regenerated
types String Castor collection types. Allowable values are 'vector', 'arraylist', 'j2' or 'odmg' 'j2' and 'arraylist' are the same. Default value is arraylist.
verbose boolean Verbose output during generation Default value is false.
warnings boolean Enable warning messages Default value is false.

Parameter Details

bindingfile

The binding file to use for mapping xml to java.

  • Type: java.lang.String
  • Required: No
  • Expression: ${basedir}/src/main/castor/bindings.xml

descriptors If true, generate descriptors
  • Type: boolean
  • Required: No
  • Default: true

dest The directory to output the generated sources to
  • Type: java.lang.String
  • Required: No
  • Expression: ${project.build.directory}/generated-sources/castor

generateImportedSchemas Whether to generate Java classes fro imported XML schemas or not.
  • Type: boolean
  • Required: No
  • Default: false

lineSeparator The line separator to use in generated source. Can be either win, unix, or mac
  • Type: java.lang.String
  • Required: No

marshal if false, don't generate the marshaller
  • Type: boolean
  • Required: No
  • Default: true

packaging The package for the generated source
  • Type: java.lang.String
  • Required: No

project No Description.
  • Type: org.apache.maven.project.MavenProject
  • Required: Yes
  • Expression: ${project}

properties The castorbuilder.properties file to use
  • Type: java.lang.String
  • Required: No
  • Expression: ${basedir}/src/main/castor/castorbuilder.properties

schema A schema file to process. If this is not set then all .xsd files in schemaDirectory will be processed.
  • Type: java.lang.String
  • Required: No

schemaDirectory The source directory containing *.xsd files
  • Type: java.lang.String
  • Required: No
  • Expression: ${basedir}/src/main/castor

staleMillis The granularity in milliseconds of the last modification date for testing whether a source needs recompilation
  • Type: int
  • Required: No
  • Expression: ${lastModGranularityMs}
  • Default: 0

tstamp The directory to store the processed xsds. The timestamps of these xsds are used to determine if the source for that xsd need to be regenerated
  • Type: java.lang.String
  • Required: No
  • Expression: ${basedir}/target/xsds

types Castor collection types. Allowable values are 'vector', 'arraylist', 'j2' or 'odmg' 'j2' and 'arraylist' are the same.
  • Type: java.lang.String
  • Required: No
  • Default: arraylist

verbose Verbose output during generation
  • Type: boolean
  • Required: No
  • Default: false

warnings Enable warning messages
  • Type: boolean
  • Required: No
  • Default: false