org.codehaus.mojo.castor
Class GenerateMojo

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

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

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.

Author:
brozow , jesse

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
GenerateMojo()
           
 
Method Summary
 void execute()
          
 String getClassGenerationMode()
          Returns the method to use for Java class generation.
 boolean getCreateJdoDescriptors()
          Indicates whether JDO descriptors should be generated during code generation.
 File getDest()
          Returns the destination directory to used during code generation.
 boolean getMarshal()
          Indicates whether #marshal() methods will be generated during the code generation.
 String getPackaging()
          Returns the default package to be used during code generation.
 org.apache.maven.project.MavenProject getProject()
          Returns the MavenProject instance for which code generation should be executed.
 File getResourceDestination()
          Returns the destination directory for resource files generated during code generation.
 File getSchema()
          Returns the (single) XML schema file to be processed.
 File getTstamp()
          Returns the directory to store time stamp information.
 String getTypes()
          Returns the collection types Castor XML is capable of working with.
 boolean isGenerateImportedSchemas()
          Indicates whether code should be generated for imported XML schemas as well.
 void setBindingfile(File bindingfile)
          Sets the Castor XML code generator binding file to be used during code generation.
 void setClassGenerationMode(String classPrinterMethod)
          Sets the method to use for Java class generation; possible values are 'standard' (default) and 'velocity'.
 void setCreateJdoDescriptors(boolean newCreateJdoDescriptors)
          Sets whether JDO descriptors should be generated during code generation.
 void setDest(File dest)
          Sets the destination directory to used during code generation.
 void setGenerateImportedSchemas(boolean generateImportedSchemas)
          Sets whether code should be generated for imported XML schemas as well.
 void setGenerateMappings(boolean generateMappings)
          Sets whether mapping files should be created during code generation.
 void setMarshal(boolean marshal)
          Sets whether #marshal() methods will be generated during the code generation.
 void setPackaging(String packaging)
          Sets the default package to be used during code generation.
 void setProject(org.apache.maven.project.MavenProject project)
          Sets the MavenProject instance for which code generation should be executed.
 void setProperties(File properties)
          Sets the (user-specific) castorbuilder.properties file to be used during code generation.
 void setResourceDestination(File resourceDestination)
          Sets the destination directory for resource files generated during code generation.
 void setSchema(File schema)
          Sets the (single) XML schema file to be processed.
 void setTstamp(File tstamp)
          Sets the directory to store time stamp information.
 void setTypes(String types)
          Sets the collection types Castor XML is capable of working with.
 
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
 

Constructor Detail

GenerateMojo

public GenerateMojo()
Method Detail

execute

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

Throws:
org.apache.maven.plugin.MojoExecutionException
See Also:
Mojo.execute()

getDest

public File getDest()
Returns the destination directory to used during code generation.

Returns:
the destination directory to used during code generation.

getResourceDestination

public File getResourceDestination()
Returns the destination directory for resource files generated during code generation.

Returns:
the destination directory for resource files.

setDest

public void setDest(File dest)
Sets the destination directory to used during code generation.

Parameters:
dest - the destination directory to used during code generation.

setResourceDestination

public void setResourceDestination(File resourceDestination)
Sets the destination directory for resource files generated during code generation.

Parameters:
resourceDestination - the destination directory for generated resource files.

getTstamp

public File getTstamp()
Returns the directory to store time stamp information.

Returns:
the directory to store time stamp information.

setTstamp

public void setTstamp(File tstamp)
Sets the directory to store time stamp information.

Parameters:
tstamp - the directory to store time stamp information.

getPackaging

public String getPackaging()
Returns the default package to be used during code generation.

Returns:
the default package to be used during code generation.

setPackaging

public void setPackaging(String packaging)
Sets the default package to be used during code generation.

Parameters:
packaging - the default package to be used during code generation.

getSchema

public File getSchema()
Returns the (single) XML schema file to be processed.

Returns:
the (single) XML schema file to be processed.

setSchema

public void setSchema(File schema)
Sets the (single) XML schema file to be processed.

Parameters:
schema - the (single) XML schema file to be processed.

getTypes

public String getTypes()
Returns the collection types Castor XML is capable of working with.

Returns:
the collection types Castor XML is capable of working with.

setTypes

public void setTypes(String types)
Sets the collection types Castor XML is capable of working with.

Parameters:
types - the collection types Castor XML is capable of working with.

setBindingfile

public void setBindingfile(File bindingfile)
Sets the Castor XML code generator binding file to be used during code generation.

Parameters:
bindingfile - the Castor XML code generator binding file to be used during code generation.

setProperties

public void setProperties(File properties)
Sets the (user-specific) castorbuilder.properties file to be used during code generation.

Parameters:
properties - the (user-specific) castorbuilder.properties file to be used during code generation.

getMarshal

public boolean getMarshal()
Indicates whether #marshal() methods will be generated during the code generation.

Returns:
True if #marshal() methods will be generated during the code generation.

setMarshal

public void setMarshal(boolean marshal)
Sets whether #marshal() methods will be generated during the code generation.

Parameters:
marshal - True if #marshal() methods will be generated during the code generation.

isGenerateImportedSchemas

public boolean isGenerateImportedSchemas()
Indicates whether code should be generated for imported XML schemas as well.

Returns:
True if code should be generated for imported XML schemas as well.

setGenerateImportedSchemas

public void setGenerateImportedSchemas(boolean generateImportedSchemas)
Sets whether code should be generated for imported XML schemas as well.

Parameters:
generateImportedSchemas - True if code should be generated for imported XML schemas as well.

getProject

public org.apache.maven.project.MavenProject getProject()
Returns the MavenProject instance for which code generation should be executed.

Returns:
the MavenProject instance for which code generation should be executed.

setProject

public void setProject(org.apache.maven.project.MavenProject project)
Sets the MavenProject instance for which code generation should be executed.

Parameters:
project - the MavenProject instance for which code generation should be executed.

getCreateJdoDescriptors

public final boolean getCreateJdoDescriptors()
Indicates whether JDO descriptors should be generated during code generation.

Returns:
True if JDO descriptors should be generated during code generation.

setCreateJdoDescriptors

public final void setCreateJdoDescriptors(boolean newCreateJdoDescriptors)
Sets whether JDO descriptors should be generated during code generation.

Parameters:
newCreateJdoDescriptors - True if JDO descriptors should be generated during code generation.

setGenerateMappings

public final void setGenerateMappings(boolean generateMappings)
Sets whether mapping files should be created during code generation.

Parameters:
generateMappings - True if mapping files should be created during code generation.

getClassGenerationMode

public String getClassGenerationMode()
Returns the method to use for Java class generation.

Returns:
The method to use for Java class generation.

setClassGenerationMode

public void setClassGenerationMode(String classPrinterMethod)
Sets the method to use for Java class generation; possible values are 'standard' (default) and 'velocity'.

Parameters:
classPrinterMethod - The class generation mode to use.


Copyright © 2005-2011 Codehaus. All Rights Reserved.