Add hooking into NormalizedNodeParsers.
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / transform / ToNormalizedNodeParser.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;
9
10 import javax.annotation.Nullable;
11 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
12
13 /**
14  *
15  * Generic parser for normalized nodes. NormalizedNodes can be parsed
16  * e.g. from Dom APIs.
17  *
18  * @param <E>
19  *            type of element to be parsed into NormalizedNode
20  * @param <N>
21  *            type of NormalizedNode to be the result of parsing
22  * @param <S>
23  *            schema belonging to the type N of NormalizedNode
24  */
25 public interface ToNormalizedNodeParser<E, N extends NormalizedNode<?, ?>, S> {
26
27     /**
28      *
29      * Parse a list of E elements as a NormalizedNode of type N. If the parsing
30      * process expects only one E element as input e.g. container node, the
31      * input element will be wrapped in a list.
32      *
33      * @param xmlDom
34      * @param schema
35      * @return NormalizedNode as a result of parsing list of E elements with schema S
36      */
37     @Nullable
38     N parse(Iterable<E> xmlDom, S schema);
39 }