1 package org.andromda.andromdapp;
2
3 import java.util.ArrayList;
4 import java.util.List;
5 import org.apache.commons.lang.StringUtils;
6
7
8
9
10
11
12 public class Mapping
13 {
14
15
16
17 private final List<String> froms = new ArrayList<String>();
18
19
20
21
22
23
24 public void addFrom(final String from)
25 {
26 this.froms.add(from);
27 }
28
29
30
31
32
33
34
35
36
37 public String getMatch(final String path)
38 {
39 String match = null;
40 for (final String from : this.froms)
41 {
42 if (path.contains(from))
43 {
44 match = StringUtils.replace(path, from, to);
45 }
46 }
47 return match;
48 }
49
50
51 private String to;
52
53
54
55
56 public String getTo()
57 {
58 return to;
59 }
60
61
62
63
64 public void setTo(final String to)
65 {
66 this.to = to;
67 }
68 }