You are not logged in. Click here to log in.

Application Lifecycle Management

Search In Project

Search inClear

@Role #17055/HEAD / v10
Tags:  not added yet

@Role

Description

The @Role annotation gives an @In or @Out tagged field a certain meaning within the modeling domain. It allows someone to understand the meaning of a data field within the modeling context. A @Role annotation categorizes a field. Such categories might be Parameter, "Variable", "Output", "Input", "Simulated" and others. The Role annotation takes the category as a String parameter. There are predefined categories defined in @Role, however categories can be defined by the component developer.

If the @Role annotation is not provided, the default Role.VARIABLE it is assumed.

Synopsis

@Role(<String>)
arg - the role that this field is playing in context of the component.
predefined:
  • Role.PARAMETER
  • Role.VARIABLE
  • Role.SIMULATED
  • Role.OBSERVED
  • Role.STATE
  • Role.OUTPUT

Type

Documentation Annotation, Testing

Scope

Field

Example


!  @Description("CSMLite Plant Component")
...
!  @Execute
SUBROUTINE Plant

    USE, INTRINSIC :: ISO_C_BINDING
    IMPLICIT NONE

!  @Description("Daily maximum temperature in degrees Centigrade")
!  @Role(Role.VARIABLE)
!  @In
   REAL(C_FLOAT) :: TMAX
!  @Description("Day of Year")
!  @In
   INTEGER(C_INT) :: DOY
!  @Description("Dynamic Control Variable")
!  @In
   CHARACTER(kind = C_CHAR, len = 5) : DYN
...
!  @Description("Leaf Area Index")
!  @Role(Role.OUTPUT)
!  @Out
   REAL(C_FLOAT) :: LAI
...

Java example:


@Role(Role.PARAMETER)
@In public double latitude;
This example tags 'latitude' as Parameter.

@Role(Role.OUTPUT_FILE + Role.PARAMETER)
@In public File input;
Roles can be combined too. Now the 'input' field is a parameter and an output file.