Tagged value types for Java

 

Overview

The tagged values provided by Objecteering are designed to let you adapt Java semantics to a UML model, in order to generate all Java notions accurately.  For example, the notion of native method in Java does not exist in UML.  A {JavaNative} tagged value on a UML operation allows you to specify this on a model.

 

Note:      Certain tagged values can be added to certain model elements directly through the "Java" tab of the auxiliary window.  For more information, please see "The auxiliary window and Java Developer".

 

 

Tagged values on a class

 

Name ...

Parameters ...

Role ...

JavaStatic

N/A

Used to declare the embedded class as being static.

JavaExtends

name of the mother class

Inherits non-modeled classes

JavaImplements

names of implemented interfaces

Implementation of non modeled interfaces

JavaImport

names of the imported classes and packages

Imports non-modeled packages and classes

JavaName

the class's Java name

During the generation phase, the parameter of this tagged value takes precedence over the modeling name.

JavaNonPublic

N/A

Indicates a non public class. This tagged value is only taken into account for a class contained within a class.

JavaExtern

N/A

Indicates a class for which code must not be generated.

JavaBean

N/A

Indicates a class as being a bean. This information is used for storage.

JavaBean

Resource

resource file

Indicates a resource to be stored at the same time as the class.

JavaNoAccessor

N/A

Non generation of the accessors on the class attributes and associations.

JavaDocumented Annotation

N/A

Indicates that annotations are to be documented by javadoc and similar tools by default.

JavaInherited

Annotation

N/A

Indicates that the annotation type is automatically inherited.

JavaRetention

Annotation

The retention policy, SOURCE, CLASS or RUNTIME.

Indicates how long annotations with the annotated type are to be retained.

JavaTarget

Annotation

Element type, like PARAMETER, FIELD or TYPE.

Indicates the kinds of program element to which the annotation type applies.

JavaFileName

N/A

Used internally to manage file names.

JavaNoImport

N/A

Specifies that no imports must be generated for this class.

nocode

N/A

Prevents this class from being generated. No Java file is generated for this class.

persistence

N/A

Specifies that the class is persistent.

 

 

Tagged values on a package

 

Name ...

Parameters ...

Role ...

JavaRoot

N/A

Causes the generation of the package structure to begin from the annotated package.

JavaNoPackage

N/A

Causes the generation of the package structure to ignore the annotated package.

JavaImport

names of the imported classes and packages

Imports non-modeled packages and classes.

JavaName

the package's Java name

during the generation phase, the parameter of this tagged value takes precedence over the modeling name.

This is particularly useful when developing packages, since it is used to develop a sub-branch of a larger modeling project.

JavaExtern

N/A

Indicates a package for which code must not be generated from its classes.

JavaBeanResource

resource file

Indicates a resource to be stored at the same time as the package's classes.

generatedFile

N/A

Used internally to manage file names.

nocode

N/A

Prevents this package from being generated. No Java file is generated for this package.

 

 

Tagged values on an operation

 

Name ...

Parameters ...

Role ...

JavaStrict

N/A

Causes the representation of the Java keyword "strictfp" for the generated operation.

JavaName

the operation's Java name

During the generation phase, the parameter of this tagged value takes precedence over the modeling name.

JavaSynchronized

N/A

Representation of the Java keyword : "synchronized" meant for the multi-threading.

JavaNative

N/A

Representation of the "native" Java keyword for the methods written in languages other than Java.

JavaThrown

Exception

name of the exceptions that may be called

Lists the exceptions the operation can generate.

JavaNoInvariant

N/A

Means that the invariant method is not called for this operation.

JavaTemplate

Parameters

Template parameters

Specifies template parameters for a generic operation.

nocode

N/A

Prevents this operation from being generated.

 

 

Tagged values on an attribute

 

Name ...

Parameters ...

Role ...

JavaPublic

N/A

Generates the visibility of access methods as being public.

JavaWrapper

N/A

Uses the Wrapper class as base type (for example, Integer for int).

JavaName

the attribute's Java name

During the generation phase, the parameter of this tagged value takes precedence over the modeling name.

JavaLong

N/A

Carries out modifications in the case of an integer type attribute. 

JavaShort

N/A

Carries out modifications in the case of an integer type attribute.

JavaByte

