Kedar,
Kedar Mhaswade wrote:
> V3 asadmin command developers:
>
> It's important to note that non-String fields in your command
> implementation
> classes are not to be annotated with annotation @Param.
>
> This is to support the variable expansion (token) support we have
> for various values in domain.xml, for which options should be replaced
> verbatim.
If I understand correctly, you are saying that if I use
asadmin some-command ... --enabled=${ENABLED}
that domain.xml will record ${ENABLED} as the value of that setting and
not the translation of ENABLED at that moment. I certainly see the
value of that.
Yet when the command implementation class is invoked, hasn't the
framework already substituted the current value for the placeholder as
part of the injection processing (unless I've asked for the raw
untranslated value explicitly)? If not, it should.
And, if the framework can substitute the token's current value as it
injects the values into the command class, why not have the framework
also do the type conversion and error handling itself, which ensures
that it is done and done in a coherent and uniform way? That would be
preferable to depending on each individual command implementation class
to do each param conversion itself and to detect and handle conversion
errors nicely.
Just my US$0.02 worth.
- Tim