How to Customize Code Generation Templates?

Instant generator allows you to generate programming source code from class models. Basically, the content of the generated code follows the common coding convention of the programming language. There are also advanced options for you to configure some of the specific settings in forming the code, like the use of prefix for attributes and parameters.

Although the built-in way of generating source code can satisfy most of the general needs, you may want to define something more specific. For example, you may need to print a copyright statement at the beginning of the code file, which is not a kind of customization being supported by Instant generator.

Fortunately, the way of how source code will be generated is handled by Apache Velocity engine, a templating engine, and the templates being used are fully opened for customization. In the following sections, we will explain how to customize a template to make the generated code follow your requirement.

Setting up development environment

The template files are put under the resources/instantgenerator folder of Visual Paradigm installation directory. It is absolutely alright to edit those files directly. However, it is recommended to setup your own development environment, copy the template files to there to perform further editing. There are two reasons for separating the development environment from Visual Paradigm:

  • Avoid the unexpected template removal by un-installing the Visual Paradigm.
  • Avoid accidental file replacement by running product updates.

To setup your development environment:

  1. Create a folder as working directory.
  2. Explore %Visual-Paradigm-Installation-Directory%/resources/instantgenerator.
  3. You will see a number of sub-folders that have the programming language as their names. Each of them contains the templates files for a specific programming language. Copy the folder(s) of the language(s) you need to customize and paste to the working directory.

Customizing template

By having the text editor and the development environment ready, it's time to get your hand dirty with editing the template. As mentioned before, Instant generator adopted the Apache Velocity engine in generating source code. For those who are interested in knowing how to write templates, please read Velocity's Users' guide at:
http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html.

The following example demonstrates how to edit the PHP code generation template to reposition the brace of operation blocks to a new line.

Customization of operation in PHP class
Customization of operation in PHP class
  1. Open the template you need to edit in text editor.
    Open PhpOperation.vm in text editor
    Open PhpOperation.vm in text editor
    At the beginning, you may find the template a bit complex. But once you start working on it for a while, you'll find the syntax easy to understanding. In fact, it just composes of common programming construct like if-then-else statements, foreach and variables that programmers should find intuitive.
  2. Look for the area that you need to edit.
    Search for the open branch
    Search for the open branch
  3. Make change.
    Insert line breaks
    Insert line breaks
  4. Add a variable $indentation to indicate the need of printing indentation before the open brace.
    Add variable
    Add variable
  5. Save the file.

Generate code with the customized template

To generate code with customized template:

  1. In Visual Paradigm, select Tools > Code > Instant Generator from the toolbar, then the programming language that have the template customized.
  2. Specify the Template directory where the customized templates are stored.
    Specifying template directory
    Specifying template directory
  3. Select the classes to generate. Specify the output path. Click Generate to generate code. You may refer to previous chapters for details about instant generator.

List of API calls

The following table lists the available API calls for retrieving data from models.

Class API Return Value
Annotation commentArray() Comment[]
  commentAt(int) Comment
  commentCount() int
  commentIterator() Iterator
  getDocumentation() String
  getName() String
  getStereotype(String) Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getTaggedValue(String) TaggedValue
  getTaggedValueIgnoreCase(String) TaggedValue
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String) boolean
  hasTaggedValue(String) boolean
  hasTaggedValueIgnoreCase(String) boolean
  isFromLinkedProject() boolean
  propertyArray() Object[]
  propertyAt(int) AnnotationProperty
  propertyCount() int
  propertyIterator() Iterator
  stereotypeArray() Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount() int
  stereotypeIterator() Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int) TaggedValue
  taggedValueCount() int
  taggedValueIterator() Iterator
AnnotationProperty commentArray() Comment[]
  commentAt(int) Comment
  commentCount() int
  commentIterator() Iterator
  getDocumentation() String
  getName() String
  getStereotype(String) Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getTaggedValue(String) TaggedValue
  getTaggedValueIgnoreCase(String) TaggedValue
  getValue() String
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String) boolean
  hasTaggedValue(String) boolean
  hasTaggedValueIgnoreCase(String) boolean
  isFromLinkedProject() boolean
  stereotypeArray() Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount() int
  stereotypeIterator() Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int) TaggedValue
  taggedValueCount() int
  taggedValueIterator() Iterator
