2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.data.impl.schema.transform.base.parser;
10 import java.util.Collections;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode;
16 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
17 import org.opendaylight.yangtools.yang.data.impl.schema.SchemaUtils;
18 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder;
19 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
20 import org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode;
21 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
24 * Abstract(base) parser for AugmentationNode, parses elements of type E.
26 * @param <E> type of elements to be parsed
28 public abstract class AugmentationNodeBaseParser<E> extends
29 BaseDispatcherParser<E, YangInstanceIdentifier.AugmentationIdentifier, AugmentationNode, AugmentationSchema> {
31 public AugmentationNodeBaseParser(final BuildingStrategy<YangInstanceIdentifier.AugmentationIdentifier, AugmentationNode> buildingStrategy) {
32 super(buildingStrategy);
35 public AugmentationNodeBaseParser() {}
38 protected final DataContainerNodeBuilder<YangInstanceIdentifier.AugmentationIdentifier, AugmentationNode> getBuilder(final AugmentationSchema schema) {
39 return Builders.augmentationBuilder(schema);
43 protected final Set<DataSchemaNode> getRealSchemasForAugment(final AugmentationSchema schema, final AugmentationSchema augmentSchema) {
44 return SchemaUtils.getRealSchemasForAugment(schema, augmentSchema);
49 protected final DataSchemaNode getSchemaForChild(final AugmentationSchema schema, final QName childQName) {
50 return SchemaUtils.findSchemaForChild(schema, childQName, strictParsing());
54 protected final Map<QName, ChoiceSchemaNode> mapChildElementsFromChoices(final AugmentationSchema schema) {
55 return SchemaUtils.mapChildElementsFromChoices(schema);
59 protected final Map<QName, AugmentationSchema> mapChildElementsFromAugments(final AugmentationSchema schema) {
60 return Collections.emptyMap();