Enumeration literal mapping for Java (Java code)
Enumeration literals are generated inside the enumeration declaration.
The generation of an enumeration literals is derived from the properties of the Enumeration Literal and the values set for the Tag Definitions applied by the «Java Enum Literal» stereotype.
Type Definition Properties:
The Name property is generated as the name of the enum literal in the code.
Tag Definitions:
The following Tag Definitions are applied to an Enumeration Literal by the «Java Enum Literal» stereotype:
If the tagged value of the Java Enum Literal Constructor Default tag definition has been set, ACS generates the tagged value as the default constructor values for the enum literal.
Example code:
enum Color implements IColors
{
Purple("Purple (#FF00FF)")
{
}
}
If the tagged value of the Java Enum Literal Overrides tag definition has been set, ACS generates the tagged value as the Java enum methods for which the enum literal overloads.
Example code:
enum Color implements IColors
{
Purple("Purple (#FF00FF)")
{
// Purple overrides the default function isInUSFlag
public boolean isInUSFlag()
{
return false;
}
}
}
Was this helpful?