Association associationClassArray() AssociationClass[]
  associationClassAt(int) AssociationClass
  associationClassCount() int
  associationClassIterator() Iterator
  commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator() Iterator
  fromAssociationClassArray()
Object[]
  fromAssociationClassAt(int)
AssociationClass
  fromAssociationClassCount()
int
  fromAssociationClassIterator() Iterator
  getDocumentation()
String
  getFromElement()
Object
  getFromEnd()
AssociationEnd
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getToElement() Object
  getToEnd()
AssociationEnd
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isAbstract()
boolean
  isDerived() boolean
  isFromLinkedProject()
boolean
  isLeaf()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount() int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int

taggedValueIterator()
Iterator
  toAssociationClassArray()
Object[]
  toAssociationClassAt(int)
AssociationClass
  toAssociationClassCount()
int
  toAssociationClassIterator()
Iterator
AssociationClass commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getDocumentation() String
  getFromElement()
Object

getName()
String
  getStereotype(String)
Stereotype

getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue

getToElement()
Object

getVisibility()
String

hasStereotype(String)
boolean

hasStereotypeIgnoreCase(String)
boolean

hasTaggedValue(String)
boolean

hasTaggedValueIgnoreCase(String)
boolean

isFromLinkedProject()
boolean

stereotypeArray()
Stereotype[]

stereotypeAt(int)
Stereotype

stereotypeCount()
int

stereotypeIterator()
Iterator

taggedValueArray()
TaggedValue[]

taggedValueAt(int)
TaggedValue

taggedValueCount()
int

taggedValueIterator()
Iterator
AssociationEnd commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator() Iterator
  getAggregationKind()
String
  getDocumentation()
String

getMultiplicity()
String
  getName()
String
  getNavigable()
int
  getReferencedAttribute()
Attribute
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getTypeModifier()
String
  getVisibility()
String
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  isOrdered()
boolean
  isProvideGetterMethod()
boolean
  isProvideSetterMethod()
boolean
  isUnique()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
Attribute annotationArray() Object[]
  annotationAt(int) Annotation
  annotationCount() int
  annotationIterator()
Iterator
  commentArray() Comment[]
  commentAt(int) Comment
  commentCount() int
  commentIterator() Iterator
  getDeclarativeAttribute() String
  getDocumentation() String
  getFieldType() Object
  getInitialValue() String
  getMetadataTag() String
  getMultiplicity() String
  getName() String
  getScope() String
  getStereotype(String) Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getStorage() int
  getTaggedValue(String) TaggedValue
  getTaggedValueIgnoreCase(String) TaggedValue
  getTemplateTypeBindInfo() TemplateTypeBindInfo
  getType()  
  getTypeModifier() String
  getVisibility() String
  getXmlSchemaFieldType() Object
  hasGetter()
boolean
  hasSetter()
boolean
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String) boolean
  hasTaggedValue(String) boolean
  hasTaggedValueIgnoreCase(String) boolean
  hasXmlSchema() boolean
  isAbstract() boolean
  isConst() boolean
  isDefault() boolean
  isExtern() boolean
  isFinal() boolean
  isFromLinkedProject() boolean
  isHasGetter() boolean
  isHasSetter() boolean
  isIndexer() boolean
  isNew() boolean
  isOrdered() boolean
  isOverload() boolean
  isOverride() boolean
  isReadonly() boolean
  isShadow() boolean
  isTransient() boolean
  isUnique() boolean
  isUnsafe() boolean
  isVirtual()
boolean
  isVisible()
boolean
  isVolatile() boolean
  isWithEvent()
boolean
  propertyParameterArray()
Object[]
  propertyParameterAt(int)
Parameter
  propertyParameterCount()
int
  propertyParameterIterator()
Iterator
  stereotypeArray()
Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator() Iterator
AttributeType commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getDocumentation()
String
  getFixed()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getUse()
String
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount() int
  stereotypeIterator() Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int) TaggedValue
  taggedValueCount() int
  taggedValueIterator() Iterator
Class annotationArray() Object[]
  annotationAt(int) Annotation
  annotationCount() int
  annotationIterator() Iterator

