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/eplv10.html
8 package org.opendaylight.yangtools.yang.model.repo.api;
10 import org.opendaylight.yangtools.concepts.Identifiable;
11 import org.opendaylight.yangtools.concepts.Immutable;
14 * Common interface for schema source representations.
16 * A schema source is an atomic piece of the overall schema context. In YANG terms,
17 * a schema source is semantically equivalent to a single YANG text file, be it a
18 * module or a submodule.
20 * A schema source can exist in various forms, which we call representations. Again,
21 * in YANG terms, each representation is semantically equivalent, but from
22 * implementation perspective certain operations on a schema source may require it
23 * to be first transformed into a particular representation before they can be
24 * applied. Such transformations are affected via instances of
25 * {@link SchemaSourceTransformation}.
27 * Typical examples of a schema source representation include:
29 * <li>a {@link java.lang.String} - textual representation of source code
30 * <li>a {@link java.io.InputStream} - input stream containing source code
31 * <li>a {@link com.google.common.io.ByteSource} - source for input streams
32 * containing source code
33 * <li>Parsed abstract syntax tree (AST), which is the result of a syntactic parser
35 * Implementations of this interface expected to comply with the {@link Immutable}
38 public interface SchemaSourceRepresentation extends Identifiable<SourceIdentifier>, Immutable {
43 SourceIdentifier getIdentifier();
46 * Return the concrete representation type.
48 * @return The type of representation.
50 Class<? extends SchemaSourceRepresentation> getType();