Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top