for (Class<?> cmdClass : cmdList) {
APICommand at = cmdClass.getAnnotation(APICommand.class);
if (at == null) {
throw new CloudRuntimeException(String.format("%s is claimed as a API command, but it doesn't have @APICommand annotation", cmdClass.getName()));
}
if (at.responseView() == null) {
throw new CloudRuntimeException(String.format(
"%s @APICommand annotation should specify responseView attribute to distinguish multiple command classes for a single api name", cmdClass.getName()));
} else if (at.responseView() == view) {
return cmdClass;
}