Class ModelloTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.codehaus.modello.ant.ModelloTask
- All Implemented Interfaces:
Cloneable
public class ModelloTask
extends org.apache.tools.ant.Task
Ant task running Modello generators, the counterpart of the modello-maven-plugin goals.
Required: version, outputDirectory, at least one nested <model> and one <goal>.
Each model is generated once per goal; see README.md for all attributes and nested elements.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested<license>:file,textattribute or nested text.static classNested element with afileattribute.static classNested element with anameattribute.static classNested element withnameandvalueattributes. -
Field Summary
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNested<goal name="..."/>: generator id, e.g.voidNested<license file="..."/>or<license>text</license>; only one source allowed.voidNested<model file="..."/>: model file to read.voidNested<packagedVersion name="..."/>: same assetPackagedVersions(String).voidNested<param name="..." value="..."/>: parameter passed to Velocity templates.voidNested<pluralException name="plural" value="singular"/>.voidNested<property name="..." value="..."/>: raw Modello parameter.voidNested<template name="..."/>: Velocity template relative tovelocityBasedir.voidexecute()voidsetDomAsXpp3(boolean domAsXpp3) Map DOM content toXpp3Dominstead oforg.w3c.dom.Element.voidsetEncoding(String encoding) Encoding of generated files.voidsetEnforceMandatoryElements(boolean enforceMandatoryElements) Enforce mandatory elements in the generated XSD.voidsetExtendedClassnameSuffix(String extendedClassnameSuffix) Writer class name suffix forxpp3-extended-writer.voidsetFirstVersion(String firstVersion) First model version; xdoc shows the 'since' column for newer versions.voidsetJavaSource(String javaSource) Java source level of generated code.voidsetJsonSchemaFileName(String jsonSchemaFileName) Output file name for thejsonschemagoal.voidsetLicenseFile(File licenseFile) File with license header text.voidsetLicenseText(String licenseText) License header text.voidsetOutputDirectory(File outputDirectory) Directory for generated files; created if missing.voidsetPackagedVersions(String packagedVersions) Comma-separated historical versions, each generated into a versioned package.voidsetPackageWithVersion(boolean packageWithVersion) Append the version to generated package names.voidsetVelocityBasedir(File velocityBasedir) Base directory of Velocity templates; defaults to the project base directory.voidsetVersion(String version) Model version to generate.voidsetXdocFileName(String xdocFileName) Output file name for thexdocgoal.voidsetXsdFileName(String xsdFileName) Output file name for thexsdgoal.Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
ModelloTask
public ModelloTask()
-
-
Method Details
-
setVersion
Model version to generate. Required. -
setVelocityBasedir
Base directory of Velocity templates; defaults to the project base directory. -
setOutputDirectory
Directory for generated files; created if missing. Required. -
setPackageWithVersion
public void setPackageWithVersion(boolean packageWithVersion) Append the version to generated package names. Defaultfalse. -
setPackagedVersions
Comma-separated historical versions, each generated into a versioned package. -
setJavaSource
Java source level of generated code. Default8. -
setEncoding
Encoding of generated files. Defaultutf-8. -
setDomAsXpp3
public void setDomAsXpp3(boolean domAsXpp3) Map DOM content toXpp3Dominstead oforg.w3c.dom.Element. Defaulttrue. -
setLicenseFile
File with license header text. Exclusive withsetLicenseText(String). -
setLicenseText
License header text. Exclusive withsetLicenseFile(File). -
setExtendedClassnameSuffix
Writer class name suffix forxpp3-extended-writer. DefaultEx. -
setXsdFileName
Output file name for thexsdgoal. -
setEnforceMandatoryElements
public void setEnforceMandatoryElements(boolean enforceMandatoryElements) Enforce mandatory elements in the generated XSD. Defaultfalse. -
setJsonSchemaFileName
Output file name for thejsonschemagoal. -
setFirstVersion
First model version; xdoc shows the 'since' column for newer versions. -
setXdocFileName
Output file name for thexdocgoal. -
addConfiguredModel
Nested<model file="..."/>: model file to read. At least one required. -
addConfiguredTemplate
Nested<template name="..."/>: Velocity template relative tovelocityBasedir. -
addConfiguredGoal
Nested<goal name="..."/>: generator id, e.g.java. At least one required. -
addConfiguredPackagedVersion
Nested<packagedVersion name="..."/>: same assetPackagedVersions(String). -
addConfiguredParam
Nested<param name="..." value="..."/>: parameter passed to Velocity templates. -
addConfiguredPluralException
Nested<pluralException name="plural" value="singular"/>. -
addConfiguredProperty
Nested<property name="..." value="..."/>: raw Modello parameter. -
addConfiguredLicense
Nested<license file="..."/>or<license>text</license>; only one source allowed. -
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-