2 * Copyright (c) 2017 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
9 package org.opendaylight.mdsal.binding.javav2.model.api;
11 import com.google.common.annotations.Beta;
12 import org.opendaylight.yangtools.concepts.Identifier;
16 * Transforms virtual data to the concrete code in programming language.
20 public interface CodeGenerator {
23 * Generates code for <code>type</code>.
26 * Input type to be processed
27 * @return generated JAVA code
29 String generate(Type type);
32 * Checks if the concrete instance of <code>type</code> fit to concrete
33 * implementation of this interface.
35 * (e. g. method return true if in <code>EnumGenerator</code> (which
36 * implements this interface) has input parameter of type Enumeration (which
40 * Input type to be processed
41 * @return true if type is acceptable for processing, otherwise false
43 boolean isAcceptable(Type type);
46 * Returns name of <code>type</code> parameter.
49 * Input type to be processed
50 * @return generated unit
52 Identifier getUnitName(Type type);