* @author Remy Maucherat
*/
public class JBossAnnotationMetaDataParser extends MetaDataElementParser {
public static JBossAnnotationMetaData parse(XMLStreamReader reader) throws XMLStreamException {
JBossAnnotationMetaData annotation = new JBossAnnotationMetaData();
// Handle elements
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case CLASS_NAME:
annotation.setClassName(reader.getElementText());
break;
case SERVLET_SECURITY:
annotation.setServletSecurity(ServletSecurityMetaDataParser.parse(reader));
break;
case RUN_AS:
annotation.setRunAs(RunAsMetaDataParser.parse(reader));
break;
case MULTIPART_CONFIG:
annotation.setMultipartConfig(MultipartConfigMetaDataParser.parse(reader));
break;
default: throw unexpectedElement(reader);
}
}