1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.googlecode.t7mp.steps;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import com.googlecode.t7mp.DefaultPluginLog;
22 import com.googlecode.t7mp.PluginLog;
23 import com.googlecode.t7mp.T7Configuration;
24 import com.googlecode.t7mp.configuration.PluginArtifactResolver;
25
26
27
28
29
30
31
32
33 public class DefaultContext implements Context {
34
35 protected Map<String, Object> context = new HashMap<String, Object>();
36
37 protected PluginArtifactResolver artifactResolver;
38 protected T7Configuration configuration;
39 protected PluginLog pluginLog;
40
41 public DefaultContext(PluginArtifactResolver artifactResolver, T7Configuration configuration) {
42 this(artifactResolver, configuration, new DefaultPluginLog());
43 }
44
45 public DefaultContext(PluginArtifactResolver artifactResolver, T7Configuration configuration, PluginLog pluginLog) {
46 this.artifactResolver = artifactResolver;
47 this.configuration = configuration;
48 this.pluginLog = pluginLog;
49 }
50
51 @Override
52 public PluginLog getLog() {
53 return this.pluginLog;
54 }
55
56 @Override
57 public PluginArtifactResolver getArtifactResolver() {
58 return artifactResolver;
59 }
60
61 @Override
62 public T7Configuration getConfiguration() {
63 return configuration;
64 }
65
66 @Override
67 public void put(String key, Object value) {
68 this.context.put(key, value);
69 }
70
71 @Override
72 public Object get(String key) {
73 return this.context.get(key);
74 }
75
76 @Override
77 public void clear() {
78 this.context.clear();
79 }
80
81 }