associationArray() Association[]
  associationAt(int) Association
  associationClassArray() AssociationClass[]
  associationClassAt(int) AssociationClass
  associationClassCount() int
  associationClassIterator() Iterator
  associationCount() int
  associationIterator() Iterator
  attributeArray() Attribute[]
  attributeAt(int) Attribute
  attributeCount() int
  attributeIterator() Iterator
  commentArray() Comment[]
  commentAt(int) Comment
  commentCount() int
  commentIterator() Iterator
  containmentClassArray() Class[]
  containmentClassAt(int) Class
  containmentClassCount() int
  containmentClassIterator() Iterator
  fromAssociationArray() Object[]
  fromAssociationAt(int) Association
  fromAssociationClassArray() Object[]
  fromAssociationClassAt(int) AssociationClass
  fromAssociationClassCount() int
  fromAssociationClassIterator() Iterator
  fromAssociationCount() int
  fromAssociationIterator() Iterator
  generalizationArray() Generalization[]
  generalizationAt(int) Generalization
  generalizationCount() int
  generalizationIterator() Iterator
  getDeclarativeAttribute()
String
  getDocumentation() String
  getManageType() int
  getMetadataTag() String
  getName() String
  getStereotype(String) Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getTemplateTypeBindInfo() TemplateTypeBindInfo
  getType() Object
  getTypeModifier() String
  getVisibility() String
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String) boolean
  hasTaggedValue(String) boolean
  hasTaggedValueIgnoreCase(String) boolean
  isAbstract() boolean
  isActive() boolean
  isFinal() boolean
  isFromLinkedProject() boolean
  isInterface() boolean
  isLeaf() boolean
  isNew() boolean
  isNotInheritable() boolean
  isRoot() boolean
  isSealed() boolean
  isShadow() boolean
  isStatic() boolean
  isStereotypeInterface() boolean
  isStereotypeTypedef() boolean
  isTypedef() boolean
  operationArray() Operation[]
  operationAt(int) Operation
  operationCount() int
  operationIterator() Iterator
  realizationArray() Realization[]
  realizationAt(int) Realization
  realizationClassArray() Object[]
  realizationClassAt(int) Class
  realizationClassCount() int
  realizationClassIterator() Iterator
  realizationCount() int
  realizationIterator() Iterator
  stereotypeArray()
Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount() int
  stereotypeIterator() Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int) TaggedValue
  taggedValueCount() int
  taggedValueIterator() Iterator
  templateParameterArray() TemplateParameter[]
  templateParameterAt(int) TemplateParameter
  templateParameterCount() int
  templateParameterIterator() Iterator
  toAssociationArray()
Object[]
  toAssociationAt(int) Association

toAssociationClassArray() Object[]
  toAssociationClassAt(int)
AssociationClass
  toAssociationClassCount() int
  toAssociationClassIterator()
Iterator
  toAssociationCount() int
  toAssociationIterator() Iterator
Comment commentCount()
int
  commentArray()
Comment[]
  commentAt(int)
Comment
  commentIterator()
Iterator
  getAuthor() String
  getContent()
String
  getDateTime()
String
  getDocumentation() String
  getName() String
  getSummary() String
  getStereotype(String) Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getTaggedValue(String) TaggedValue
  getTaggedValueIgnoreCase(String) TaggedValue
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String) boolean
  hasTaggedValue(String) boolean
  hasTaggedValueIgnoreCase(String) boolean
  isFromLinkedProject() boolean
  stereotypeCount() int
  stereotypeArray() Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeIterator() Iterator
  taggedValueCount()
int
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueIterator()
Iterator
DataType commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator

getDocumentation()
String
  getName()
String
  getStereotype(String) Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount() int
  stereotypeIterator() Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
  templateParameterArray()
Object[]
  templateParameterAt(int)
TemplateParameter
  templateParameterCount()
int
  templateParameterIterator()
Iterator
ElementType commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount() int
  commentIterator() Iterator
  getBlock()
