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 | |
|
15 | |
public class ReusablePropertyConfiguration implements PropertyConfiguration |
16 | |
{ |
17 | |
private PropertyConfiguration reference; |
18 | |
private PropertyConfiguration delegate; |
19 | |
|
20 | |
public ReusablePropertyConfiguration() |
21 | |
{ |
22 | 0 | this(new SimplePropertyConfiguration()); |
23 | 0 | } |
24 | |
|
25 | |
public ReusablePropertyConfiguration(PropertyConfiguration delegate) |
26 | 0 | { |
27 | 0 | this.delegate = delegate; |
28 | 0 | } |
29 | |
|
30 | |
public void reset() |
31 | |
{ |
32 | 0 | if (null == reference) |
33 | |
{ |
34 | 0 | reference = delegate; |
35 | |
} |
36 | 0 | delegate = new TempWrapperPropertyConfiguration(reference); |
37 | 0 | } |
38 | |
|
39 | |
public void addReference(String propertyName) |
40 | |
{ |
41 | 0 | delegate.addReference(propertyName); |
42 | 0 | } |
43 | |
|
44 | |
public void addMapping(String propertyName, Map mappings) |
45 | |
{ |
46 | 0 | delegate.addMapping(propertyName, mappings); |
47 | 0 | } |
48 | |
|
49 | |
public void addMapping(String propertyName, String mappings) |
50 | |
{ |
51 | 0 | delegate.addMapping(propertyName, mappings); |
52 | 0 | } |
53 | |
|
54 | |
public void addMapping(String propertyName, ValueMap mappings) |
55 | |
{ |
56 | 0 | delegate.addMapping(propertyName, mappings); |
57 | 0 | } |
58 | |
|
59 | |
public void addAlias(String alias, String propertyName) |
60 | |
{ |
61 | 0 | delegate.addAlias(alias, propertyName); |
62 | 0 | } |
63 | |
|
64 | |
public void addCollection(String propertyName) |
65 | |
{ |
66 | 0 | delegate.addCollection(propertyName); |
67 | 0 | } |
68 | |
|
69 | |
public void addIgnored(String propertyName) |
70 | |
{ |
71 | 0 | delegate.addIgnored(propertyName); |
72 | 0 | } |
73 | |
|
74 | |
public void removeIgnored(String propertyName) |
75 | |
{ |
76 | 0 | delegate.removeIgnored(propertyName); |
77 | 0 | } |
78 | |
|
79 | |
public void setIgnoredDefault(boolean ignoreAll) |
80 | |
{ |
81 | 0 | delegate.setIgnoredDefault(ignoreAll); |
82 | 0 | } |
83 | |
|
84 | |
public String getAttributeMapping(String alias) |
85 | |
{ |
86 | 0 | return delegate.getAttributeMapping(alias); |
87 | |
} |
88 | |
|
89 | |
public String getAttributeAlias(String mapping) |
90 | |
{ |
91 | 0 | return delegate.getAttributeAlias(mapping); |
92 | |
} |
93 | |
|
94 | |
public boolean isCollection(String propertyName) |
95 | |
{ |
96 | 0 | return delegate.isCollection(propertyName); |
97 | |
} |
98 | |
|
99 | |
public boolean isIgnored(String propertyName) |
100 | |
{ |
101 | 0 | return delegate.isIgnored(propertyName); |
102 | |
} |
103 | |
|
104 | |
public boolean isReference(String attributeName) |
105 | |
{ |
106 | 0 | return 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 delegate.translateName(oldName); |
117 | |
} |
118 | |
|
119 | |
public Object translateValue(String name, String value) |
120 | |
{ |
121 | 0 | return delegate.translateValue(name, value); |
122 | |
} |
123 | |
|
124 | |
} |