1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.config.spring.parsers.assembly.configuration; |
8 | |
|
9 | |
import java.util.Map; |
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
public class TempWrapperPropertyConfiguration implements PropertyConfiguration |
15 | |
{ |
16 | |
|
17 | |
protected PropertyConfiguration delegate; |
18 | 0 | protected SimplePropertyConfiguration extra = new SimplePropertyConfiguration(); |
19 | |
private boolean greedyIgnore; |
20 | |
|
21 | |
public TempWrapperPropertyConfiguration(PropertyConfiguration delegate) |
22 | |
{ |
23 | 0 | this(delegate, true); |
24 | 0 | } |
25 | |
|
26 | |
public TempWrapperPropertyConfiguration(PropertyConfiguration delegate, boolean greedyIgnore) |
27 | 0 | { |
28 | 0 | this.delegate = delegate; |
29 | 0 | this.greedyIgnore = greedyIgnore; |
30 | 0 | } |
31 | |
|
32 | |
public void addReference(String propertyName) |
33 | |
{ |
34 | 0 | extra.addReference(propertyName); |
35 | 0 | } |
36 | |
|
37 | |
public void addMapping(String propertyName, Map mappings) |
38 | |
{ |
39 | 0 | extra.addMapping(propertyName, mappings); |
40 | 0 | } |
41 | |
|
42 | |
public void addMapping(String propertyName, String mappings) |
43 | |
{ |
44 | 0 | extra.addMapping(propertyName, mappings); |
45 | 0 | } |
46 | |
|
47 | |
public void addMapping(String propertyName, ValueMap mappings) |
48 | |
{ |
49 | 0 | extra.addMapping(propertyName, mappings); |
50 | 0 | } |
51 | |
|
52 | |
public void addAlias(String alias, String propertyName) |
53 | |
{ |
54 | 0 | extra.addAlias(alias, propertyName); |
55 | 0 | } |
56 | |
|
57 | |
public void addCollection(String propertyName) |
58 | |
{ |
59 | 0 | extra.addCollection(propertyName); |
60 | 0 | } |
61 | |
|
62 | |
public void addIgnored(String propertyName) |
63 | |
{ |
64 | 0 | extra.addIgnored(propertyName); |
65 | 0 | } |
66 | |
|
67 | |
public void removeIgnored(String propertyName) |
68 | |
{ |
69 | 0 | extra.removeIgnored(propertyName); |
70 | 0 | } |
71 | |
|
72 | |
public void setIgnoredDefault(boolean ignoreAll) |
73 | |
{ |
74 | 0 | extra.setIgnoredDefault(ignoreAll); |
75 | 0 | } |
76 | |
|
77 | |
public String getAttributeMapping(String alias) |
78 | |
{ |
79 | 0 | return extra.getAttributeMapping(alias, delegate.getAttributeMapping(alias)); |
80 | |
} |
81 | |
|
82 | |
public String getAttributeAlias(String mapping) |
83 | |
{ |
84 | 0 | return extra.getAttributeMapping(mapping, delegate.getAttributeAlias(mapping)); |
85 | |
} |
86 | |
|
87 | |
public boolean isCollection(String propertyName) |
88 | |
{ |
89 | 0 | return extra.isCollection(propertyName) || delegate.isCollection(propertyName); |
90 | |
} |
91 | |
|
92 | |
public boolean isIgnored(String propertyName) |
93 | |
{ |
94 | 0 | if (greedyIgnore) |
95 | |
{ |
96 | 0 | return extra.isIgnored(propertyName) || delegate.isIgnored(propertyName); |
97 | |
} |
98 | |
else |
99 | |
{ |
100 | 0 | return extra.isIgnored(propertyName) && delegate.isIgnored(propertyName); |
101 | |
} |
102 | |
} |
103 | |
|
104 | |
public boolean isReference(String attributeName) |
105 | |
{ |
106 | 0 | return extra.isReference(attributeName) || delegate.isReference(attributeName); |
107 | |
} |
108 | |
|
109 | |
public SingleProperty getSingleProperty(String propertyName) |
110 | |
{ |
111 | 0 | return new SinglePropertyWrapper(propertyName, this); |
112 | |
} |
113 | |
|
114 | |
public String translateName(String oldName) |
115 | |
{ |
116 | 0 | return extra.translateName(delegate.translateName(oldName)); |
117 | |
} |
118 | |
|
119 | |
public Object translateValue(String name, String value) |
120 | |
{ |
121 | 0 | Object intermediate = delegate.translateValue(name, value); |
122 | 0 | if (intermediate != null && intermediate.equals(value)) |
123 | |
{ |
124 | 0 | return extra.translateValue(name, value); |
125 | |
} |
126 | |
else |
127 | |
{ |
128 | 0 | return intermediate; |
129 | |
} |
130 | |
} |
131 | |
|
132 | |
} |