de.armax.ax.devtools.generator
Class AXgenerateConfig

java.lang.Object
  extended byde.armax.ax.devtools.generator.AXgenerateConfig
All Implemented Interfaces:
java.lang.Cloneable

public class AXgenerateConfig
extends java.lang.Object
implements java.lang.Cloneable

Capsulates configuration for AXgenGenerate subtasks.

Author:
Peter Wieland, ARMAX mindware GmbH

Constructor Summary
AXgenerateConfig()
           
AXgenerateConfig(AXgen axgen)
           
 
Method Summary
 java.lang.Object clone()
           
 AXelementSelector createElements()
           
 int getAbstract()
          Get the abstract property of this matcher.
 AXgen getAxgenTask()
           
 java.lang.String getDestinationFile()
          Getter for attribute destinationFile.
 java.lang.String getDestinationPath()
          Getter for attribute destinationPath.
 AXelementSelector getElementSelector()
           
 java.lang.String[] getElementTypes()
          Get the matching element types as an array of Strings.
 java.lang.String getEndTemplateFile()
          Getter for attribute endTemplateFile
 java.lang.Class getHelperClass()
          Getter for attribute helperClass
 int getInstantiable()
          Get the instantiable property of this matcher.
 java.lang.String getRootPackageName()
           
 java.lang.String getStartTemplateFile()
          Getter for attribute startTemplateFile
 java.lang.String getTemplateFile()
          Getter for attribute templateFile
 boolean match(AXmodelElement element)
          Check whether a model element is matched by this matcher.
 void setAbstract(java.lang.String abstractString)
          Configure this element matcher to match only elements that are abstract/not abstract.
 void setAxgenTask(AXgen axgen)
           
 void setDestinationFile(java.lang.String destinationFile)
          Setter for attribute destinationFile This is used to determine the destination files the output will be written to.
 void setDestinationPath(java.lang.String destinationPath)
          Setter for attribute destinationPath.
 void setElementTypes(java.lang.String elementTypes)
          Set the element types that are used for generation.
 void setEndTemplateFile(java.lang.String endTemplateFile)
          Setter for attribute endTemplateFile.
 void setHelperClass(java.lang.String helperClass)
          Set the attribute helperClass A helper class may be used in templates (accessible through the Velocity variable $helper) to perform any operations with the model elements A helper class must have a no argument method getInstance returning an instance of the helper class (or an instance of any other class that will be used as helper class) or a no argument constructor to be instantiated
 void setInstantiable(java.lang.String instantiableString)
          Configure this element matcher to match only elements that are instantiable/not instantiable.
 void setRootPackageName(java.lang.String rootPackageName)
           
 void setStartTemplateFile(java.lang.String startTemplateFile)
          Setter for attribute startTemplateFile.
 void setTemplateFile(java.lang.String templateFile)
          Setter for attrbute templateFile.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AXgenerateConfig

public AXgenerateConfig()

AXgenerateConfig

public AXgenerateConfig(AXgen axgen)
Method Detail

setElementTypes

public void setElementTypes(java.lang.String elementTypes)

Set the element types that are used for generation.

Parameters:
elementTypes - a comma separated list of element type names (class, interface and package)
Throws:
org.apache.tools.ant.BuildException - if the argument contains illegal data

getElementTypes

public java.lang.String[] getElementTypes()

Get the matching element types as an array of Strings.

If the elementTypes property was not yet set, returns the element type of the parent element matcher, which could thus be used as a default element matcher.

Returns:
the matching element types

setInstantiable

public void setInstantiable(java.lang.String instantiableString)

Configure this element matcher to match only elements that are instantiable/not instantiable.

Accepted values are true or yes if only instantiable classes are to be matched, any or null if instantiable and non instantiable classes are to be matched, any other value if only non instantiable classes are to be matched.

Parameters:
instantiableString -

getInstantiable

public int getInstantiable()

Get the instantiable property of this matcher. This property is ignored when the model element to match is not an AXclass.

