1 22 23 package org.aspectj.tools.doclets.standard; 24 25 import com.sun.javadoc.RootDoc; 26 import com.sun.tools.doclets.MessageRetriever; 27 28 import java.io.IOException ; 29 import java.net.URL ; 30 import java.util.Locale ; 31 import java.util.MissingResourceException ; 32 import java.util.PropertyResourceBundle ; 33 import java.util.ResourceBundle ; 34 35 40 public class ConfigurationStandard 41 extends com.sun.tools.doclets.standard.ConfigurationStandard 42 { 43 44 45 public boolean nocrosscuts = false; 46 47 48 public boolean nosummarycrosscuts = false; 49 50 51 public boolean log = false; 52 53 public ConfigurationStandard() { 54 57 String loc = "org.aspectj.tools.doclets.standard.resources.standard"; 58 final ClassLoader loader = getClass().getClassLoader(); 59 ResourceBundle bundle = null; 61 for (int i = 0; ((null == bundle) && (i < 4)); i++) { 62 63 try { 64 switch (i) { 65 case 0: 66 bundle = ResourceBundle.getBundle(loc); 67 standardmessage = new MessageRetriever(bundle); 68 break; 69 case 1: 70 Locale locale = Locale.getDefault(); 71 bundle = ResourceBundle.getBundle(loc, locale, loader); 72 standardmessage = new MessageRetriever(bundle); 73 break; 74 case 2: 75 standardmessage = new MessageRetriever(loc); 76 break; 77 case 3: 78 URL pURL = loader.getResource(loc + ".properties"); 79 bundle = new PropertyResourceBundle (pURL.openStream()); 80 standardmessage = new MessageRetriever(loc); 81 break; 82 } 83 break; } catch (MissingResourceException e) { } catch (IOException ie) { } } 87 if (null == bundle) { 88 throw new Error ("unable to load resource: " + loc); 89 } 90 } 91 92 94 public void setSpecificDocletOptions(RootDoc root) { 95 String [][] options = root.options(); 96 for (int i = 0; i < options.length; ++i) { 97 String opt = options[i][0].toLowerCase(); 98 if (opt.equals("-nocrosscuts")) { 99 nocrosscuts = true; 100 nosummarycrosscuts = true; 101 } else if (opt.equals("-nosummarycrosscuts")) { 102 nosummarycrosscuts = true; 103 } else if (opt.equals("-log")) { 104 log = true; 105 } 106 } 107 super.setSpecificDocletOptions(root); 108 } 109 110 public int specificDocletOptionLength(String opt) { 111 if (opt.equals("-nocrosscuts") || 112 opt.equals("-nosummarycrosscuts") || 113 opt.equals("-log")) { 114 return 1; 115 } 116 return super.specificDocletOptionLength(opt); 117 } 118 } 119 120 121 | Popular Tags |