String
  getDocumentation() String
  getForm() String
  getName() String
  getNillable() String
  getStereotype(String) Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getTaggedValue(String) TaggedValue
  getTaggedValueIgnoreCase(String) TaggedValue
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String) boolean
  hasTaggedValue(String) boolean
  hasTaggedValueIgnoreCase(String) boolean
  isFromLinkedProject() boolean
  stereotypeArray() Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount() int
  stereotypeIterator() Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int) TaggedValue
  taggedValueCount() int
  taggedValueIterator() Iterator
Generalization commentArray()
Comment[]
  commentAt(int) Comment
  commentCount()
int
  commentIterator()
Iterator
  getDocumentation()
String
  getFromElement()
Object
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String) TaggedValue
  getTemplateTypeBindInfo()
TemplateTypeBindInfo
  getToElement() Object
  getVisibility()
String
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  isSubstitutable()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
ImplModel commentArray() Comment[]
  commentAt(int) Comment
  commentCount() int
  commentIterator() Iterator
  getCode() String
  getDocumentation() String
  getName() String
  getStereotype(String) Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getTaggedValue(String) TaggedValue
  getTaggedValueIgnoreCase(String) TaggedValue
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String) boolean
  hasTaggedValue(String) boolean
  hasTaggedValueIgnoreCase(String) boolean
  isFromLinkedProject() boolean
  stereotypeArray() Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount() int
  stereotypeIterator() Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int) TaggedValue
  taggedValueCount() int
  taggedValueIterator() Iterator
Object commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount() int
  commentIterator()
Iterator
  getDocumentation()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
Operation annotationArray()
Object[]
  annotationAt(int)
Annotation
  annotationCount()
int
  annotationIterator()
Iterator
  commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getAlias()
String
  getCharset()
int
  getDeclarativeAttribute() String
  getDllName()
String
  getDocumentation()
String
  getImplModel()
ImplModel
  getMetadataTag()
String
  getMethodKind()
int
  getName()
String
  getOperatorType()
int
  getProcedureName()
String
  getReturnType() Object
  getReturnTypeDocumentation()
String
  getReturnTypeModifier()
String
  getScope() String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getTemplateTypeBindInfo()
TemplateTypeBindInfo
  getVisibility()
String
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isAbstract()
boolean
  isConst()
boolean
  isDeclare()
boolean
  isDelegate()
boolean
  isExtern()
boolean
  isFinal()
boolean
  isFriend()
boolean
  isFromLinkedProject()
boolean
  isInline()
boolean
  isNative()
boolean
  isNew()
boolean
  isNotOverridable()
boolean
  isOverload() boolean
  isOverridable() boolean
  isOverride()
boolean
  isQuery()
boolean
  isReturnTypeConst()
boolean
  isSealed()
boolean
  isShadow() boolean
  isSynchronized() boolean
  isUnsafe()
boolean
  isVirtual()
boolean
  isVisible()
boolean
  parameterArray() Object[]
  parameterAt(int) Parameter
  parameterCount()
int
  parameterIterator()
Iterator
  postConditionArray()
Object[]
  postConditionAt(int)
Text
  postConditionCount()
int
  postConditionIterator()
Iterator
  preConditionArray()
Object[]
  preConditionAt(int)
Text
  preConditionCount()
int
  preConditionIterator()
Iterator
  raisedExceptionArray()
Object[]
  raisedExceptionAt(int)
Object
  raisedExceptionCount()
int
  raisedExceptionIterator()
Iterator
  stereotypeArray() Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount() int
  stereotypeIterator()
Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount() int
  taggedValueIterator() Iterator
  templateParameterArray() Object[]
  templateParameterAt(int) TemplateParameter
  templateParameterCount() int
  templateParameterIterator() Iterator
Package classArray() Class[]
  classAt(int) Class
  classCount() int
  classIterator() Iterator
  commentArray() Comment[]
  commentAt(int) Comment
  commentCount() int
  commentIterator() Iterator
  getDocumentation()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean

packageArray()
Object[]
  packageAt(int)
Package
  packageCount()
int
  packageIterator()
Iterator
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
  templateParameterArray()
Object[]
  templateParameterAt(int)
TemplateParameter
  templateParameterCount()
int
  templateParameterIterator()
Iterator
Parameter annotationArray() Object[]
  annotationAt(int)
Annotation
  annotationCount()
int
  annotationIterator()
