f49bbbacabc79d197d5dcb5a6eb5d1cb964a93f5
[controller.git] / opendaylight / config / yang-jmx-generator-plugin / src / main / java / org / opendaylight / controller / config / yangjmxgenerator / plugin / ftl / StubModuleTemplate.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl;
9
10 import java.util.Collections;
11
12 import org.opendaylight.controller.config.api.DependencyResolver;
13 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
14 import org.opendaylight.controller.config.api.ModuleIdentifier;
15 import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
16 import org.opendaylight.controller.config.spi.Module;
17 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
18 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
19 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
20 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
21
22 import com.google.common.collect.Lists;
23
24 /**
25  *
26  */
27 public class StubModuleTemplate extends GeneralClassTemplate {
28
29     private final String extendedClass;
30
31     public StubModuleTemplate(Header header, String packageName,
32             String stubModuleName, String extendedClass) {
33         super(header, packageName, stubModuleName, Lists
34                 .newArrayList(extendedClass), Collections.<String> emptyList(),
35                 Collections.<Field> emptyList(), Collections
36                         .<MethodDefinition> emptyList(), false, true,
37                 Collections.<Constructor> emptyList());
38         this.extendedClass = extendedClass;
39     }
40
41     public String getExtendedClass() {
42         return extendedClass;
43     }
44
45     public String getInstanceType() {
46         return AutoCloseable.class.getCanonicalName();
47     }
48
49     public String getModuleNameType() {
50         return ModuleIdentifier.class.getCanonicalName();
51     }
52
53     public String getAbstractServiceInterfaceType() {
54         return AbstractServiceInterface.class.getCanonicalName();
55     }
56
57     public String getModuleType() {
58         return Module.class.getCanonicalName();
59     }
60
61     public String getDependencyResolverType() {
62         return DependencyResolver.class.getCanonicalName();
63     }
64
65     public String getDynamicMBeanWithInstanceType() {
66         return DynamicMBeanWithInstance.class.getCanonicalName();
67     }
68
69     @Override
70     public String getFtlTempleteLocation() {
71         return "module_stub_template.ftl";
72     }
73 }