Fix license header violations in yang-model-util
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / repo / AdvancedSchemaSourceProvider.java
1 /*
2  * Copyright (c) 2014 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.model.util.repo;
9
10 import com.google.common.base.Optional;
11
12 /**
13  * Provider of representation of YANG schema sources.
14  *
15  * <p>
16  * {@link AdvancedSchemaSourceProvider} is extension of
17  * {@link SchemaSourceProvider} which did not have object concept of source
18  * identifier, and introduces {@link SourceIdentifier} (which contains schema
19  * name and revision) as identifier of sources.
20  *
21  * <p>
22  * <b>Schema Source representation</b>
23  * <p>
24  * Representation of schema source. Representation of schema source could exists
25  * in various formats (Java types), depending on stage of processing, but
26  * representation MUST BE still result of processing of only single unit of schema
27  * source (file, input stream). E.g.:
28  * <ul>
29  * <li>{@link java.lang.String} - textual representation of source code
30  * <li>{@link java.io.InputStream} - input stream containing source code
31  * <li>{@link com.google.common.io.ByteSource} - source for input streams
32  * containing source code
33  * <li>Parsed AST - abstract syntax tree, which is result of a parser, but still
34  * it is not linked against other schemas.
35  * </ul>
36  *
37  * <p>
38  * Conversion between representations should be done via implementations of
39  * {@link SchemaSourceTransformation}.
40  *
41  * @param <T>
42  *            Schema source representation type provided by this implementation
43  *
44  * @deprecated Replaced with {@link org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider}
45  * and related APIs.
46  */
47 @Deprecated
48 public interface AdvancedSchemaSourceProvider<T> extends SchemaSourceProvider<T> {
49
50     /**
51      * Returns representation source for supplied YANG source identifier.
52      *
53      * Returned representation of schema source must be immutable, must not
54      * change during runtime if {@link SourceIdentifier} has specified both
55      * {@link SourceIdentifier#getName()} and
56      * {@link SourceIdentifier#getRevision()}
57      *
58      * @param sourceIdentifier
59      *            source identifier.
60      * @return source representation if supplied YANG module is available
61      *         {@link Optional#absent()} otherwise.
62      */
63     Optional<T> getSchemaSource(SourceIdentifier sourceIdentifier);
64 }