N/A

carries out modifications in the case of an integer type attribute.

type

A collection interface

Indicates a class other than the default class for the generations related to the attribute.

Specifies the concrete collection to use in a Java5Types context.

The {type} tagged value can be used together with the {JavaImplementationType} tagged value to define a personalized collection.

JavaTypeExpr

text for specifying the attribute's Java type

Generation of the types that cannot be represented in Objecteering/UML (ex : int [ ] [ ]).

Note: Setting an attribute's multiplicity to * leads to errors!

JavaNoAccessor

N/A

Non-generation of the accessors.

JavaFilterAccessor

name of an accessor that must not be generated.

No generation of accessors given as parameters.

JavaGenerateAccessor

name of an accessor not generated by default and that should be generated

Generation only of accessors given as parameters.

JavaFinal

N/A

Representation of the Java keyword "final".

JavaVolatile

N/A

Representation of the Java keyword "volatile".

JavaTransient

N/A

Representation of the Java keyword "transient".

JavaNoInvariant

N/A

Means that no invariants will be generated for the attribute in question.

JavaFullName

N/A

Allows the generation of the complete name of the class, datatype or enumeration used.

JavaImplementationType

A collection type

Specifies the concrete collection to use in a Java5Types context.

The {type} tagged value can be used together with the {JavaImplementationType} tagged value to define a personalized collection.

JavaBind

Binded types on the attribute

Specifies the types binded by a generic attribute.

JavaArrayDimension

Integer

Specifies the number of dimensions of an array.

JavaEclipseNLS

A resource ID

Used in Eclipse to specify a text resource ID.

nocode

N/A

Prevents this attribute from being generated.

persistence

N/A

Specifies that the attribute is persistent.

 

The Attribute section of the table in "Overview of types and accessor generation" resumes the values authorized as parameters for a {type} tagged value on an attribute.

 

  

Simple attribute ...

Finite multiple attribute ...

infinite multiple attribute ...

vector

N/A

X

X (default)

array

N/A

X

X

hashtable

N/A

X

X

stack

N/A

X

X

hashSet

N/A

X

X

set

N/A

X

X

collection

N/A

X

X

linkedList

N/A

X

X

list

N/A

X

X

map

N/A

X

X

hashMap

N/A

X

X

 

 

These values correspond to the possibilities for the "JavaTypes" package.  In the case of a simple attribute, the class used is the class named <parameter value>SimpleAttribute.

 

For a finite multiple attribute, the class used is the class named <parameter value>FiniteAttribute.

 

Where an infinite multiple attribute is concerned, the class used is the class named <parameter value>MultipleAttribute.

 

A user wishing to enrich the "JavaTypes" package or to write his package must, therefore, respect these naming rules.

 

 

Tagged values on a navigable association

 

Name ...

Parameters ...

Role ...

type

A collection interface

Indicates a class other than the default class for the generations related to the association.

Specifies the exposed collection interface to use in a Java5Types context.

JavaNoAccessor

N/A

Non-generation of the accessors

JavaFilterAccessor

name of an accessor that must not be generated.

No generation of accessors given as parameters.

JavaGenerateAccessor

name of an accessor not generated by default and that should be generated

Generation only of accessors given as parameters.

JavaFinal

N/A

Representation of the Java "final" keyword.

JavaVolatile

N/A

Representation of the Java "volatile" keyword.

JavaName

the association's Java name

During the generation phase, the parameter of this tagged value takes precedence over the modeling name.

JavaPublic

N/A

Generates the visibility of access methods as being public.

JavaTransient

N/A

Representation of the Java "transient" keyword.

JavaTypeExpr

text for specifying the attribute's Java type

Generates the types that cannot be represented in Objecteering/UML (ex : int [] []).

Note: Setting an association's multiplicity to * leads to errors!

JavaFullName

N/A

Allows the generation of the complete name of the class, datatype or enumerate used.

JavaNoInvariant

N/A

Means that no invariants will be generated for the association in question.

JavaImplementationType

A collection type

Specifies the concrete collection to use in a Java5Types context.

JavaBind

Binded types on the association

Specifies the types binded by a generic association.

JavaArrayDimension

Integer

Specifies the number of dimensions of an array.

nocode

N/A

Prevents this association from being generated.

