1 19 package org.openide.modules; 20 21 import java.beans.*; 22 23 import java.util.*; 27 28 29 37 public abstract class ModuleInfo { 38 43 public static final String PROP_ENABLED = "enabled"; private final PropertyChangeSupport changeSupport = new PropertyChangeSupport(this); 45 46 47 protected ModuleInfo() { 48 } 49 50 51 public abstract String getCodeNameBase(); 52 53 54 public abstract int getCodeNameRelease(); 55 56 57 public abstract String getCodeName(); 58 59 63 public String getDisplayName() { 64 String dn = (String ) getLocalizedAttribute("OpenIDE-Module-Name"); 66 if (dn != null) { 67 return dn; 68 } 69 70 return getCodeNameBase(); 71 } 72 73 74 public abstract SpecificationVersion getSpecificationVersion(); 75 76 79 public String getImplementationVersion() { 80 return (String ) getAttribute("OpenIDE-Module-Implementation-Version"); } 82 83 89 public String getBuildVersion() { 90 String bld = (String ) getAttribute("OpenIDE-Module-Build-Version"); 92 return (bld == null) ? getImplementationVersion() : bld; 93 } 94 95 96 public abstract boolean isEnabled(); 97 98 102 public abstract Object getAttribute(String attr); 103 104 108 public abstract Object getLocalizedAttribute(String attr); 109 110 111 public final void addPropertyChangeListener(PropertyChangeListener l) { 112 if (l == null) { 113 throw new NullPointerException ( 114 "If you see this stack trace, please attach to: http://www.netbeans.org/issues/show_bug.cgi?id=22379" 115 ); } 117 118 changeSupport.addPropertyChangeListener(l); 119 } 120 121 122 public final void removePropertyChangeListener(PropertyChangeListener l) { 123 changeSupport.removePropertyChangeListener(l); 124 } 125 126 129 protected final void firePropertyChange(String prop, Object old, Object nue) { 130 changeSupport.firePropertyChange(prop, old, nue); 131 } 132 133 134 public abstract Set<Dependency> getDependencies(); 135 136 142 public abstract boolean owns(Class <?> clazz); 143 144 162 public ClassLoader getClassLoader() throws IllegalArgumentException { 163 throw new UnsupportedOperationException ("Must be overridden"); } 165 166 172 public String [] getProvides() { 173 return new String [] { }; 174 } 175 } 176 | Popular Tags |