scalaxb:generate

Full name:

org.scalaxb:scalaxb-maven-plugin:1.0.2-SNAPSHOT:generate

Description:

(no description)

Attributes:

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

Required Parameters

Name Type Since Description
outputDirectory File - The output directory.
Default value is: ${project.build.directory}/generated-sources/scalaxb.
User property is: scalaxb.outputDirectory.
wsdlDirectory File - The directory containing the WSDL files. If the specified directory does not exist or is empty, then it is ignored.
Default value is: ${project.basedir}/src/main/wsdl.
User property is: scalaxb.wsdlDirectory.
xsdDirectory File - The directory containing the XSD files. If the specified directory does not exist or is empty, then it is ignored.
Default value is: ${project.basedir}/src/main/xsd.
User property is: scalaxb.xsdDirectory.

Optional Parameters

Name Type Since Description
attributePrefix String - Prefix to prepend to the names of generated parameters for XML attributes.
This option sets a prefix to be used in the names of parameters for XML attributes. It is useful when a schema defines both an element and an attribute of the same name within a complex type.
User property is: scalaxb.attributePrefix.
chunkSize Integer - Maximum number of parameters to use in generated case class constructors. This allows parameters sequences to be separated into chunks of the given size.
classPrefix String - The prefix to use on generated classes.
User property is: scalaxb.classPrefix.
generateRuntime boolean - Generate the scalaxb classes required to use the generated bindings. This option is useful for preventing duplicate copies of the scalaxb runtime being present on the classpath when more than one jar contains scalaxb bindings. To prevent the scalaxb runtime sources being generated, this option should be set to false.
Default value is: true.
laxAny boolean - Relaxes namespace constraints of xs:any.
This option allows xs:any elements declared with a namespace attribute of ##local to contain qualified XML elements. According to the W3C XML Schema recommendation, an XML element that is declared to be in a namespace is not permitted content for an xs:any element with a namespace of ##local. By default, this option is false, thus enforcing this requirement. Setting this option to true allows namespaced content to be used.
Default value is: false.
User property is: scalaxb.lax-any.
packageDir boolean - Determines whether generated Scala files will be written into a directory corresponding to their package name. By default, the generated files are written in the output directory under a sub-directory that corresponds to the package name. For example, if the generated classes are in package 'foo', they will be generated in ${scalaxb.outputDirectory}/foo. Setting this value to false will cause the generated sources to be written directly into the output directory, without creating a directory for the package.
Default value is: true.
User property is: scalaxb.package-dir.
packageName String - The package in which to generate classes. Classes are generated in the package specified, unless the packageNames parameter is used to override this value.
Default value is: generated.
User property is: scalaxb.packageName.
packageNames PackageName[] - Map of namespace URIs to package names for generated classes.
This option can be used to override the packageName parameter (see above) for elements in specific namespaces. The mapping between namespace URIs and package names can be specifying any number of packageName elements within the packageNames element. For example:
<packageNames>
  <packageName>
    <uri>http://example.com/service1</uri>
    <package>com.example.service1<package>
  </packageName>
  <packageName>
    <uri>http://example.com/service2</uri>
    <package>com.example.service2<package>
  </packageName>
</packageNames>

