2 * Copyright (c) 2013 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.mdsal.binding.model.api;
11 * Transforms virtual data to the concrete code in programming language.
13 public interface CodeGenerator {
15 * Generates code for <code>type</code>.
17 * @param type Input type to be processed
18 * @return generated JAVA code
20 String generate(Type type);
23 * Checks if the concrete instance of <code>type</code> fit to concrete implementation of this interface (e.g.
24 * method return true if in <code>EnumGenerator</code> (which implements this interface) has input parameter of type
25 * Enumeration (which is subtype of Type).
27 * @param type Input type to be processed
28 * @return true if type is acceptable for processing.
30 boolean isAcceptable(Type type);
33 * Returns name of <code>type</code> parameter.
35 * @param type Input type to be processed
36 * @return name of generated unit
38 String getUnitName(Type type);