com.sun.tools.xjc.maven2
Class XJCMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by com.sun.tools.xjc.maven2.XJCMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

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

A mojo that uses JAXB to generate a collection of javabeans from an XSD. For details on JAXB see JAXB 2.0 Project

Author:
Jonathan Johnson (jonjohnson@mail.com)

Field Summary
protected  java.lang.String args
          Adds arguments to the plugin.
protected  java.io.File catalog
          Specify the catalog file to resolve external entity references.
protected  java.lang.String[] excludeBindings
          A list of regular expression file search patterns to specify the binding files to be excluded.
protected  java.lang.String[] excludeSchemas
          A list of regular expression file search patterns to specify the schemas to be excluded from the includeSchemas list.
protected  boolean extension
          If set to true, the XJC binding compiler will run in the extension mode.
protected  java.io.File generateDirectory
          Generated code will be written under this directory.
protected  java.lang.String generatePackage
          If specified, generated code will be placed under this Java package.
protected  java.lang.String[] includeBindings
          A list of regular expression file search patterns to specify the binding files to be processed.
protected  java.lang.String[] includeSchemas
          A list of regular expression file search patterns to specify the schemas to be processed.
protected  org.apache.maven.project.MavenProject project
          The Maven project reference.
protected  boolean readOnly
          Generate Java source files in the read-only mode if true is specified.
protected  boolean removeOldOutput
          Used in pair with nested elements.
protected  java.io.File schemaDirectory
          The source directory containing *.xsd schema and *.xjb binding files.
protected  boolean strict
          Perform strict validation of the input schema.
protected  boolean verbose
          If verbose all the configured settings that are to be passed to the xjc compiler are logged.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
XJCMojo()
           
 
Method Summary
 void execute()
          Execute the maven2 mojo to invoke the xjc compiler based on configuration settings.
 
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

schemaDirectory

protected java.io.File schemaDirectory
The source directory containing *.xsd schema and *.xjb binding files.


includeSchemas

protected java.lang.String[] includeSchemas
A list of regular expression file search patterns to specify the schemas to be processed. Searching is based from the root of schemaDirectory. If this is not set then all .xsd files in schemaDirectory will be processed. Default is *.xsd.

todo In maven2 2 how to set default for String[]? expression="*.xsd"


excludeSchemas

protected java.lang.String[] excludeSchemas
A list of regular expression file search patterns to specify the schemas to be excluded from the includeSchemas list. Searching is based from the root of schemaDirectory.


includeBindings

protected java.lang.String[] includeBindings
A list of regular expression file search patterns to specify the binding files to be processed. Searching is based from the root of schemaDirectory. If this is not set then all .xjb files in schemaDirectory will be processed. Default is *.xjb.

todo In maven2 2 how to set default for String[]? expression="*.xjb"


excludeBindings

protected java.lang.String[] excludeBindings
A list of regular expression file search patterns to specify the binding files to be excluded. Searching is based from the root of schemaDirectory.


generatePackage

protected java.lang.String generatePackage
If specified, generated code will be placed under this Java package.


generateDirectory

protected java.io.File generateDirectory
Generated code will be written under this directory. If you specify target="doe/ray" and generatePackage="org.here", then files are generated to doe/ray/org/here.


readOnly

protected boolean readOnly
Generate Java source files in the read-only mode if true is specified. false by default.


extension

protected boolean extension
If set to true, the XJC binding compiler will run in the extension mode. Otherwise, it will run in the strict conformance mode. The default is false.


catalog

protected java.io.File catalog
Specify the catalog file to resolve external entity references. Support TR9401, XCatalog, and OASIS XML Catalog format. See the catalog-resolver sample and this article for details.


removeOldOutput

protected boolean removeOldOutput
Used in pair with nested elements. When this attribute is specified as "true", the files pointed to by the elements will be all deleted before the XJC binding compiler recompiles the source files. See the up-to-date check section for details. Default is false.


strict

protected boolean strict
Perform strict validation of the input schema.


verbose

protected boolean verbose
If verbose all the configured settings that are to be passed to the xjc compiler are logged.


args

protected java.lang.String args
Adds arguments to the plugin. Equivalent to .


project

protected org.apache.maven.project.MavenProject project
The Maven project reference.

Constructor Detail

XJCMojo

public XJCMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Execute the maven2 mojo to invoke the xjc compiler based on configuration settings.

Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2006-2009 java.net. All Rights Reserved.