If the instantiable property was not yet set, returns the instantiable property of the parent element matcher.

Returns:
an int value with 0 meaning only non-instantiable classes, 1 meaning only instantiable classes and -1 means any class.

setAbstract

public void setAbstract(java.lang.String abstractString)

Configure this element matcher to match only elements that are abstract/not abstract.

Accepted values are true or yes if only abstract classes are to be matched, any or null if abstract and non abstract classes are to be matched, any other value if only non abstract classes are to be matched.

Parameters:
abstractString -

getAbstract

public int getAbstract()

Get the abstract property of this matcher. This property is ignored when the model element to match is not an AXclass.

If the abstract property was not yet set, returns the instantiable property of the parent element matcher.

Returns:
an int value with 0 meaning only non abstract classes, 1 meaning only abstract classes and -1 means any class.

match

public boolean match(AXmodelElement element)

Check whether a model element is matched by this matcher.

Parameters:
element - the element to check
Returns:
true, if this matcher matches the model element, false otherwise

setDestinationPath

public void setDestinationPath(java.lang.String destinationPath)

Setter for attribute destinationPath.

This overrides the destinationPath attribute in the parent AXgen task.

See Also:
AXgen.setDestinationPath(String)

getDestinationPath

public java.lang.String getDestinationPath()

Getter for attribute destinationPath.

Returns:
returns value of destinationPath if it was set, else returns value of parent destination path.

setDestinationFile

public void setDestinationFile(java.lang.String destinationFile)

Setter for attribute destinationFile

This is used to determine the destination files the output will be written to.

Destination files may depend on the current element, code is generated for and on the package this element is located in. Any occurences of $element.[navigationString]() will be replaced by calling the methods represented by [navigationString] (separated by dots, no brackets) on the current element. Any occurences of $package.[navigationString]() will be replaced by doing the same thing on the current package

If destinationFile does not depend neither on packages nor on elements, one single file is generated

If destinationFile does not depend on elements, one file per package is generated


getDestinationFile

public java.lang.String getDestinationFile()

Getter for attribute destinationFile.


setTemplateFile

public void setTemplateFile(java.lang.String templateFile)

Setter for attrbute templateFile.

This sets the templateFile to be used for code generation. If a templatePath attribute was specified in the parent AXgen task, this path is used to locate the templates. If no templates are found on the templatePath or no templatePath was specified, templates are supposed to be on the classpath.

See Also:
AXgen.setTemplatePath(String)

getTemplateFile

public java.lang.String getTemplateFile()

Getter for attribute templateFile


setStartTemplateFile

public void setStartTemplateFile(java.lang.String startTemplateFile)

Setter for attribute startTemplateFile.


getStartTemplateFile

public java.lang.String getStartTemplateFile()

Getter for attribute startTemplateFile


setEndTemplateFile

public void setEndTemplateFile(java.lang.String endTemplateFile)

Setter for attribute endTemplateFile.


getEndTemplateFile

public java.lang.String getEndTemplateFile()

Getter for attribute endTemplateFile


createElements

public AXelementSelector createElements()

getElementSelector

public AXelementSelector getElementSelector()

setHelperClass

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

Set the attribute helperClass

A helper class may be used in templates (accessible through the Velocity variable $helper) to perform any operations with the model elements

A helper class must have a no argument method getInstance returning an instance of the helper class (or an instance of any other class that will be used as helper class) or a no argument constructor to be instantiated

Throws:
org.apache.tools.ant.BuildException

getHelperClass

public java.lang.Class getHelperClass()

Getter for attribute helperClass

Returns:
the value of helperClass or AXojbHelper.class if the property was not set.

setRootPackageName

public void setRootPackageName(java.lang.String rootPackageName)

getRootPackageName

public java.lang.String getRootPackageName()

clone

public java.lang.Object clone()

setAxgenTask

public void setAxgenTask(AXgen axgen)

getAxgenTask

public AXgen getAxgenTask()


Copyright © 2003 ARMAX mindware GmbH. All Rights Reserved.