I don't get it. I hope you are taking into account the
"default-value (defaultValue)" of an @Param. If nothing is specified
on command line, the injected object should have default
value if there exists one.
Byron Nevins wrote:
> There are 2 new Param annotation possibilities for AdminCommand's
>
> @Param(acceptableValues="foo,bar.xyz")
> String aString;
>
> aString will either be null, empty, foo, bar, or xyz
>
> If anything else is given then the command will fail at injection time
> -- before execute() is called
>
> /Call for comments -- should null and/or empty be errors?/
> ______________________
>
> @Param
> Boolean myBool;
>
> If the parameter is not given at all (i.e. no --myBool) then myBool ==
> whatever you set it to in the declaration
With injection, why do you set it in the declaration?
It should be something like:
@Param
Boolean myBool(defaultValue=false); in which case the
value of myBool should be false when not specified on command line.
>
> If the parameter is given -- this is how it works:
>
> null or empty string --> true
> case-insensitive match of "true" --> true
> case-insensitive match of "false" --> false
> anything else --> fatal error. AdminCommand.execute() will NOT be called
>
> If you have developed an AdminCommand that uses boolean options, I urge
> you to change to the new capability above.
>
>
> --
> Byron Nevins Work 408-276-4089, Home 650-359-1290, Cell 650-784-4123 - Sun Microsystems, Inc.
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net For
> additional commands, e-mail: admin-help_at_glassfish.dev.java.net