1 package ch.elca.el4j.services.xmlmerge;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 import org.xml.sax.EntityResolver;
7
8
9
10
11
12
13
14
15
16
17
18
19
20 public class XmlMergeContext {
21
22 protected static final String ENTITY_RESOLVER_KEY = "entityResolver";
23
24 protected static final ThreadLocal<Map<String,Object>> m_context = new ThreadLocal<Map<String,Object>>() {
25 protected Map<String,Object> initialValue() {
26 return new HashMap<String, Object>();
27 }
28 };
29
30 public static EntityResolver getEntityResolver() {
31 if (m_context.get().containsKey(ENTITY_RESOLVER_KEY)) {
32 return (EntityResolver) m_context.get().get(ENTITY_RESOLVER_KEY);
33 }
34 return null;
35 }
36
37 public static void setEntityResolver(EntityResolver er) {
38 m_context.get().put(ENTITY_RESOLVER_KEY, er);
39 }
40
41 }