1 /* 2 =================== DO NOT EDIT THIS FILE ==================== 3 Generated by Modello 1.0.1 on 2009-03-28 16:23:33, 4 any modifications will be overwritten. 5 ============================================================== 6 */ 7 8 package org.apache.maven.plugin.registry; 9 10 /** 11 * Root element of the plugin registry file. 12 * 13 * @version $Revision$ $Date$ 14 */ 15 public class PluginRegistry 16 extends TrackableBase 17 implements java.io.Serializable 18 { 19 20 //--------------------------/ 21 //- Class/Member Variables -/ 22 //--------------------------/ 23 24 /** 25 * 26 * Specifies how often to check for plugin updates. 27 * Valid values are: never, always, interval:XXX. 28 * For the interval specification, XXX denotes a 29 * terse interval specification, such as 4h. 30 * Where h=hours, m=minutes, d=days, w=weeks. The 31 * interval period should be specified in descending 32 * order of granularity, like this: '[n]w [n]d [n]h 33 * [n]m'. Any omitted level of granularity will be 34 * assumed to be a zero value. 35 * 36 */ 37 private String updateInterval = "never"; 38 39 /** 40 * Specifies whether the user should be prompted to update 41 * plugins. 42 */ 43 private String autoUpdate; 44 45 /** 46 * Whether to resolve plugin versions using LATEST metadata. 47 */ 48 private String checkLatest; 49 50 /** 51 * Field plugins. 52 */ 53 private java.util.List/*<Plugin>*/ plugins; 54 55 /** 56 * Field modelEncoding. 57 */ 58 private String modelEncoding = "UTF-8"; 59 60 61 //-----------/ 62 //- Methods -/ 63 //-----------/ 64 65 /** 66 * Method addPlugin. 67 * 68 * @param plugin 69 */ 70 public void addPlugin( Plugin plugin ) 71 { 72 if ( !(plugin instanceof Plugin) ) 73 { 74 throw new ClassCastException( "PluginRegistry.addPlugins(plugin) parameter must be instanceof " + Plugin.class.getName() ); 75 } 76 getPlugins().add( plugin ); 77 } //-- void addPlugin( Plugin ) 78 79 /** 80 * Get specifies whether the user should be prompted to update 81 * plugins. 82 * 83 * @return String 84 */ 85 public String getAutoUpdate() 86 { 87 return this.autoUpdate; 88 } //-- String getAutoUpdate() 89 90 /** 91 * Get whether to resolve plugin versions using LATEST 92 * metadata. 93 * 94 * @return String 95 */ 96 public String getCheckLatest() 97 { 98 return this.checkLatest; 99 } //-- String getCheckLatest() 100 101 /** 102 * Method getModelEncoding. 103 * 104 * @return the current encoding used when reading/writing this 105 * model 106 */ 107 public String getModelEncoding() 108 { 109 return modelEncoding; 110 } //-- String getModelEncoding() 111 112 /** 113 * Method getPlugins. 114 * 115 * @return List 116 */ 117 public java.util.List/*<Plugin>*/ getPlugins() 118 { 119 if ( this.plugins == null ) 120 { 121 this.plugins = new java.util.ArrayList/*<Plugin>*/(); 122 } 123 124 return this.plugins; 125 } //-- java.util.List/*<Plugin>*/ getPlugins() 126 127 /** 128 * Get specifies how often to check for plugin updates. Valid 129 * values are: never, always, interval:XXX. 130 * For the interval specification, XXX denotes a 131 * terse interval specification, such as 4h. 132 * Where h=hours, m=minutes, d=days, w=weeks. The 133 * interval period should be specified in descending 134 * order of granularity, like this: '[n]w [n]d [n]h 135 * [n]m'. Any omitted level of granularity will be 136 * assumed to be a zero value. 137 * 138 * @return String 139 */ 140 public String getUpdateInterval() 141 { 142 return this.updateInterval; 143 } //-- String getUpdateInterval() 144 145 /** 146 * Method removePlugin. 147 * 148 * @param plugin 149 */ 150 public void removePlugin( Plugin plugin ) 151 { 152 if ( !(plugin instanceof Plugin) ) 153 { 154 throw new ClassCastException( "PluginRegistry.removePlugins(plugin) parameter must be instanceof " + Plugin.class.getName() ); 155 } 156 getPlugins().remove( plugin ); 157 } //-- void removePlugin( Plugin ) 158 159 /** 160 * Set specifies whether the user should be prompted to update 161 * plugins. 162 * 163 * @param autoUpdate 164 */ 165 public void setAutoUpdate( String autoUpdate ) 166 { 167 this.autoUpdate = autoUpdate; 168 } //-- void setAutoUpdate( String ) 169 170 /** 171 * Set whether to resolve plugin versions using LATEST 172 * metadata. 173 * 174 * @param checkLatest 175 */ 176 public void setCheckLatest( String checkLatest ) 177 { 178 this.checkLatest = checkLatest; 179 } //-- void setCheckLatest( String ) 180 181 /** 182 * Set an encoding used for reading/writing the model. 183 * 184 * @param modelEncoding 185 */ 186 public void setModelEncoding( String modelEncoding ) 187 { 188 this.modelEncoding = modelEncoding; 189 } //-- void setModelEncoding( String ) 190 191 /** 192 * Set specified plugin update policy information. 193 * 194 * @param plugins 195 */ 196 public void setPlugins( java.util.List/*<Plugin>*/ plugins ) 197 { 198 this.plugins = plugins; 199 } //-- void setPlugins( java.util.List ) 200 201 /** 202 * Set specifies how often to check for plugin updates. Valid 203 * values are: never, always, interval:XXX. 204 * For the interval specification, XXX denotes a 205 * terse interval specification, such as 4h. 206 * Where h=hours, m=minutes, d=days, w=weeks. The 207 * interval period should be specified in descending 208 * order of granularity, like this: '[n]w [n]d [n]h 209 * [n]m'. Any omitted level of granularity will be 210 * assumed to be a zero value. 211 * 212 * @param updateInterval 213 */ 214 public void setUpdateInterval( String updateInterval ) 215 { 216 this.updateInterval = updateInterval; 217 } //-- void setUpdateInterval( String ) 218 219 220 private java.util.Map pluginsByKey; 221 222 public java.util.Map getPluginsByKey() 223 { 224 if ( pluginsByKey == null ) 225 { 226 pluginsByKey = new java.util.HashMap(); 227 228 for ( java.util.Iterator it = getPlugins().iterator(); it.hasNext(); ) 229 { 230 Plugin plugin = (Plugin) it.next(); 231 232 pluginsByKey.put( plugin.getKey(), plugin ); 233 } 234 } 235 236 return pluginsByKey; 237 } 238 239 public void flushPluginsByKey() 240 { 241 this.pluginsByKey = null; 242 } 243 244 private RuntimeInfo runtimeInfo; 245 246 public void setRuntimeInfo( RuntimeInfo runtimeInfo ) 247 { 248 this.runtimeInfo = runtimeInfo; 249 } 250 251 public RuntimeInfo getRuntimeInfo() 252 { 253 return runtimeInfo; 254 } 255 256 }