2 * Copyright (c) 2014 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.model.util.repo;
10 import com.google.common.base.Optional;
13 * Provider of representation of YANG schema sources.
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.
22 * <b>Schema Source representation</b>
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.:
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.
38 * Conversion between representations should be done via implementations of
39 * {@link SchemaSourceTransformation}.
42 * Schema source representation type provided by this implementation
44 * @deprecated Replaced with {@link org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider}
48 public interface AdvancedSchemaSourceProvider<T> extends SchemaSourceProvider<T> {
51 * Returns representation source for supplied YANG source identifier.
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()}
58 * @param sourceIdentifier
60 * @return source representation if supplied YANG module is available
61 * {@link Optional#absent()} otherwise.
63 Optional<T> getSchemaSource(SourceIdentifier sourceIdentifier);