|
1 |
| package com.sourceforge.jpatterns.patterns.config; |
|
2 |
| |
|
3 |
| import com.sourceforge.jpatterns.core.configuration.exceptions.JPConfigException; |
|
4 |
| import com.sourceforge.jpatterns.patterns.PatternBase; |
|
5 |
| import com.sourceforge.jpatterns.schema.CastorSectionType; |
|
6 |
| import com.sourceforge.jpatterns.schema.Config; |
|
7 |
| import com.zmicer.utils.InputArgumentUtils; |
|
8 |
| import org.apache.log4j.Logger; |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| public class JPConfigImpl extends PatternBase implements IJPConfig |
|
18 |
| { |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| final public static Logger LOG = Logger.getLogger(JPConfigImpl.class); |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
1
| public String getValue(final String key, final String scope) throws JPConfigException
|
|
28 |
| { |
|
29 |
1
| return retrieveItem(key, scope).getValue();
|
|
30 |
| } |
|
31 |
| |
|
32 |
| |
|
33 |
| |
|
34 |
| |
|
35 |
2
| public boolean checkCastorConfig(CastorSectionType castorSectionType)
|
|
36 |
| { |
|
37 |
2
| InputArgumentUtils.checkObjects(castorSectionType);
|
|
38 |
2
| return (castorSectionType instanceof Config);
|
|
39 |
| } |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
1
| public boolean check()
|
|
45 |
| { |
|
46 |
1
| return super.check() && (m_castorSection instanceof Config);
|
|
47 |
| } |
|
48 |
| } |