org.codehaus.mojo.jaxb2
Class XjcMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.jaxb2.XjcMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class XjcMojo
extends org.apache.maven.plugin.AbstractMojo

A Maven 2 plugin which parse xsd and binding files (xjb) and produces a corresponding object model based on the JAXB Xjc parsing engine.

Version:
$Id: XjcMojo.java 6588 2008-03-28 12:22:57Z bentmann $
Author:
jgenender@apache.org, jgenender

Field Summary
protected  java.lang.String arguments
          Space separated string of extra arguments, for instance -Xfluent-api -episode somefile; These will be passed on to XJC as "-Xfluent-api" "-episode" "somefile" options.
protected  java.io.File bindingDirectory
          The binding directory for xjb files
protected  java.lang.String bindingFiles
          List of files to use for bindings, comma delimited.
protected  java.io.File catalog
          Catalog file to resolve external entity references support TR9401, XCatalog, and OASIS XML Catalog format.
protected  boolean clearOutputDir
          Clears the output directory on each run.
protected  boolean dtd
          Treat input schemas as XML DTD (experimental, unsupported).
protected  boolean explicitAnnotation
          Allow generation of explicit annotations that are needed for JAXB2 to work on RetroTranslator.
protected  boolean extension
          Allow to use the JAXB Vendor Extensions.
protected  java.io.File generatedResourcesDirectory
          The optional directory where generated resources can be placed, generated by addons/plugins.
protected  java.lang.String httpproxy
          Set HTTP/HTTPS proxy.
protected  java.lang.String includeSchemasOutputPath
          The output path to include in your jar/war/etc if you wish to include your schemas in your artifact.
protected  boolean npa
          Suppress generation of package level annotations (package-info.java)
protected  boolean nv
          Do not perform strict validation of the input schema(s)
protected  java.io.File outputDirectory
          The working directory to create the generated java source files.
protected  java.lang.String packageName
          The package in which the source files will be generated.
protected  boolean quiet
          Suppress compiler output
protected  boolean readOnly
          Generated files will be in read-only mode
protected  boolean relaxng
          Treat input schemas as RELAX NG (experimental, unsupported).
protected  boolean relaxngCompact
          Treat input as RELAX NG compact syntax (experimental,unsupported)
protected  java.io.File schemaDirectory
          The schema directory or xsd files
protected  java.lang.String schemaFiles
          List of files to use for schemas, comma delimited.
protected  java.lang.String schemaListFileName
          A filename containing the list of files to use for schemas, comma delimited.
protected  java.io.File staleFile
          The location of the flag file used to determine if the output is stale.
protected  boolean verbose
          Be extra verbose
protected  boolean wsdl
          Treat input as WSDL and compile schemas inside it (experimental,unsupported)
protected  boolean xmlschema
          Treat input as W3C XML Schema (default)
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
XjcMojo()
           
 
Method Summary
protected  void copyXSDs()
           
 void execute()
           
 java.io.File[] getBindingFiles()
          Returns a file array of xjb files to translate to object models.
protected  void getSchemasFromFileListing(java.util.List<java.io.File> files)
          getSchemasFromFileListing gets all the entries in the given schemaListFileName and adds them to the list of files to send to xjc
 java.io.File[] getXSDFiles()
          Returns a file array of xsd files to translate to object models.
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputDirectory

protected java.io.File outputDirectory
The working directory to create the generated java source files.


generatedResourcesDirectory

protected java.io.File generatedResourcesDirectory
The optional directory where generated resources can be placed, generated by addons/plugins.


packageName

protected java.lang.String packageName
The package in which the source files will be generated.


catalog

protected java.io.File catalog
Catalog file to resolve external entity references support TR9401, XCatalog, and OASIS XML Catalog format.


httpproxy

protected java.lang.String httpproxy
Set HTTP/HTTPS proxy. Format is [user[:password]@]proxyHost[:proxyPort]


schemaDirectory

protected java.io.File schemaDirectory
The schema directory or xsd files


bindingDirectory

protected java.io.File bindingDirectory
The binding directory for xjb files


bindingFiles

protected java.lang.String bindingFiles
List of files to use for bindings, comma delimited. If none, then all xjb files are used in the bindingDirectory


schemaFiles

protected java.lang.String schemaFiles
List of files to use for schemas, comma delimited. If none, then all xsd files are used in the schemaDirectory Note: you may use either the 'schemaFiles' or 'schemaListFileName' option (you may use both at once)


schemaListFileName

protected java.lang.String schemaListFileName
A filename containing the list of files to use for schemas, comma delimited. If none, then all xsd files are used in the schemaDirectory. Note: you may use either the 'schemaFiles' or 'schemaListFileName' option (you may use both at once)


dtd

protected boolean dtd
Treat input schemas as XML DTD (experimental, unsupported).


npa

protected boolean npa
Suppress generation of package level annotations (package-info.java)


nv

protected boolean nv
Do not perform strict validation of the input schema(s)


relaxng

protected boolean relaxng
Treat input schemas as RELAX NG (experimental, unsupported).


relaxngCompact

protected boolean relaxngCompact
Treat input as RELAX NG compact syntax (experimental,unsupported)


quiet

protected boolean quiet
Suppress compiler output


readOnly

protected boolean readOnly
Generated files will be in read-only mode


verbose

protected boolean verbose
Be extra verbose


wsdl

protected boolean wsdl
Treat input as WSDL and compile schemas inside it (experimental,unsupported)


xmlschema

protected boolean xmlschema
Treat input as W3C XML Schema (default)


extension

protected boolean extension
Allow to use the JAXB Vendor Extensions.


explicitAnnotation

protected boolean explicitAnnotation
Allow generation of explicit annotations that are needed for JAXB2 to work on RetroTranslator.


arguments

protected java.lang.String arguments
Space separated string of extra arguments, for instance -Xfluent-api -episode somefile; These will be passed on to XJC as "-Xfluent-api" "-episode" "somefile" options.


staleFile

protected java.io.File staleFile
The location of the flag file used to determine if the output is stale.


includeSchemasOutputPath

protected java.lang.String includeSchemasOutputPath
The output path to include in your jar/war/etc if you wish to include your schemas in your artifact.


clearOutputDir

protected boolean clearOutputDir
Clears the output directory on each run. Defaults to 'true' but if false, will not clear the directory.

Constructor Detail

XjcMojo

public XjcMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

copyXSDs

protected void copyXSDs()
                 throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getSchemasFromFileListing

protected void getSchemasFromFileListing(java.util.List<java.io.File> files)
                                  throws org.apache.maven.plugin.MojoExecutionException
getSchemasFromFileListing gets all the entries in the given schemaListFileName and adds them to the list of files to send to xjc

Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occurs

getBindingFiles

public final java.io.File[] getBindingFiles()
Returns a file array of xjb files to translate to object models.

Returns:
An array of schema files to be parsed by the schema compiler.

getXSDFiles

public final java.io.File[] getXSDFiles()
                                 throws org.apache.maven.plugin.MojoExecutionException
Returns a file array of xsd files to translate to object models.

Returns:
An array of schema files to be parsed by the schema compiler.
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2005-2009 Savoir Technologies, Inc. All Rights Reserved.