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.spi;
10 import com.google.common.util.concurrent.CheckedFuture;
12 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
15 * An schema source representation transformation service. An instance can create
16 * some output schema source representation based on some input source representation.
18 * @param <I> Input {@link SchemaSourceRepresentation}
19 * @param <O> Output {@link SchemaSourceRepresentation}
21 public interface SchemaSourceTransformer<I extends SchemaSourceRepresentation, O extends SchemaSourceRepresentation> {
23 * Return the {@link SchemaSourceRepresentation} which this transformer
24 * accepts on its input.
26 * @return The input source representation type.
28 Class<I> getInputRepresentation();
31 * Return the {@link SchemeSourceRepresentation} which this transformer
32 * produces on its output.
34 * @return The output source representation type.
36 Class<O> getOutputRepresentation();
39 * Transform a schema source representation from its input form to
40 * the transformers output form.
42 * @param source Schema source in its source representation
43 * @return A future which produces the output schema source representation.
45 CheckedFuture<O, SchemaSourceTransformationException> transformSchemaSource(I source);
48 * Return the relative cost of performing the transformation. When in doubt,
51 * @return Relative cost.