public static void registerCommandClass(Class clazz) { for (Method method : clazz.getDeclaredMethods()) { // Channel commands if (method.isAnnotationPresent(ChannelCommand.class)) { Annotation annotation = method.getAnnotation(ChannelCommand.class); ChannelCommand command = (ChannelCommand) annotation; commandMap.put(COMMAND_PREFIX + command.name(), method); } // Private message if (method.isAnnotationPresent(PrivateMessageCommand.class)) { Annotation annotation = method.getAnnotation(PrivateMessageCommand.class); PrivateMessageCommand command = (PrivateMessageCommand) annotation; privateMessageCommandMap.put(COMMAND_PREFIX + command.name(), method); } } }