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.controller.config.yangjmxgenerator.plugin.ftl.model;
10 import java.util.Collections;
11 import java.util.List;
13 public class MethodDefinition implements Method {
14 private final List<String> modifiers;
15 private final String returnType;
16 private final String name;
17 private final List<Field> parameters;
18 private final List<String> throwsExceptions;
19 private final String body;
20 private String javadoc = null;
21 private final List<Annotation> annotations;
23 // TODO remove, Constructor is in separate class
24 public static MethodDefinition createConstructor(String name,
25 List<Field> parameters, String body) {
26 return new MethodDefinition("", name, parameters, body);
30 public MethodDefinition(String returnType, String name,
31 List<Field> parameters, String body) {
32 this(Collections.<String> emptyList(), returnType, name, parameters,
33 Collections.<String> emptyList(), Collections
34 .<Annotation> emptyList(), body);
37 public MethodDefinition(String returnType, String name,
38 List<Field> parameters, List<Annotation> annotations, String body) {
39 this(Collections.<String> emptyList(), returnType, name, parameters,
40 Collections.<String> emptyList(), annotations, body);
43 public MethodDefinition(List<String> modifiers, String returnType,
44 String name, List<Field> parameters, List<String> throwsExceptions,
45 List<Annotation> annotations, String body) {
46 this.modifiers = modifiers;
47 this.returnType = returnType;
49 this.parameters = parameters;
50 this.throwsExceptions = throwsExceptions;
52 this.annotations = annotations;
56 public List<Annotation> getAnnotations() {
61 public String getJavadoc() {
65 public void setJavadoc(String javadoc) {
66 this.javadoc = javadoc;
70 public String getReturnType() {
75 public String getName() {
80 public List<Field> getParameters() {
84 public List<String> getThrowsExceptions() {
85 return throwsExceptions;
88 public String getBody() {
93 public List<String> getModifiers() {