int count = matchOp.getArgCount();
Object[] params = new Object[count];
for (int i = 0; i < count; i++)
{
String argType = matchOp.getArgType(i);
PropertyEditor editor = PropertyEditors.getEditor(argType);
editor.setAsText((String) opArgs.get(i));
params[i] = editor.getValue();
}
log.debug("Using params: " + Strings.join(params, ","));
// invoke the operation
Object result = server.invoke(name, opName, params, matchOp.getSignature());
log.debug("Raw result: " + result);
if (!context.isQuiet())
{
// Translate the result to text
String resultText = null;
if (result != null)
{
try
{
PropertyEditor editor = PropertyEditors.getEditor(result.getClass());
editor.setValue(result);
resultText = editor.getAsText();
log.debug("Converted result: " + resultText);
}
catch (RuntimeException e)
{
// No property editor found or some conversion problem