1 13 package info.magnolia.context; 14 15 import java.util.HashMap ; 16 import java.util.Map ; 17 18 19 24 public abstract class AbstractMapBasedContext extends AbstractContext { 25 26 29 private Map map = new HashMap (); 30 31 32 public AbstractMapBasedContext() { 33 } 34 35 public AbstractMapBasedContext(Map map) { 36 super(); 37 this.map = map; 38 } 39 40 43 public void setAttribute(String name, Object value, int scope) { 44 this.map.put(name, value); 45 } 46 47 50 public Object getAttribute(String name, int scope) { 51 return this.map.get(name); 52 } 53 54 57 public void removeAttribute(String name, int scope) { 58 this.map.remove(name); 59 } 60 61 64 public Map getAttributes(int scope) { 65 return this.getAttributes(); 66 } 67 68 71 public Map getAttributes() { 72 return this.map; 73 } 74 75 76 public Map getMap() { 77 return map; 78 } 79 80 81 public void setMap(Map map) { 82 this.map = map; 83 } 84 85 } 86 | Popular Tags |