Class TinderGeneratorTask
- All Implemented Interfaces:
Cloneable
Generates either source or resource files for each selected resource or composite data type. One file is generated for each selected entity. The files are generated using a Velocity template that can be taken from inside the hapi-timder-plugin project or can be located in other projects
The following Ant task properties are used
| Attribute | Description | Required |
| version | The FHIR version whose resource metadata
is to be used to generate the files Valid values: dstu2 | dstu3 | r4 | r5 |
Yes |
| projectHome | The project's base directory. This is used to possibly locate other assets within the project used in file generation. | No. Defaults to: ${basedir}/.. |
| generateResources | Should files be generated from FHIR resource metadata? Valid values: true | false |
At least one of these four options must be specified as true |
| generateDataTypes | Should files be generated from FHIR composite data type metadata? Valid values: true | false |
|
| generateValueSets | Should files be generated from FHIR value set metadata? This option can only be used if generating multiple files (one file per value-set.) Valid values: true | false |
|
| generateProfiles | Should files be generated from FHIR profile metadata? This option can only be used if generating multiple files (one file per profile.) Valid values: true | false |
|
| resourceSource | Which source of resource definitions should be processed? Valid values are:
|
No. Defaults to: spreadsheet |
| Java source files can be generated
for FHIR resources or composite data types. Source files can be
generated for each selected entity or a single source file can
be generated containing all of the selected entity. The following configuration
properties control the naming of the generated source files:
The following properties will be used when generating multiple source files: The following properties will be used when generating a single source file:
Note that all dots in the targetPackage will be replaced by the path separator character when building the
actual source file location. Also note that |
||
| targetSourceDirectory | The source directory to contain the generated Java packages and classes. | Yes when Java source files are to be generated |
| targetPackage | The Java package that will contain the generated classes. This package is generated in the <targetSourceDirectory> if needed. | Yes when targetSourceDirectory is specified |
| packageBase | The base Java package for related classes. This property can be used to reference class in other places in a folder structure. | No |
| targetFile | The name of the file to be generated | Yes when generating a single file containing all selected elements |
| filenamePrefix | The prefix string that is to be added onto the beginning of the resource or composite data type name to become the Java class name or resource file name. | No |
| filenameSuffix | Suffix that will be added onto the end of the resource or composite data type name to become the Java class name or resource file name. | No |
| Resource (non-Java) files can also be generated
for FHIR resources or composite data types. a file can be
generated for each selected entity or a single file can
be generated containing all of the selected entity. The following configuration
properties control the naming of the generated files:
The following properties will be used when generating multiple files (one for each selected element): The following properties will be used when generating a single file containing all selected elements: |
||
| targetResourceDirectory | The resource directory to contain the generated files. | Yes when resource files are to be generated |
| targetFolder | The folder within the targetResourceDirectory where the generated files will be placed. This folder is generated in the <targetResourceDirectory> if needed. | No |
| template | The path of one of the Velocity templates
contained within the hapi-tinder-plugin Maven plug-in
classpath that will be used to generate the files. |
One of these two options must be configured |
| templateFile | The full path to the Velocity template that is to be used to generate the files. | |
| velocityPath | When using the templateFile option, this property
can be used to specify where Velocity macros and other resources are located. |
No. Defaults to same directory as the template file. |
| velocityProperties | Specifies the full path to a java properties file containing Velocity configuration properties | No. |
| includeResources | A list of the names of the resources or composite data types that should be used in the file generation | No. Defaults to all defined resources except for DSTU2,
the Binary resource is excluded and
for DSTU3, the Conformance resource is excluded. |
| excludeResources | A list of the names of the resources or composite data types that should excluded from the file generation | No. |
| valueSetFiles | A list of files containing value-set resource definitions to be used. | No. Defaults to all defined value-sets that are referenced from the selected resources. |
| profileFiles | A list of files containing profile definitions to be used. | No. Defaults to the default profile for each selected resource |
- Author:
- Bill Denton
-
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 TypeMethodDescriptionprotected voidcleanup()voidexecute()voidsetExcludeResources(String names) voidsetFilenamePrefix(String filenamePrefix) voidsetFilenameSuffix(String filenameSuffix) voidsetGenerateDatatypes(boolean generateDatatypes) voidsetGenerateProfiles(boolean generateProfiles) voidsetGenerateResources(boolean generateResources) voidsetGenerateValueSets(boolean generateValueSets) voidsetIncludeResources(String names) voidsetPackageBase(String packageBase) voidsetProjectHome(String projectHome) voidsetResourceSource(String resourceSource) voidsetTargetFile(String targetFile) voidsetTargetFolder(String targetFolder) voidsetTargetPackage(String targetPackage) voidsetTargetResourceDirectory(File targetResourceDirectory) voidsetTargetSourceDirectory(File targetSourceDirectory) voidsetTemplate(String template) voidsetTemplateFile(File templateFile) voidsetValueSetFiles(String names) voidsetVelocityPath(String velocityPath) voidsetVelocityProperties(String velocityProperties) voidsetVerbose(boolean verbose) voidsetVersion(String version) protected voidMethods 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
-
TinderGeneratorTask
public TinderGeneratorTask()
-
-
Method Details
-
cleanup
protected void cleanup() -
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
setExcludeResources
-
setFilenamePrefix
-
setFilenameSuffix
-
setGenerateDatatypes
public void setGenerateDatatypes(boolean generateDatatypes) -
setGenerateProfiles
public void setGenerateProfiles(boolean generateProfiles) -
setGenerateResources
public void setGenerateResources(boolean generateResources) -
setGenerateValueSets
public void setGenerateValueSets(boolean generateValueSets) -
setIncludeResources
-
setPackageBase
-
setProjectHome
-
getResourceSource
-
setResourceSource
-
setTargetFile
-
setTargetFolder
-
setTargetPackage
-
setTargetResourceDirectory
-
setTargetSourceDirectory
-
setTemplate
-
setTemplateFile
-
setValueSetFiles
-
setVelocityPath
-
setVelocityProperties
-
setVerbose
public void setVerbose(boolean verbose) -
setVersion
-
validateAttributes
protected void validateAttributes() throws org.apache.tools.ant.BuildException- Throws:
org.apache.tools.ant.BuildException
-