parameterPrefix String - The prefix to use on generated parameter names.
User property is: scalaxb.parameterPrefix.
protocolFile String - The name of the file to generate that includes the protocol implementation; that is, the code that marshals values to and from XML.
Default value is: xmlprotocol.scala.
protocolPackage String - The package in which to generate the 'protocol' code; that is, the code that marshals values to and from XML. The generated code defines a package object for the named package. The package object defines implicit values required for using the scalaxb.toXML and scalaxb.fromXML functions. If unspecified, the protocol code is generated in the same package as the generated classes that define the values marshalled to and from XML.
verbose boolean - (no description)
User property is: scalaxb.verbose.
wrapContents List - Wraps the content of specified complex types into separate case classes.
By default, when a type inherits from a complex type, the case class generated for that type will include fields for the content of the inherited type. With some XML schemas, this cause case classes with many fields to be generated. Many fields can cause case classes to become inconvenient to use, and there is a limit to the number of fields that can appear in a case class (see chunkSize).
The <wrapContents> option causes a separate case class to be generated for the named complex types. Where a type inherits from the complex type, it will have a reference to the case class for that complex type, instead of a number of fields for the content of that complex type.
This option is useful when inheriting from complexTypes would cause a case class to contain too many fields. It may be a better alternative to using the chunkSize option, because that simply limits the number of fields in every generated case class. In contrast, this option provides more fine-grained control: it allows related fields to be grouped for a given set of types.
For example, the following will generate a separate case class for the complex type named in the <wrapContent> element.
<wrapContents>
  <wrapContent>{http://example.com/schema}ComplexType</wrapContent>
</wrapContents>

Parameter Details

attributePrefix:

Prefix to prepend to the names of generated parameters for XML attributes.
This option sets a prefix to be used in the names of parameters for XML attributes. It is useful when a schema defines both an element and an attribute of the same name within a complex type.
  • Type: java.lang.String
  • Required: No
  • User Property: scalaxb.attributePrefix

chunkSize:

Maximum number of parameters to use in generated case class constructors. This allows parameters sequences to be separated into chunks of the given size.
  • Type: java.lang.Integer
  • Required: No

classPrefix:

The prefix to use on generated classes.
  • Type: java.lang.String
  • Required: No
  • User Property: scalaxb.classPrefix

generateRuntime:

Generate the scalaxb classes required to use the generated bindings. This option is useful for preventing duplicate copies of the scalaxb runtime being present on the classpath when more than one jar contains scalaxb bindings. To prevent the scalaxb runtime sources being generated, this option should be set to false.
  • Type: boolean
  • Required: No
  • Default: true

laxAny:

Relaxes namespace constraints of xs:any.
This option allows xs:any elements declared with a namespace attribute of ##local to contain qualified XML elements. According to the W3C XML Schema recommendation, an XML element that is declared to be in a namespace is not permitted content for an xs:any element with a namespace of ##local. By default, this option is false, thus enforcing this requirement. Setting this option to true allows namespaced content to be used.
  • Type: boolean
  • Required: No
  • User Property: scalaxb.lax-any
  • Default: false

outputDirectory:

The output directory.
  • Type: java.io.File
  • Required: Yes
  • User Property: scalaxb.outputDirectory
  • Default: ${project.build.directory}/generated-sources/scalaxb

packageDir:

Determines whether generated Scala files will be written into a directory corresponding to their package name. By default, the generated files are written in the output directory under a sub-directory that corresponds to the package name. For example, if the generated classes are in package 'foo', they will be generated in ${scalaxb.outputDirectory}/foo. Setting this value to false will cause the generated sources to be written directly into the output directory, without creating a directory for the package.
  • Type: boolean
  • Required: No
  • User Property: scalaxb.package-dir
  • Default: true

packageName:

The package in which to generate classes. Classes are generated in the package specified, unless the packageNames parameter is used to override this value.
  • Type: java.lang.String
  • Required: No
  • User Property: scalaxb.packageName
  • Default: generated

packageNames:

Map of namespace URIs to package names for generated classes.
This option can be used to override the packageName parameter (see above) for elements in specific namespaces. The mapping between namespace URIs and package names can be specifying any number of packageName elements within the packageNames element. For example:
<packageNames>
  <packageName>
    <uri>http://example.com/service1</uri>
    <package>com.example.service1<package>
  </packageName>
  <packageName>
    <uri>http://example.com/service2</uri>
    <package>com.example.service2<package>
  </packageName>
</packageNames>
  • Type: org.scalaxb.maven.PackageName[]
  • Required: No

parameterPrefix:

The prefix to use on generated parameter names.
  • Type: java.lang.String
  • Required: No
  • User Property: scalaxb.parameterPrefix

protocolFile:

The name of the file to generate that includes the protocol implementation; that is, the code that marshals values to and from XML.
  • Type: java.lang.String
  • Required: No
  • Default: xmlprotocol.scala

protocolPackage:

The package in which to generate the 'protocol' code; that is, the code that marshals values to and from XML. The generated code defines a package object for the named package. The package object defines implicit values required for using the scalaxb.toXML and scalaxb.fromXML functions. If unspecified, the protocol code is generated in the same package as the generated classes that define the values marshalled to and from XML.
  • Type: java.lang.String
  • Required: No

verbose:

(no description)
  • Type: boolean
  • Required: No
  • User Property: scalaxb.verbose

wrapContents:

Wraps the content of specified complex types into separate case classes.
By default, when a type inherits from a complex type, the case class generated for that type will include fields for the content of the inherited type. With some XML schemas, this cause case classes with many fields to be generated. Many fields can cause case classes to become inconvenient to use, and there is a limit to the number of fields that can appear in a case class (see chunkSize).
The <wrapContents> option causes a separate case class to be generated for the named complex types. Where a type inherits from the complex type, it will have a reference to the case class for that complex type, instead of a number of fields for the content of that complex type.
This option is useful when inheriting from complexTypes would cause a case class to contain too many fields. It may be a better alternative to using the chunkSize option, because that simply limits the number of fields in every generated case class. In contrast, this option provides more fine-grained control: it allows related fields to be grouped for a given set of types.
For example, the following will generate a separate case class for the complex type named in the <wrapContent> element.
<wrapContents>
  <wrapContent>{http://example.com/schema}ComplexType</wrapContent>
</wrapContents>
  • Type: java.util.List
  • Required: No

wsdlDirectory:

The directory containing the WSDL files. If the specified directory does not exist or is empty, then it is ignored.
  • Type: java.io.File
  • Required: Yes
  • User Property: scalaxb.wsdlDirectory
  • Default: ${project.basedir}/src/main/wsdl

xsdDirectory:

The directory containing the XSD files. If the specified directory does not exist or is empty, then it is ignored.
  • Type: java.io.File
  • Required: Yes
  • User Property: scalaxb.xsdDirectory
  • Default: ${project.basedir}/src/main/xsd