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;
10 import com.google.common.base.Function;
11 import com.google.common.base.Preconditions;
12 import com.google.common.collect.Collections2;
13 import com.google.common.collect.Lists;
14 import com.google.common.collect.Maps;
15 import org.opendaylight.controller.config.api.RuntimeBeanRegistratorAwareModule;
16 import org.opendaylight.controller.config.api.annotations.AbstractServiceInterface;
17 import org.opendaylight.controller.config.api.runtime.RuntimeBean;
18 import org.opendaylight.controller.config.spi.Module;
19 import org.opendaylight.controller.config.yangjmxgenerator.AbstractEntry;
20 import org.opendaylight.controller.config.yangjmxgenerator.ModuleMXBeanEntry;
21 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry;
22 import org.opendaylight.controller.config.yangjmxgenerator.RuntimeBeanEntry.Rpc;
23 import org.opendaylight.controller.config.yangjmxgenerator.ServiceInterfaceEntry;
24 import org.opendaylight.controller.config.yangjmxgenerator.attribute.AbstractDependencyAttribute;
25 import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc;
26 import org.opendaylight.controller.config.yangjmxgenerator.attribute.Dependency;
27 import org.opendaylight.controller.config.yangjmxgenerator.attribute.JavaAttribute;
28 import org.opendaylight.controller.config.yangjmxgenerator.attribute.ListAttribute;
29 import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute;
30 import org.opendaylight.controller.config.yangjmxgenerator.attribute.TypedAttribute;
31 import org.opendaylight.controller.config.yangjmxgenerator.attribute.VoidAttribute;
32 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation;
33 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation.Parameter;
34 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Constructor;
35 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Field;
36 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Header;
37 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDeclaration;
38 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.MethodDefinition;
39 import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.ModuleField;
40 import org.opendaylight.controller.config.yangjmxgenerator.plugin.util.FullyQualifiedNameHelper;
41 import org.opendaylight.yangtools.binding.generator.util.BindingGeneratorUtil;
42 import org.opendaylight.yangtools.sal.binding.model.api.ParameterizedType;
43 import org.opendaylight.yangtools.sal.binding.model.api.Type;
45 import javax.management.openmbean.SimpleType;
46 import java.util.ArrayList;
47 import java.util.Arrays;
48 import java.util.Collection;
49 import java.util.Collections;
50 import java.util.HashMap;
51 import java.util.List;
53 import java.util.Map.Entry;
55 public class TemplateFactory {
57 public static Map<String, FtlTemplate> getFtlTemplates(
58 ModuleMXBeanEntry entry) {
59 Map<String, FtlTemplate> result = new HashMap<>();
61 result.putAll(TemplateFactory.tOsFromMbe(entry));
64 result.put(entry.getMXBeanInterfaceName() + ".java",
65 TemplateFactory.mXBeanInterfaceTemplateFromMbe(entry));
68 result.put(entry.getAbstractFactoryName() + ".java",
69 TemplateFactory.abstractFactoryTemplateFromMbe(entry));
72 result.put(entry.getAbstractModuleName() + ".java",
73 TemplateFactory.abstractModuleTemplateFromMbe(entry));
78 public static Map<String, FtlTemplate> getFtlStubTemplates(
79 ModuleMXBeanEntry entry) {
80 Map<String, FtlTemplate> result = new HashMap<>();
82 result.put(entry.getStubFactoryName() + ".java",
83 TemplateFactory.stubFactoryTemplateFromMbe(entry));
85 result.put(entry.getStubModuleName() + ".java",
86 TemplateFactory.stubModuleTemplateFromMbe(entry));
90 public static Map<String, FtlTemplate> getFtlTemplates(
91 ServiceInterfaceEntry entry) {
93 Map<String, FtlTemplate> result = new HashMap<>();
94 result.put(entry.getTypeName() + ".java",
95 TemplateFactory.serviceInterfaceFromSie(entry));
101 * Get map of file name as key, FtlFile instance representing runtime mx
102 * bean as value that should be persisted from this instance.
104 public static Map<String, FtlTemplate> getTOAndMXInterfaceFtlFiles(
105 RuntimeBeanEntry entry) {
106 Map<String, FtlTemplate> result = new HashMap<>();
107 { // create GeneralInterfaceFtlFile for runtime MXBean. Attributes will
108 // be transformed to getter methods
109 String mxBeanTypeName = entry.getJavaNameOfRuntimeMXBean();
110 List<String> extendedInterfaces = Arrays.asList(RuntimeBean.class
111 .getCanonicalName());
112 List<MethodDeclaration> methods = new ArrayList<>();
114 // convert attributes to getters
115 for (AttributeIfc attributeIfc : entry.getAttributes()) {
117 returnType = getReturnType(attributeIfc);
118 String getterName = "get"
119 + attributeIfc.getUpperCaseCammelCase();
120 MethodDeclaration getter = new MethodDeclaration(returnType,
121 getterName, Collections.<Field> emptyList());
126 for (Rpc rpc : entry.getRpcs()) {
127 // convert JavaAttribute parameters into fields
128 List<Field> fields = new ArrayList<>();
129 for (JavaAttribute ja : rpc.getParameters()) {
130 Field field = new Field(Collections.<String> emptyList(),
131 ja.getType().getFullyQualifiedName(),
132 ja.getLowerCaseCammelCase());
135 MethodDeclaration operation = new MethodDeclaration(
136 getReturnType(rpc.getReturnType()), rpc.getName(), fields);
137 methods.add(operation);
141 GeneralInterfaceTemplate runtimeMxBeanIfc = new GeneralInterfaceTemplate(
142 null, entry.getPackageName(), mxBeanTypeName,
143 extendedInterfaces, methods);
145 result.put(runtimeMxBeanIfc.getTypeDeclaration().getName()
146 + ".java", runtimeMxBeanIfc);
149 result.putAll(TemplateFactory.tOsFromRbe(entry));
154 // FIXME: put into Type.toString
155 static String serializeType(Type type) {
156 if (type instanceof ParameterizedType){
157 ParameterizedType parameterizedType = (ParameterizedType) type;
158 StringBuffer sb = new StringBuffer();
159 sb.append(parameterizedType.getRawType().getFullyQualifiedName());
161 boolean first = true;
162 for(Type parameter: parameterizedType.getActualTypeArguments()) {
168 sb.append(serializeType(parameter));
171 return sb.toString();
173 return type.getFullyQualifiedName();
178 private static String getReturnType(AttributeIfc attributeIfc) {
180 if (attributeIfc instanceof TypedAttribute) {
181 Type type = ((TypedAttribute) attributeIfc).getType();
182 returnType = serializeType(type);
183 } else if (attributeIfc == VoidAttribute.getInstance()) {
186 throw new UnsupportedOperationException(
187 "Attribute not supported: "
188 + attributeIfc.getClass());
193 public static GeneralInterfaceTemplate serviceInterfaceFromSie(
194 ServiceInterfaceEntry sie) {
196 List<String> extendedInterfaces = Lists
197 .newArrayList(AbstractServiceInterface.class.getCanonicalName());
198 if (sie.getBase().isPresent()) {
199 extendedInterfaces.add(sie.getBase().get().getFullyQualifiedName());
203 GeneralInterfaceTemplate sieTemplate = new GeneralInterfaceTemplate(
204 getHeaderFromEntry(sie), sie.getPackageName(),
205 sie.getTypeName(), extendedInterfaces,
206 Lists.<MethodDeclaration> newArrayList());
207 sieTemplate.setJavadoc(sie.getNullableDescription());
209 if (sie.getNullableDescription() != null)
210 sieTemplate.getAnnotations().add(
211 Annotation.createDescriptionAnnotation(sie
212 .getNullableDescription()));
213 sieTemplate.getAnnotations().add(Annotation.createSieAnnotation(sie.getQName(), sie.getExportedOsgiClassName
219 public static AbstractFactoryTemplate abstractFactoryTemplateFromMbe(
220 ModuleMXBeanEntry mbe) {
221 AbstractFactoryAttributesProcessor attrProcessor = new AbstractFactoryAttributesProcessor();
222 attrProcessor.processAttributes(mbe.getAttributes(),
223 mbe.getPackageName());
225 Collection<String> transformed = Collections2.transform(mbe
226 .getProvidedServices().keySet(),
227 new Function<String, String>() {
230 public String apply(String input) {
231 return input + ".class";
235 return new AbstractFactoryTemplate(getHeaderFromEntry(mbe),
236 mbe.getPackageName(), mbe.getAbstractFactoryName(),
237 mbe.getGloballyUniqueName(), mbe.getFullyQualifiedName(mbe
238 .getStubModuleName()), attrProcessor.getFields(),
239 Lists.newArrayList(transformed));
242 public static AbstractModuleTemplate abstractModuleTemplateFromMbe(
243 ModuleMXBeanEntry mbe) {
244 AbstractModuleAttributesProcessor attrProcessor = new AbstractModuleAttributesProcessor();
245 attrProcessor.processAttributes(mbe.getAttributes(),
246 mbe.getPackageName());
248 List<ModuleField> moduleFields = attrProcessor.getModuleFields();
249 List<String> implementedIfcs = Lists.newArrayList(
250 Module.class.getCanonicalName(),
251 mbe.getFullyQualifiedName(mbe.getMXBeanInterfaceName()));
253 for (String implementedService : mbe.getProvidedServices().keySet()) {
254 implementedIfcs.add(implementedService);
257 boolean generateRuntime = false;
258 String registratorFullyQualifiedName = null;
259 if (mbe.getRuntimeBeans() != null
260 && mbe.getRuntimeBeans().isEmpty() == false) {
261 generateRuntime = true;
262 RuntimeBeanEntry rootEntry = RuntimeRegistratorFtlTemplate
263 .findRoot(mbe.getRuntimeBeans());
264 registratorFullyQualifiedName = rootEntry
267 .concat(RuntimeRegistratorFtlTemplate.getJavaNameOfRuntimeRegistrator(rootEntry));
268 implementedIfcs.add(RuntimeBeanRegistratorAwareModule.class
269 .getCanonicalName());
272 AbstractModuleTemplate abstractModuleTemplate = new AbstractModuleTemplate(
273 getHeaderFromEntry(mbe), mbe.getPackageName(),
274 mbe.getAbstractModuleName(), implementedIfcs, moduleFields,
275 attrProcessor.getMethods(), generateRuntime,
276 registratorFullyQualifiedName);
278 if (mbe.getNullableDescription() != null)
279 abstractModuleTemplate.getAnnotations().add(
280 Annotation.createDescriptionAnnotation(mbe
281 .getNullableDescription()));
282 return abstractModuleTemplate;
285 public static StubFactoryTemplate stubFactoryTemplateFromMbe(
286 ModuleMXBeanEntry mbe) {
287 return new StubFactoryTemplate(getHeaderFromEntry(mbe),
288 mbe.getPackageName(), mbe.getStubFactoryName(),
289 mbe.getFullyQualifiedName(mbe.getAbstractFactoryName()),
290 mbe.getStubModuleName());
293 public static StubModuleTemplate stubModuleTemplateFromMbe(
294 ModuleMXBeanEntry mbe) {
295 return new StubModuleTemplate(getHeaderFromEntry(mbe),
296 mbe.getPackageName(), mbe.getStubModuleName(),
297 mbe.getFullyQualifiedName(mbe.getAbstractModuleName()));
300 public static GeneralInterfaceTemplate mXBeanInterfaceTemplateFromMbe(
301 ModuleMXBeanEntry mbe) {
302 MXBeanInterfaceAttributesProcessor attrProcessor = new MXBeanInterfaceAttributesProcessor();
303 attrProcessor.processAttributes(mbe.getAttributes());
304 GeneralInterfaceTemplate ifcTemplate = new GeneralInterfaceTemplate(
305 getHeaderFromEntry(mbe), mbe.getPackageName(),
306 mbe.getMXBeanInterfaceName(), Lists.<String> newArrayList(),
307 attrProcessor.getMethods());
308 ifcTemplate.setJavadoc(mbe.getNullableDescription());
312 public static Map<String, GeneralClassTemplate> tOsFromMbe(
313 ModuleMXBeanEntry mbe) {
314 Map<String, GeneralClassTemplate> retVal = Maps.newHashMap();
315 TOAttributesProcessor processor = new TOAttributesProcessor();
316 processor.processAttributes(mbe.getAttributes());
317 for (org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory.TOAttributesProcessor.TOInternal to : processor
319 List<Constructor> constructors = Lists.newArrayList();
320 constructors.add(new Constructor(to.getName(), "super();"));
322 Header header = getHeaderFromEntry(mbe);
325 new GeneralClassTemplate(header, mbe.getPackageName(), to
326 .getName(), Collections.<String> emptyList(),
327 Collections.<String> emptyList(), to.getFields(),
328 to.getMethods(), false, false, constructors));
333 public static Map<String, GeneralClassTemplate> tOsFromRbe(
334 RuntimeBeanEntry rbe) {
335 Map<String, GeneralClassTemplate> retVal = Maps.newHashMap();
336 TOAttributesProcessor processor = new TOAttributesProcessor();
337 Map<String, AttributeIfc> yangPropertiesToTypesMap = Maps.newHashMap(rbe.getYangPropertiesToTypesMap());
339 // Add TOs from output parameters
340 for (Rpc rpc : rbe.getRpcs()) {
341 AttributeIfc returnType = rpc.getReturnType();
343 if (returnType == VoidAttribute.getInstance())
345 if (returnType instanceof JavaAttribute)
347 if (returnType instanceof ListAttribute && returnType.getOpenType() instanceof SimpleType)
350 Preconditions.checkState(yangPropertiesToTypesMap.containsKey(returnType.getAttributeYangName()) == false,
351 "Duplicate TO %s for %s", returnType.getAttributeYangName(), rbe);
352 yangPropertiesToTypesMap.put(returnType.getAttributeYangName(), returnType);
355 processor.processAttributes(yangPropertiesToTypesMap);
356 for (org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.TemplateFactory.TOAttributesProcessor.TOInternal to : processor
358 List<Constructor> constructors = Lists.newArrayList();
359 constructors.add(new Constructor(to.getName(), "super();"));
364 new GeneralClassTemplate(null, rbe.getPackageName(), to
365 .getName(), Collections.<String> emptyList(),
366 Collections.<String> emptyList(), to.getFields(),
367 to.getMethods(), false, false, constructors));
372 private static Header getHeaderFromEntry(AbstractEntry mbe) {
373 return new Header(mbe.getYangModuleName(), mbe.getYangModuleLocalname());
376 // TODO refactor attribute processors
378 private static class TOAttributesProcessor {
380 private final List<TOInternal> tos = Lists.newArrayList();
382 void processAttributes(Map<String, AttributeIfc> attributes) {
383 for (Entry<String, AttributeIfc> attrEntry : attributes.entrySet()) {
384 AttributeIfc attributeIfc = attrEntry.getValue();
385 if (attributeIfc instanceof TOAttribute) {
386 createTOInternal((TOAttribute) attributeIfc);
388 if (attributeIfc instanceof ListAttribute) {
389 AttributeIfc innerAttr = ((ListAttribute) attributeIfc)
390 .getInnerAttribute();
391 if (innerAttr instanceof TOAttribute) {
392 createTOInternal((TOAttribute) innerAttr);
398 private void createTOInternal(TOAttribute toAttribute) {
400 Map<String, AttributeIfc> attrs = toAttribute.getCapitalizedPropertiesToTypesMap();
401 // recursive processing of TO's attributes
402 processAttributes(attrs);
404 tos.add(new TOInternal(toAttribute.getType(), attrs));
407 List<TOInternal> getTOs() {
411 private static class TOInternal {
412 private final String fullyQualifiedName, name;
413 private List<Field> fields;
414 private List<MethodDefinition> methods;
416 public TOInternal(Type type, Map<String, AttributeIfc> attrs) {
417 this(type.getFullyQualifiedName(), type.getName(), attrs, type.getPackageName());
420 public TOInternal(String fullyQualifiedName, String name,
421 Map<String, AttributeIfc> attrs, String packageName) {
422 this.fullyQualifiedName = fullyQualifiedName;
424 processAttrs(attrs, packageName);
427 private void processAttrs(Map<String, AttributeIfc> attrs, String packageName) {
428 fields = Lists.newArrayList();
429 methods = Lists.newArrayList();
431 for (Entry<String, AttributeIfc> attrEntry : attrs.entrySet()) {
432 String innerName = attrEntry.getKey();
433 String varName = BindingGeneratorUtil
434 .parseToValidParamName(attrEntry.getKey());
436 String fullyQualifiedName;
437 if (attrEntry.getValue() instanceof TypedAttribute) {
438 Type type = ((TypedAttribute) attrEntry.getValue()).getType();
439 fullyQualifiedName = serializeType(type);
441 fullyQualifiedName = FullyQualifiedNameHelper
442 .getFullyQualifiedName(packageName, attrEntry.getValue().getUpperCaseCammelCase());
444 fields.add(new Field(fullyQualifiedName, varName));
446 String getterName = "get" + innerName;
447 MethodDefinition getter = new MethodDefinition(
448 fullyQualifiedName, getterName,
449 Collections.<Field> emptyList(), "return "
452 String setterName = "set" + innerName;
453 MethodDefinition setter = new MethodDefinition("void",
454 setterName, Lists.newArrayList(new Field(
455 fullyQualifiedName, varName)), "this."
456 + varName + " = " + varName + ";");
464 return fullyQualifiedName;
471 List<Field> getFields() {
475 List<MethodDefinition> getMethods() {
481 private static class MXBeanInterfaceAttributesProcessor {
482 private final List<MethodDeclaration> methods = Lists.newArrayList();
484 void processAttributes(Map<String, AttributeIfc> attributes) {
485 for (Entry<String, AttributeIfc> attrEntry : attributes.entrySet()) {
487 AttributeIfc attributeIfc = attrEntry.getValue();
489 if (attributeIfc instanceof TypedAttribute) {
490 TypedAttribute typedAttribute = (TypedAttribute) attributeIfc;
491 returnType = serializeType(typedAttribute.getType());
493 throw new UnsupportedOperationException(
494 "Attribute not supported: "
495 + attributeIfc.getClass());
498 String getterName = "get"
499 + attributeIfc.getUpperCaseCammelCase();
500 MethodDeclaration getter = new MethodDeclaration(returnType,
501 getterName, Collections.<Field> emptyList());
503 String varName = BindingGeneratorUtil
504 .parseToValidParamName(attrEntry.getKey());
505 String setterName = "set"
506 + attributeIfc.getUpperCaseCammelCase();
507 MethodDeclaration setter = new MethodDeclaration("void",
508 setterName, Lists.newArrayList(new Field(returnType,
513 if (attributeIfc.getNullableDescription() != null) {
514 setter.setJavadoc(attrEntry.getValue()
515 .getNullableDescription());
520 List<MethodDeclaration> getMethods() {
525 private static class AbstractFactoryAttributesProcessor {
527 private final List<Field> fields = Lists.newArrayList();
528 private static final String STRING_FULLY_QUALIFIED_NAME = "java.util.List";
530 void processAttributes(Map<String, AttributeIfc> attributes,
531 String packageName) {
532 for (Entry<String, AttributeIfc> attrEntry : attributes.entrySet()) {
534 AttributeIfc attributeIfc = attrEntry.getValue();
536 if (attributeIfc instanceof TypedAttribute) {
537 TypedAttribute typedAttribute = (TypedAttribute) attributeIfc;
538 type = serializeType(typedAttribute.getType());
539 } else if (attributeIfc instanceof TOAttribute) {
540 String fullyQualifiedName = FullyQualifiedNameHelper
541 .getFullyQualifiedName(packageName, attributeIfc.getUpperCaseCammelCase());
543 type = fullyQualifiedName;
544 } else if (attributeIfc instanceof ListAttribute) { //FIXME: listAttribute might extend TypedAttribute
545 String fullyQualifiedName = null;
546 AttributeIfc innerAttr = ((ListAttribute) attributeIfc)
547 .getInnerAttribute();
548 if (innerAttr instanceof JavaAttribute) {
549 fullyQualifiedName = ((JavaAttribute) innerAttr)
550 .getType().getFullyQualifiedName();
551 } else if (innerAttr instanceof TOAttribute) {
552 fullyQualifiedName = FullyQualifiedNameHelper
553 .getFullyQualifiedName(packageName, innerAttr.getUpperCaseCammelCase());
556 type = STRING_FULLY_QUALIFIED_NAME.concat("<")
557 .concat(fullyQualifiedName).concat(">");
560 throw new UnsupportedOperationException(
561 "Attribute not supported: "
562 + attributeIfc.getClass());
565 fields.add(new Field(type, attributeIfc
566 .getUpperCaseCammelCase()));
570 List<Field> getFields() {
575 private static class AbstractModuleAttributesProcessor {
577 private static final String STRING_FULLY_QUALIFIED_NAME = "java.util.List";
579 private final List<ModuleField> moduleFields = Lists.newArrayList();
580 private final List<MethodDefinition> methods = Lists.newArrayList();
582 void processAttributes(Map<String, AttributeIfc> attributes,
583 String packageName) {
584 for (Entry<String, AttributeIfc> attrEntry : attributes.entrySet()) {
586 AttributeIfc attributeIfc = attrEntry.getValue();
588 if (attributeIfc instanceof TypedAttribute) {
589 TypedAttribute typedAttribute = (TypedAttribute) attributeIfc;
590 type = serializeType(typedAttribute.getType());
591 } else if (attributeIfc instanceof TOAttribute) {
592 String fullyQualifiedName = FullyQualifiedNameHelper
593 .getFullyQualifiedName(packageName, attributeIfc.getUpperCaseCammelCase());
595 type = fullyQualifiedName;
596 } else if (attributeIfc instanceof ListAttribute) {
597 String fullyQualifiedName = null;
598 AttributeIfc innerAttr = ((ListAttribute) attributeIfc)
599 .getInnerAttribute();
600 if (innerAttr instanceof JavaAttribute) {
601 fullyQualifiedName = ((JavaAttribute) innerAttr)
602 .getType().getFullyQualifiedName();
603 } else if (innerAttr instanceof TOAttribute) {
604 fullyQualifiedName = FullyQualifiedNameHelper
605 .getFullyQualifiedName(packageName, innerAttr.getUpperCaseCammelCase());
608 type = STRING_FULLY_QUALIFIED_NAME.concat("<")
609 .concat(fullyQualifiedName).concat(">");
611 throw new UnsupportedOperationException(
612 "Attribute not supported: "
613 + attributeIfc.getClass());
616 boolean isDependency = false;
617 Dependency dependency = null;
618 Annotation overrideAnnotation = new Annotation("Override",
619 Collections.<Parameter> emptyList());
620 List<Annotation> annotations = Lists
621 .newArrayList(overrideAnnotation);
623 if (attributeIfc instanceof AbstractDependencyAttribute) {
625 dependency = ((AbstractDependencyAttribute) attributeIfc)
627 annotations.add(Annotation
628 .createRequireIfcAnnotation(dependency.getSie()));
631 String varName = BindingGeneratorUtil
632 .parseToValidParamName(attrEntry.getKey());
633 moduleFields.add(new ModuleField(type, varName, attributeIfc
634 .getUpperCaseCammelCase(), attributeIfc
635 .getNullableDefault(), isDependency, dependency));
637 String getterName = "get"
638 + attributeIfc.getUpperCaseCammelCase();
639 MethodDefinition getter = new MethodDefinition(type,
640 getterName, Collections.<Field> emptyList(),
641 Lists.newArrayList(overrideAnnotation), "return "
644 String setterName = "set"
645 + attributeIfc.getUpperCaseCammelCase();
647 if (attributeIfc.getNullableDescription() != null) {
648 annotations.add(Annotation
649 .createDescriptionAnnotation(attributeIfc.getNullableDescription()));
652 MethodDefinition setter = new MethodDefinition("void",
654 Lists.newArrayList(new Field(type, varName)),
655 annotations, "this." + varName + " = " + varName + ";");
656 setter.setJavadoc(attributeIfc.getNullableDescription());
663 List<ModuleField> getModuleFields() {
667 List<MethodDefinition> getMethods() {