1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.config.impl.digester.elements;
20
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24 import org.apache.myfaces.config.element.ContractMapping;
25
26
27
28
29
30 public class ContractMappingImpl extends ContractMapping
31 {
32 private List<String> urlPatternList;
33 private List<String> contractsList;
34
35 private transient List <String> unmodifiableUrlPatternList;
36 private transient List <String> unmodifiableContractsList;
37
38
39
40
41 public List<String> getUrlPatternList()
42 {
43 if (urlPatternList == null)
44 {
45 return Collections.emptyList();
46 }
47 if (unmodifiableUrlPatternList == null)
48 {
49 unmodifiableUrlPatternList =
50 Collections.unmodifiableList(urlPatternList);
51 }
52 return unmodifiableUrlPatternList;
53 }
54
55
56
57
58 public List<String> getContractList()
59 {
60 if (contractsList == null)
61 {
62 return Collections.emptyList();
63 }
64 if (unmodifiableContractsList == null)
65 {
66 unmodifiableContractsList =
67 Collections.unmodifiableList(contractsList);
68 }
69 return unmodifiableContractsList;
70 }
71
72 public void addContract(String contract)
73 {
74 if (contractsList == null)
75 {
76 contractsList = new ArrayList<String>();
77 }
78 contractsList.add(contract);
79 }
80
81 public void addUrlPattern(String urlPattern)
82 {
83 if (urlPatternList == null)
84 {
85 urlPatternList = new ArrayList<String>();
86 }
87 urlPatternList.add(urlPattern);
88 }
89
90 @Override
91 public String getUrlPattern()
92 {
93 return null;
94 }
95
96 @Override
97 public String getContracts()
98 {
99 return null;
100 }
101 }