2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.yangtools.sal.java.api.generator;
\r
10 import org.opendaylight.yangtools.sal.binding.model.api.CodeGenerator;
\r
11 import org.opendaylight.yangtools.sal.binding.model.api.GeneratedTransferObject;
\r
12 import org.opendaylight.yangtools.sal.binding.model.api.Type;
\r
14 public final class TOGenerator implements CodeGenerator {
\r
17 public String generate(Type type) {
\r
18 if (type instanceof GeneratedTransferObject) {
\r
19 final GeneratedTransferObject genTO = (GeneratedTransferObject) type;
\r
20 final ClassTemplate template = new ClassTemplate(genTO);
\r
21 return template.generate();
\r
27 public boolean isAcceptable(Type type) {
\r
28 return type instanceof GeneratedTransferObject;
\r
32 public String getUnitName(Type type) {
\r
33 return type.getName();
\r