1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.javagen.agile.core.xml.jaxb;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import javax.xml.bind.annotation.XmlElement;
22 import javax.xml.bind.annotation.XmlType;
23
24 import org.javagen.agile.core.model.Model;
25
26
27
28 @XmlType
29 public class ContextType {
30
31 private List<ContextEntryType> entries;
32
33 private List<ContextModelEntryType> entryRefs;
34
35 @XmlElement(name="entry")
36 public List<ContextEntryType> getEntries() {
37 return entries;
38 }
39
40 public void setEntries(List<ContextEntryType> entries) {
41 this.entries = entries;
42 }
43
44 public void addEntry(ContextEntryType entry) {
45 if (entries == null)
46 entries = new ArrayList<ContextEntryType>();
47 entries.add(entry);
48 }
49
50 public void addEntry(String key, Object value) {
51 addEntry( new ContextEntryType(key, value) );
52 }
53
54 @XmlElement(name="modelRef")
55 public List<ContextModelEntryType> getEntryRefs() {
56 return entryRefs;
57 }
58
59 public void setEntryRefs(List<ContextModelEntryType> entryRefs) {
60 this.entryRefs = entryRefs;
61 }
62
63 public void addEntryRef(ContextModelEntryType entryRef) {
64 if (entryRefs == null)
65 entryRefs = new ArrayList<ContextModelEntryType>();
66 entryRefs.add(entryRef);
67 }
68
69 public void addEntryRef(String name, Model model) {
70 addEntryRef(new ContextModelEntryType(name, model));
71 }
72
73 }