14d47890cf8ab66510e8915e927003ba0df539c8
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / transform / base / parser / UnkeyedListNodeBaseParser.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser;
9
10 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
11 import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
12 import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode;
13 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
14 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
15 import org.opendaylight.yangtools.yang.model.api.ListSchemaNode;
16
17 /**
18  * Abstract(base) parser for UnkeyedListNodes, parses elements of type E.
19  *
20  * @param <E>
21  *            type of elements to be parsed
22  */
23 public abstract class UnkeyedListNodeBaseParser<E> extends
24         ListNodeBaseParser<E, UnkeyedListEntryNode, UnkeyedListNode, ListSchemaNode> {
25     @Override
26     protected CollectionNodeBuilder<UnkeyedListEntryNode, UnkeyedListNode> provideBuilder(ListSchemaNode schema) {
27         CollectionNodeBuilder<UnkeyedListEntryNode, UnkeyedListNode> listBuilder = Builders.unkeyedListBuilder();
28         return listBuilder.withNodeIdentifier(new NodeIdentifier(schema.getQName()));
29     }
30 }