Iterator
  commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getDeclarativeAttribute()
String
  getDefaultValue() String
  getDirection()
String
  getDocumentation()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getTemplateTypeBindInfo()
TemplateTypeBindInfo
  getType()
Object
  getTypeModifier()
String
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isConst() boolean
  isFinal()
boolean
  isFromLinkedProject()
boolean
  isOptional()
boolean
  isParamArray()
boolean
  isParams()
boolean
  stereotypeArray() Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount() int
  stereotypeIterator() Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int) TaggedValue
  taggedValueCount()
int
  taggedValueIterator() Iterator
Realization commentArray() Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getDocumentation()
String
  getFromElement()
Object
  getMapping()
String
  getName()
String

getStereotype(String)
Stereotype

getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getTemplateTypeBindInfo()
TemplateTypeBindInfo

getToElement()
Object

hasStereotype(String)
boolean

hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean

isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]

taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
Stereotype commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getDocumentation()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int) TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
TaggedValue commentArray()
Comment[]
  commentAt(int)
Comment

commentCount()
int
  commentIterator()
Iterator
  getDocumentation()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getType()
int
  getValue()
Object
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject() boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
TemplateParameter commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getDefaultValue()
String
  getDocumentation() String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
  templateTypeBindInfoArray()
Object[]
  templateTypeBindInfoAt(int)
TemplateTypeBindInfo
  templateTypeBindInfoCount()
int
  templateTypeBindInfoIterator()
Iterator
  typeArray()
Object[]
  typeAt(int)
Object
  typeCount()
int
  typeIterator()
Iterator
  typeModifierArray()
Object[]
  typeModifierAt(int)
String
  typeModifierCount()
int
  typeModifierIterator()
Iterator
TemplateTypeBindDetails commentArray() Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getArguments()
TemplateTypeBindInfo
  getDocumentation()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getWildcard()
int
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
TemplateTypeBindInfo commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  detailsArray()
Object[]
  detailsAt(int)
TemplateTypeBindDetails
  detailsCount()
int
  detailsIterator() Iterator
  getBindedType()
Object
  getDocumentation() String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String) Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  getTypeModifier()
String
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String) boolean
  isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
Text commentArray()
Comment[]
  commentAt(int)
Comment
  commentCount()
int
  commentIterator()
Iterator
  getDocumentation()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  hasStereotype(String) boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject() boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int) Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray()
TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
TextType commentArray() Comment[]
  commentAt(int)
Comment
  commentCount() int
  commentIterator()
Iterator
  getDocumentation()
String
  getName()
String
  getStereotype(String)
Stereotype
  getStereotypeIgnoreCase(String)
Stereotype
  getTaggedValue(String)
TaggedValue
  getTaggedValueIgnoreCase(String)
TaggedValue
  hasStereotype(String)
boolean
  hasStereotypeIgnoreCase(String)
boolean
  hasTaggedValue(String)
boolean
  hasTaggedValueIgnoreCase(String)
boolean
  isFromLinkedProject()
boolean
  stereotypeArray()
Stereotype[]
  stereotypeAt(int)
Stereotype
  stereotypeCount()
int
  stereotypeIterator()
Iterator
  taggedValueArray() TaggedValue[]
  taggedValueAt(int)
TaggedValue
  taggedValueCount()
int
  taggedValueIterator()
Iterator
  templateParameterArray()
Object[]
  templateParameterAt(int)
TemplateParameter
  templateParameterCount()
int
  templateParameterIterator()
Iterator
A list of API calls

Velocity syntax

The following lists the syntax that of statements that can be used in the template.

## ===== If =====
#if(...)
...
#end

## ===== If-then-Else =====
#if(...)
...
#else
...
#end

## ===== For-each =====
#foreach
...
#end

## ===== Continue with the template defined in (...) at the point where the call is made =====
#parse(...)

#set(...)

## ===== Comment =====
## ...

## ===== Comment =====
#* ... *#

## ===== Variable=====
${...}

Related Resources

The following resources may help you to learn more about the topic discussed in this page.

 
16. Instant Generator for Ruby Table of Contents Chapter 3. Java Round-Trip

We use cookies to offer you a better experience. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.OK