1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.nuiton.eugene.models.object.xml;
24
25 import com.google.common.collect.ImmutableSet;
26 import org.nuiton.eugene.models.object.ObjectModelEnumeration;
27 import org.nuiton.eugene.models.object.ObjectModelModifier;
28
29 import java.util.ArrayList;
30 import java.util.Collection;
31 import java.util.Set;
32
33
34
35
36
37
38
39
40 public class ObjectModelEnumerationImpl extends ObjectModelClassifierImpl implements ObjectModelEnumeration {
41
42
43
44
45 private Collection<ObjectModelImplRef> literalRefs = new ArrayList<>();
46
47
48
49
50
51
52 public void addLiteral(ObjectModelImplRef ref) {
53 literalRefs.add(ref);
54 }
55
56 private static Set<ObjectModelModifier> authorizedModifiers;
57
58 @Override
59 protected Set<ObjectModelModifier> getAuthorizedModifiers() {
60 if (authorizedModifiers == null) {
61
62 authorizedModifiers = ImmutableSet.of();
63 }
64 return authorizedModifiers;
65 }
66
67 @Override
68 public Collection<String> getLiterals() {
69 Collection<String> results = new ArrayList<>();
70 for (ObjectModelImplRef ref : literalRefs) {
71 results.add(ref.getName());
72 }
73 return results;
74 }
75
76 }