else if (config.getIndex() >= 0)
interceptorChain.addInterceptor(getOrCreateCustomInterceptor(config), config.getIndex());
else if (config.getAfter() != null) {
List<CommandInterceptor> withClassName = interceptorChain.getInterceptorsWithClassName(config.getAfter());
if (withClassName.isEmpty()) {
throw new ConfigurationException("Cannot add after class: " + config.getAfter()
+ " as no such interceptor exists in the default chain");
}
interceptorChain.addInterceptorAfter(getOrCreateCustomInterceptor(config), withClassName.get(0).getClass());
} else if (config.getBefore() != null) {
List<CommandInterceptor> withClassName = interceptorChain.getInterceptorsWithClassName(config.getBefore());
if (withClassName.isEmpty()) {
throw new ConfigurationException("Cannot add before class: " + config.getAfter()
+ " as no such interceptor exists in the default chain");
}
interceptorChain.addInterceptorBefore(getOrCreateCustomInterceptor(config), withClassName.get(0).getClass());
}
}