org.codehaus.mojo.xmlbeans
Class CompileXmlBeansMojo

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

public class CompileXmlBeansMojo
extends AbstractXmlBeansPlugin

A Maven 2 plugin which parses xsd files and produces a corresponding object model based on the Apache XML Beans parser.

The plugin produces two sets of output files referred to as generated sources and generated classes. The former is then compiled to the build outputDirectory. The latter is generated in this directory.

Note that the descriptions for the goal's parameters have been blatently copied from http://xmlbeans.apache.org/docs/2.0.0/guide/antXmlbean.html for convenience.

Version:
$Id: CompileXmlBeansMojo.java 10704 2009-09-15 01:08:40Z djencks $
Author:
Brett Porter, Kris Bravo

Field Summary
protected  File classGenerationDirectory
          Set a location to generate CLASS files into.
protected  File defaultXmlConfigDir
          Default xmlConfigs directory.
protected  File schemaDirectory
          The directory where .xsd files are to be found.
protected  File sourceGenerationDirectory
          Set a location to generate JAVA files into.
protected  File staleFile
          The location of the flag file used to determine if the output is stale.
 
Fields inherited from class org.codehaus.mojo.xmlbeans.AbstractXmlBeansPlugin
catalogLocation, project
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
CompileXmlBeansMojo()
          Empty constructor for the XML Beans plugin.
 
Method Summary
 File getBaseDir()
          Returns the directory where the schemas are located.
 File getDefaultXmlConfigDir()
           
 File getGeneratedClassesDirectory()
          Returns the class directory of the project.
protected  File getGeneratedSchemaDirectory()
           
 File getGeneratedSourceDirectory()
          Returns the directory for saving generated source files.
 File getSchemaDirectory()
          Returns the directory where the schemas are located.
 File getStaleFile()
           
protected  List getXsdJars()
          Returns the list of xsd jars.
protected  void updateProject(org.apache.maven.project.MavenProject project, org.apache.xmlbeans.impl.tool.SchemaCompiler.Parameters compilerParams, boolean stale)
           
 
Methods inherited from class org.codehaus.mojo.xmlbeans.AbstractXmlBeansPlugin
execute, getCatalogFile, getClasspath, getCompiler, getConfigFiles, getEntityResolver, getErrorListeners, getExtensions, getJavaFiles, getJavaSource, getMdefNamespaces, getMemoryInitialSize, getMemoryMaximumSize, getName, getOutputJar, getRepackage, getWsdlFiles, getXsdFiles, hasCatalogFile, isDebug, isDownload, isJaxb, isNoAnn, isNoJavac, isNoPvr, isNoUpa, isNoVDoc, isQuiet, isVerbose, validate
 
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 File schemaDirectory
The directory where .xsd files are to be found.


classGenerationDirectory

protected File classGenerationDirectory
Set a location to generate CLASS files into.


sourceGenerationDirectory

protected File sourceGenerationDirectory
Set a location to generate JAVA files into.


staleFile

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


defaultXmlConfigDir

protected File defaultXmlConfigDir
Default xmlConfigs directory. If no xmlConfigs list is specified, this one is checked automatically.

Constructor Detail

CompileXmlBeansMojo

public CompileXmlBeansMojo()
Empty constructor for the XML Beans plugin.

Method Detail

updateProject

protected void updateProject(org.apache.maven.project.MavenProject project,
                             org.apache.xmlbeans.impl.tool.SchemaCompiler.Parameters compilerParams,
                             boolean stale)
                      throws org.apache.maven.artifact.DependencyResolutionRequiredException,
                             XmlBeansException
Specified by:
updateProject in class AbstractXmlBeansPlugin
Throws:
org.apache.maven.artifact.DependencyResolutionRequiredException
XmlBeansException

getBaseDir

public File getBaseDir()
Returns the directory where the schemas are located. Note that this is the base directory of the schema compiler, not the maven project.

Specified by:
getBaseDir in class AbstractXmlBeansPlugin
Returns:
The schema directory.

getGeneratedClassesDirectory

public final File getGeneratedClassesDirectory()
Returns the class directory of the project.

Returns:
The project build classes directory.

getGeneratedSourceDirectory

public final File getGeneratedSourceDirectory()
Returns the directory for saving generated source files.

Returns:
The generated=sources directory.

getStaleFile

public File getStaleFile()
Specified by:
getStaleFile in class AbstractXmlBeansPlugin

getDefaultXmlConfigDir

public File getDefaultXmlConfigDir()
Specified by:
getDefaultXmlConfigDir in class AbstractXmlBeansPlugin

getSchemaDirectory

public File getSchemaDirectory()
Returns the directory where the schemas are located. Note that this is the base directory of the schema compiler, not the maven project.

Specified by:
getSchemaDirectory in class AbstractXmlBeansPlugin
Returns:
The schema directory.

getXsdJars

protected List getXsdJars()
Returns the list of xsd jars.

Specified by:
getXsdJars in class AbstractXmlBeansPlugin

getGeneratedSchemaDirectory

protected File getGeneratedSchemaDirectory()
Specified by:
getGeneratedSchemaDirectory in class AbstractXmlBeansPlugin


Copyright © 2005-2012 Codehaus. All Rights Reserved.