* @author Remy Maucherat
*/
public class LifecycleCallbackMetaDataParser extends MetaDataElementParser {
public static LifecycleCallbackMetaData parse(XMLStreamReader reader) throws XMLStreamException {
LifecycleCallbackMetaData callback = new LifecycleCallbackMetaData();
// Handle elements
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case LIFECYCLE_CALLBACK_CLASS:
callback.setClassName(reader.getElementText());
break;
case LIFECYCLE_CALLBACK_METHOD:
callback.setMethodName(reader.getElementText());
break;
default: throw unexpectedElement(reader);
}
}
return callback;