Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [osgi-users] Specifying required parameter in Gogo command

I think this could be done by overloading the method.

@Descriptor("...")
String foo(){
return foo(null);
}

@Descriptor("...")
String foo(@Parameter(names="-ps")String text){

}



On 2/17/21 7:11 PM, Alain Picard wrote:
am trying to specify some required parameters in Gogo but I can't find a way to set absentValue to null (can't just not provide it as it is required).

This won't compile:
@Parameter(names="-ps") @Descriptor(PS_DESCR) String psName,

Example:
@Parameter(names="-ps", absentValue= "") @Descriptor(PS_DESCR) String psName,

results in:
-ps   ProjectSpace name [optional]

Where I want it not to show up as optional.

The code checks for null, otherwise it will add the "[optional]" tag.

Thanks
Alain


_______________________________________________
osgi-users mailing list
osgi-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/osgi-users

Back to the top