* @author Remy Maucherat
*/
public class OrderingMetaDataParser extends MetaDataElementParser {
public static OrderingMetaData parse(XMLStreamReader reader) throws XMLStreamException {
OrderingMetaData ordering = new OrderingMetaData();
// Handle elements
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case BEFORE:
ordering.setBefore(RelativeOrderingMetaDataParser.parse(reader));
break;
case AFTER:
ordering.setAfter(RelativeOrderingMetaDataParser.parse(reader));
break;
default: throw unexpectedElement(reader);
}
}