de.armax.ax.devtools.generator
Class AXgen

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byde.armax.ax.devtools.generator.AXgen
Direct Known Subclasses:
AXgenOjb

public class AXgen
extends org.apache.tools.ant.Task

Implements an ant task to generate code from XMI using Velocity templates.

The actual generation is done using nested elements. See AXgenCheck and AXgenGenerate for details

Author:
Peter Wieland, ARMAX mindware GmbH

Nested Class Summary
static class AXgen.AXgenSubTask
          Internal class for subtasks
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
AXgen()
           
 
Method Summary
 void addConfiguredXmiFileSet(org.apache.tools.ant.types.FileSet xmiFileSet)
          Called by ANT.
 AXgenCheck createCheck()
          Called by ant if nested element <check/> is found.
 AXelementSelector createElements()
           
 AXgenGenerate createGenerate()
          Called by ant if nested element <generate/> is found.
protected  AXgenGenerate createGenerateSubtask(AXgenerateConfig configTemplate)
           
 void execute()
          Executes the task
 java.lang.String getDestinationPath()
           
 AXelementSelector getElementSelector()
           
 java.lang.Class getHelperClass()
           
 java.lang.Class getModelClass()
          Getter for attribute model class
 java.lang.String getReferenceStereotype()
           
 java.lang.String getRootPackageName()
           
 java.lang.String getTemplatePath()
           
 java.lang.String[] getXmiFilenames()
           
 void init()
          This is called by ant at parse time.
 void setDestinationPath(java.lang.String destinationPath)
           
 void setHelperClass(java.lang.String helperClass)
           
 void setModelClass(java.lang.String modelClass)
          Setter for attribute modelClass This sets the model class used by the model factory
 void setReferenceStereotype(java.lang.String referenceStereotype)
           
 void setRootPackageName(java.lang.String rootPackageName)
           
 void setTemplatePath(java.lang.String templatePath)
           
 void setXmiFilename(java.lang.String xmiFilename)
           
 void setXmiFilenames(java.lang.String xmiFilenames)
           
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AXgen

public AXgen()
Method Detail

setXmiFilenames

public void setXmiFilenames(java.lang.String xmiFilenames)

setXmiFilename

public void setXmiFilename(java.lang.String xmiFilename)

getXmiFilenames

public java.lang.String[] getXmiFilenames()

setModelClass

public void setModelClass(java.lang.String modelClass)
                   throws org.apache.tools.ant.BuildException

Setter for attribute modelClass

This sets the model class used by the model factory

Parameters:
modelClass - the model class to use by the factory (must be an implementation class of AXmodel)
Throws:
org.apache.tools.ant.BuildException - if the specified class can not be found on the classpath.

getModelClass

public java.lang.Class getModelClass()
                              throws org.apache.tools.ant.BuildException

Getter for attribute model class

Returns:
the model class the model factory is currently configured to use
Throws:
org.apache.tools.ant.BuildException

setHelperClass

public void setHelperClass(java.lang.String helperClass)
                    throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException

getHelperClass

public java.lang.Class getHelperClass()

setDestinationPath

public void setDestinationPath(java.lang.String destinationPath)

getDestinationPath

public java.lang.String getDestinationPath()

setRootPackageName

public void setRootPackageName(java.lang.String rootPackageName)

getRootPackageName

public java.lang.String getRootPackageName()

setTemplatePath

public void setTemplatePath(java.lang.String templatePath)

getTemplatePath

public java.lang.String getTemplatePath()

setReferenceStereotype

public void setReferenceStereotype(java.lang.String referenceStereotype)

getReferenceStereotype

public java.lang.String getReferenceStereotype()

addConfiguredXmiFileSet

public void addConfiguredXmiFileSet(org.apache.tools.ant.types.FileSet xmiFileSet)

Called by ANT.

Add nested fileset "xmiFileSet" containing the xmi files.

The nested element is an ANT <fileset/>

Parameters:
xmiFileSet -

createElements

public AXelementSelector createElements()

getElementSelector

public AXelementSelector getElementSelector()

createCheck

public AXgenCheck createCheck()

Called by ant if nested element <check/> is found.

Creates a nested element that will check the model at execution time. See AXgenCheck for an explication of the attributes for this element


createGenerate

public AXgenGenerate createGenerate()

Called by ant if nested element <generate/> is found.

Creates a general purpose nested task that has to be configured properly to work. See AXgenGenerate for an explication of the attributes for this element.

To generate OJB related classes, try shortcuts for this element instead (see below)


createGenerateSubtask

protected AXgenGenerate createGenerateSubtask(AXgenerateConfig configTemplate)

init

public void init()
          throws org.apache.tools.ant.BuildException

This is called by ant at parse time. Used to initialize the model factory.

Throws:
org.apache.tools.ant.BuildException

execute

public void execute()
             throws org.apache.tools.ant.BuildException

Executes the task

Throws:
org.apache.tools.ant.BuildException


Copyright © 2003 ARMAX mindware GmbH. All Rights Reserved.