private final CommandDescriptor<Instance<T>> descriptor;
public GroovyScriptShellCommand(Class<T> clazz) throws IntrospectionException {
//
CommandFactory factory = new CommandFactory(getClass().getClassLoader());
boolean hasExplicitReturn;
try {
clazz.getDeclaredField(ScriptLastStatementTransformer.FIELD_NAME);
hasExplicitReturn = true;
}
catch (NoSuchFieldException e) {
hasExplicitReturn = false;
}
//
this.clazz = clazz;
this.descriptor = HelpDescriptor.create(factory.create(clazz));
this.hasExplicitReturn = hasExplicitReturn;
}