castor:generate

Full name:

org.codehaus.mojo:castor-maven-plugin:2.5:generate

Description:

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.

Attributes:

  • Requires a Maven project to be executed.
  • Binds by default to the lifecycle phase: generate-sources.

Required Parameters

Name Type Since Description
project MavenProject - The Maven project to act upon.
Default value is: ${project}.
User property is: project.

Optional Parameters

Name Type Since Description
bindingfile File - The binding file to use for mapping xml to java.
Default value is: ${basedir}/src/main/castor/bindings.xml.
User property is: bindingFile.
classGenerationMode String - The method to use for Java class generation; possible values are 'standard' (default) and 'velocity'.
Default value is: standard.
User property is: classGenerationMode.
createJdoDescriptors boolean - Whether to generate JDO-specific descriptor classes or not.
Default value is: false.
User property is: createJdoDescriptors.
descriptors boolean - If true, generate descriptors
Default value is: true.
User property is: descriptors.
dest File - The directory to output the generated sources to
Default value is: ${project.build.directory}/generated-sources/castor.
User property is: dest.
generateImportedSchemas boolean - Whether to generate Java classes from imported XML schemas or not.
Default value is: false.
User property is: generateImportedSchemas.
generateMappings boolean - Set to true to generate Castor XML class mappings for the Java classes generated by the XML code generator from imported XML schemas.
Default value is: false.
User property is: generateMappings.
lineSeparator String - The line separator to use in generated source. Can be either win, unix, or mac
User property is: lineSeparator.
marshal boolean - if false, don't generate the marshaller
Default value is: true.
User property is: marshal.
nameConflictStrategy String - The name of the strategy to use for handling name conflicts. Can be either warnViaConsoleDialog or informViaLog
Default value is: warnViaConsoleDialog.
User property is: nameConflictStrategy.
packaging String - The package for the generated source
User property is: packaging.
properties File - The castorbuilder.properties file to use
Default value is: ${basedir}/src/main/castor/castorbuilder.properties.
User property is: properties.
resourceDestination File - The (optional) directory to output generated resources files to.
Default value is: ${project.build.directory}/generated-sources/castor.
User property is: resourceDestination.
schema File - A schema file to process. If this is not set then all .xsd files in schemaDirectory will be processed.
User property is: schema.
schemaDirectory File - The source directory containing *.xsd files
Default value is: ${basedir}/src/main/castor.
User property is: schemaDirectory.
staleMillis int - The granularity in milliseconds of the last modification date for testing whether a source needs recompilation
Default value is: 0.
User property is: staleMillis.
tstamp File - 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
Default value is: ${project.build.directory}/xsds.
User property is: tstamp.
types String - Castor collection types. Allowable values are 'vector', 'arraylist', 'j2' or 'odmg' 'j2' and 'arraylist' are the same.
Default value is: arraylist.
User property is: types.
verbose boolean - Verbose output during generation
Default value is: false.
User property is: verbose.
warnings boolean - Enable warning messages
Default value is: false.
User property is: warnings.

Parameter Details

bindingfile:

The binding file to use for mapping xml to java.
  • Type: java.io.File
  • Required: No
  • User Property: bindingFile
  • Default: ${basedir}/src/main/castor/bindings.xml

classGenerationMode:

The method to use for Java class generation; possible values are 'standard' (default) and 'velocity'.
  • Type: java.lang.String
  • Required: No
  • User Property: classGenerationMode
  • Default: standard

createJdoDescriptors:

Whether to generate JDO-specific descriptor classes or not.
  • Type: boolean
  • Required: No
  • User Property: createJdoDescriptors
  • Default: false

descriptors:

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

dest:

The directory to output the generated sources to
  • Type: java.io.File
  • Required: No
  • User Property: dest
  • Default: ${project.build.directory}/generated-sources/castor

generateImportedSchemas:

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

generateMappings:

Set to true to generate Castor XML class mappings for the Java classes generated by the XML code generator from imported XML schemas.
  • Type: boolean
  • Required: No
  • User Property: generateMappings
  • Default: false

lineSeparator:

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

marshal:

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

nameConflictStrategy:

The name of the strategy to use for handling name conflicts. Can be either warnViaConsoleDialog or informViaLog
  • Type: java.lang.String
  • Required: No
  • User Property: nameConflictStrategy
  • Default: warnViaConsoleDialog

packaging:

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

project:

The Maven project to act upon.
  • Type: org.apache.maven.project.MavenProject
  • Required: Yes
  • User Property: project
  • Default: ${project}

properties:

The castorbuilder.properties file to use
  • Type: java.io.File
  • Required: No
  • User Property: properties
  • Default: ${basedir}/src/main/castor/castorbuilder.properties

resourceDestination:

The (optional) directory to output generated resources files to.
  • Type: java.io.File
  • Required: No
  • User Property: resourceDestination
  • Default: ${project.build.directory}/generated-sources/castor

schema:

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

schemaDirectory:

The source directory containing *.xsd files
  • Type: java.io.File
  • Required: No
  • User Property: schemaDirectory
  • Default: ${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
  • User Property: staleMillis
  • 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.io.File
  • Required: No
  • User Property: tstamp
  • Default: ${project.build.directory}/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
  • User Property: types
  • Default: arraylist

verbose:

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

warnings:

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