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.util.repo;
10 import com.google.common.annotations.Beta;
14 * Schema Source Transformation which transforms from one schema source
15 * representation to another.
18 * <b>Representation of Schema Source</b>
20 * Schema source may be represented by
21 * various Java Types, which depends on provider and/or consumer.
23 * E.g example of possible representations:
26 * <li>{@link java.io.InputStream}
27 * <li>{@link com.google.common.io.ByteSource}
30 * FIXME: <b>Beta:</b> Consider allowing transformations, which may
31 * fail to produce Output, this will require introduction of
34 * @param <I> Input schema source representation
35 * @param <O> Output schema source representation
37 * @deprecated Replaced with {@link org.opendaylight.yangtools.yang.model.repo.util.SchemaSourceTransformer}
41 public interface SchemaSourceTransformation<I, O> {
45 * Transforms supplied schema source in format <code>I</code> to schema
46 * source in format <code>O</code>.
49 * <li>Its execution does not cause any observable side effects.
50 * <li>If the contents of a,b are semantically same (e.g. contents of InputStream),
51 * output representations MUST BE also semantically equals.
54 * Implementations of transformation SHOULD NOT fail to
55 * transform valid non-null input to output representation.
58 * FIXME: <b>Beta:</b> Consider lowering condition for safe transformation
59 * and introduce checked exception for cases when transformation may fail.
61 * @param input Not null input which should be transformed
62 * @return Representation of input in <code>O</code> format.
63 * @throws NullPointerException if input is null.