1 11 12 13 package org.eclipse.jdt.apt.core.internal; 14 15 import java.io.IOException ; 16 import java.util.LinkedHashMap ; 17 import java.util.Map ; 18 19 import org.eclipse.jdt.apt.core.internal.util.FactoryContainer; 20 21 public class PluginFactoryContainer extends FactoryContainer 22 { 23 24 private final String id; 25 26 27 private final boolean enableDefault; 28 29 35 public PluginFactoryContainer(final String pluginId, boolean enableDefault) { 36 this.id = pluginId; 37 this.enableDefault = enableDefault; 38 } 39 40 public void addFactoryName( String factoryName, String serviceName ) { 41 try { 42 getFactoryNames().put( factoryName, serviceName ); 43 } 44 catch (IOException ioe) { 45 AptPlugin.log(ioe, "IOException reading a plugin"); } 47 } 48 49 @Override 50 public boolean exists() { 51 return true; 53 } 54 55 protected Map <String , String > loadFactoryNames() { 56 return new LinkedHashMap <String , String >(); 58 } 59 60 public String getId() { 61 return id; 62 } 63 64 public boolean getEnableDefault() { 65 return enableDefault; 66 } 67 68 @Override 69 public FactoryType getType() { 70 return FactoryType.PLUGIN; 71 } 72 73 } 74 | Popular Tags |