* @throws java.lang.Exception
*/
@SuppressWarnings(value = "unchecked")
private void addAnnotatedCommand(Class cls) throws Exception {
AbstractCommand cmd = null;
CommandAnnotation ca = (CommandAnnotation) cls.getAnnotation(CommandAnnotation.class);
if (AbstractCommand.class.isAssignableFrom(cls)) {
cmdMap.put(ca.value(), cls);
if (AnnotatedCommand.class.isAssignableFrom(cls)) {
AnnotatedCommand.initOptionDescriptorMap(cls, out, err);
}
} else {
throw new IllegalStateException("Can not assign " + cls.getName() + " from Command.class");