ordered

N/A

Specifies that the association is ordered.

qualifier

N/A

Used to define the association more finely.

 

The Association table in "Overview of types and accessor generation" resumes the values authorized as parameters for a {type} tagged value on an association.

 

   

Simple attribute ...

Finite multiple attribute ...

infinite multiple attribute ...

vector

N/A

X

X (default)

array

N/A

X

X

hashtable

N/A

X

X

stack

N/A

X

X

hashSet

N/A

X

X

set

N/A

X

X

collection

N/A

X

X

linkedList

N/A

X

X

list

N/A

X

X

map

N/A

X

X

hashMap

N/A

X

X

 

These values correspond to the possibilities for the "JavaTypes" package.  In the case of a simple association, the class used is the class named <parameter value>SimpleAssociation.

 

For a finite multiple association, the class used is the class named <parameter value>FiniteAssociation.

 

Where an infinite multiple association is concerned, the class used is the class named <parameter value>MultipleAssociation.

 

A user wishing to enrich the "JavaTypes" package or to write his package must, therefore, respect these naming rules.

 

 

Tagged values on a parameter

 

Name ...

Parameters ...

Role ...

JavaWrapper

N/A

Uses Wrapper as its base type (for example, Integer for int).

JavaByte

N/A

Carries out modifications for an integer type parameter.

JavaShort

N/A

Carries out modifications of an integer type parameter.

JavaLong

N/A

Carries out modifications for an integer type parameter.

JavaTypeExpr

text for specifying the parameter's Java type

Generation of the types that cannot be represented in Objecteering (ex : int [] []).

Note: Setting a parameter's multiplicity to * leads to errors!

JavaFullName

N/A

Allows the generation of the complete name of the class, datatype or enumerate used.

type

name of the class for generating the parameter declaration *

Indicates a class other than the default class to generate a parameter declaration.

JavaFinal

N/A

Generates the "final" keyword before a parameter.

JavaBind

Binded types on the association

Specifies the types binded by a generic parameter.

JavaVarArgs

N/A

Specifies that this parameter is a VarArg parameter, as defined by java 5.

JavaArrayDimension

Integer

Specifies the number of dimensions of an array.

 

The Parameter table in "Overview of types and accessor generation" resumes the values authorized as parameters for a {type} tagged value on a parameter.

 

   

Simple attribute ...

Finite multiple attribute ...

infinite multiple attribute ...

vector

N/A

X

X

array

N/A

X (default)

X (default)

hashtable

N/A

X

X

stack

N/A

X

X

hashSet

N/A

X

X

set

N/A

X

X

collection

N/A

X

X

linkedList

N/A

X

X

list

N/A

X

X

map

N/A

X

X

hashMap

N/A

X

X

 

These values correspond to the possibilities for the "JavaTypes" package.  In the case of an in parameter (or an out parameter), the class used is the class named <parameter value>IOParameter.

 

For a return parameter, the class used is the class named <parameter value>ReturnParameter.

 

A user wishing to enrich the "JavaTypes" package or to write his package must, therefore, respect these naming rules.

 


 

Tagged values on an association end

 

Name ...

Parameters ...

Role ...

JavaPublic

N/A

Generates the visibility of access methods as being public.

JavaName

the association's Java name

During the generation phase, the parameter of this tagged value takes precedence over the modeling name.

 

 

Tagged values on a data type

 

Name ...

Parameters ...

Role ...

JavaName

the data type's Java name

During the generation phase, the parameter of this tagged value takes precedence over the modeling name.

JavaExtends

name of the mother class

Inherits non-modeled classes.

JavaExtern

N/A

Indicates a class for which code must not be generated.

JavaImport

names of the imported classes and packages

Imports non-modeled packages and classes.

JavaNoImport

N/A

Specifies that no imports must be generated for this datatype.

JavaStatic

JavaStatic

N/A

persistence

N/A

Specifies that the data type is persistent.

 

 

Tagged values on a generalization

 

Name ...

Parameters ...

Role ...

JavaFullName

N/A

Allows the generation of the complete name of the class, datatype or enumerate used.

 

 

Tagged values on an implementation

 

Name ...

Parameters ...

Role ...

JavaFullName

N/A

Allows the generation of the complete name of the class, datatype or enumerate used.