1 18 19 package org.objectweb.util.monolog.wrapper.config; 20 21 import org.objectweb.util.monolog.api.Handler; 22 23 import java.util.Map ; 24 import java.util.HashMap ; 25 import java.io.Serializable ; 26 27 34 public class BasicHandler implements Handler, Serializable { 35 36 39 protected String name = null; 40 41 46 protected HashMap attributes = null; 47 48 51 protected String type; 52 53 public BasicHandler(String n, String t) { 54 type = t; 55 name = n; 56 attributes = new HashMap (); 57 } 58 59 public Map getAttributes() { 60 return attributes; 61 } 62 63 public void setAttributes(Map properties) { 64 attributes.clear(); 65 attributes.putAll(properties); 66 } 67 68 71 public String getName() { 72 return name; 73 } 74 75 public void setName(String n) { 76 name = n; 77 } 78 79 public String getType() { 80 return type; 81 } 82 83 public String [] getAttributeNames() { 84 return (String []) attributes.keySet().toArray(new String [0]); 85 } 86 87 public Object getAttribute(String key) { 88 return attributes.get(key); 89 } 90 91 public Object setAttribute(String key, Object value) { 92 return attributes.put(key, value); 93 } 94 } 95 | Popular Tags |