Package org.jboss.metadata.web.spec

Examples of org.jboss.metadata.web.spec.RelativeOrderingMetaData


* @author Remy Maucherat
*/
public class RelativeOrderingMetaDataParser extends MetaDataElementParser {

    public static RelativeOrderingMetaData parse(XMLStreamReader reader) throws XMLStreamException {
        RelativeOrderingMetaData ordering = new RelativeOrderingMetaData();

        // Handle elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case NAME:
                    List<OrderingElementMetaData> order = ordering.getOrdering();
                    if (order == null) {
                        order = new ArrayList<OrderingElementMetaData>();
                        ordering.setOrdering(order);
                    }
                    NameMetaData name = new NameMetaData();
                    name.setName(reader.getElementText());
                    order.add(name);
                    break;
                case OTHERS:
                    List<OrderingElementMetaData> order2 = ordering.getOrdering();
                    if (order2 == null) {
                        order2 = new ArrayList<OrderingElementMetaData>();
                        ordering.setOrdering(order2);
                    }
                    OthersMetaData others = new OthersMetaData();
                    order2.add(others);
                    requireNoContent(reader);
                    break;
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.spec.RelativeOrderingMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.