01_user_documentation:03_interacting_with_groimp:08_parameter:05_parameter_manager:05_declare
Table of Contents
Declare parameters
In order to be a parameter, an attribute need to have one of the two annotations de.grogra.xl.parameter.IsParameter, or de.grogra.xl.parameter.AllAsParameter. These two annotations can have two arguments: a class, a name. Neither is required. The arguments are:
- A name: the name has to match the name of a declared parameter manager. That parameter manager will be used for this parameter.
- A class: The class has to extend ParameterManager. It will use the “default” manager of that class.
Single parameter declaration
The annotation IsParameter mark the attribute as parameter.
@AddParameterManager(name="env_param", type=de.grogra.rgg.parameter.TextFilePM.class) @AddParameterManager(name="other_param", type=de.grogra.rgg.parameter.TextFilePM.class) // set the parameter manager env_param to be the default in this file @DefaultParameterManager("env_param") // added to the default manager , i.e. env_param @IsParameter float myenv_param; // added to specified manager, other_param @IsParameter("other_param") String myString; // added to a new parameter manager of type TextFilePM.class @IsParameter(type=de.grogra.rgg.parameter.TextFilePM.class) int myint = 5;
Multiple parameters declaration
The annotation AllAsParameter mark all attributes of the current RGG scope as parameters.
@AddParameterManager(name="env_param", type=de.grogra.rgg.parameter.TextFilePM.class) @AddParameterManager(name="other_param", type=de.grogra.rgg.parameter.TextFilePM.class) // set the parameter manager env_param to be the default in this file @DefaultParameterManager("env_param") @AllAsParameter // all the following parameters will be added to the default "env_param" float myenv_param; String myString; int myint = 5; // Single declaration override the all declaration @IsParameter("other_param") double notanenv;
01_user_documentation/03_interacting_with_groimp/08_parameter/05_parameter_manager/05_declare.txt · Last modified: 2025/10/14 10:49 by gaetan
