1 package org.columba.api.plugin; 19 20 import java.util.Hashtable ; 21 import java.util.Map ; 22 23 public class ExtensionMetadata { 24 25 private String id; 26 private String classname; 27 private boolean enabled=true; 28 private boolean singleton=false; 29 30 private Map <String , String > attributes; 31 32 public ExtensionMetadata(String id, String classname, Map <String , String > attributes) { 33 this(id, classname); 34 35 if ( attributes == null ) throw new IllegalArgumentException ("attributes == null"); 36 37 this.attributes = attributes; 38 39 } 40 41 public ExtensionMetadata(String id, String classname) { 42 if ( id == null ) throw new IllegalArgumentException ("id == null"); 43 if ( classname == null) throw new IllegalArgumentException ("classname == null"); 44 45 this.id = id; 46 this.classname = classname; 47 48 49 50 attributes = new Hashtable <String , String >(); 51 } 52 53 56 public String getClassname() { 57 return classname; 58 } 59 60 63 public String getId() { 64 return id; 65 } 66 67 70 public boolean isEnabled() { 71 return enabled; 72 } 73 74 77 public void setEnabled(boolean enabled) { 78 this.enabled = enabled; 79 } 80 81 84 public boolean isSingleton() { 85 return singleton; 86 } 87 88 91 public void setSingleton(boolean singleton) { 92 this.singleton = singleton; 93 } 94 95 public String getAttribute(String key) { 96 if ( key == null ) throw new IllegalArgumentException ("key == null"); 97 98 return (String ) attributes.get(key); 99 } 100 101 } 102 | Popular Tags |