Frage

I was wondering whether it's possible to distinguish "parameter not specified" from "parameter is empty". In both cases the Mojo parameter has the value null.

I want the default value to kick in, if the user does not give the parameter, and the empty string, if user gives the empty parameter element.

War es hilfreich?

Lösung

If you have a null in case of a string you can assume the user didn't defined it at all otherwise you can assume it had been defined. You can set appropriate default-values for Mojo parameters to distinguish between those cases. Or can you be more specific.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top