}
private void parseInterceptor(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder) throws XMLStreamException {
ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
InterceptorConfigurationBuilder interceptorBuilder = builder.customInterceptors().addInterceptor();
for (int i = 0; i < reader.getAttributeCount(); i++) {
ParseUtils.requireNoNamespaceAttribute(reader, i);
String value = replaceProperties(reader.getAttributeValue(i));
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case AFTER:
interceptorBuilder.after(Util.<CommandInterceptor>loadClass(value, holder.getClassLoader()));
break;
case BEFORE:
interceptorBuilder.before(Util.<CommandInterceptor>loadClass(value, holder.getClassLoader()));
break;
case CLASS:
interceptorBuilder.interceptor(Util.<CommandInterceptor>getInstance(value, holder.getClassLoader()));
break;
case INDEX:
interceptorBuilder.index(Integer.parseInt(value));
break;
case POSITION:
interceptorBuilder.position(Position.valueOf(value.toUpperCase()));
break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
Element element = Element.forName(reader.getLocalName());
switch (element) {
case PROPERTIES: {
interceptorBuilder.withProperties(parseProperties(reader));
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}