1 package org.andromda.cartridges.ejb3.metafacades;
2
3 import java.util.Collection;
4 import org.andromda.metafacades.uml.AttributeFacade;
5
6
7
8
9
10
11 public class EJB3EnumerationFacadeLogicImpl
12 extends EJB3EnumerationFacadeLogic
13 {
14 private static final long serialVersionUID = 34L;
15
16
17
18
19 public EJB3EnumerationFacadeLogicImpl(final Object metaObject, final String context)
20 {
21 super (metaObject, context);
22 }
23
24
25
26
27 @Override
28 protected String handleGetMemberVariablesAsList(
29 final Collection variables,
30 final boolean includeTypes,
31 final boolean includeNames)
32 {
33 if (!includeNames && !includeTypes || (variables == null))
34 {
35 return "";
36 }
37
38 StringBuilder sb = new StringBuilder();
39 String separator = "";
40
41 for (Object obj : variables)
42 {
43 final AttributeFacade attr = (AttributeFacade)obj;
44 sb.append(separator);
45 separator = ", ";
46 if (includeTypes)
47 {
48 sb.append(attr.getGetterSetterTypeName());
49 sb.append(" ");
50 }
51 if (includeNames)
52 {
53 sb.append(attr.getName());
54 }
55 }
56 return sb.toString();
57 }
58 }