1 /* 2 Licensed to the Apache Software Foundation (ASF) under one 3 or more contributor license agreements. See the NOTICE file 4 distributed with this work for additional information 5 regarding copyright ownership. The ASF licenses this file 6 to you under the Apache License, Version 2.0 (the 7 "License"); you may not use this file except in compliance 8 with the License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, 13 software distributed under the License is distributed on an 14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 KIND, either express or implied. See the License for the 16 specific language governing permissions and limitations 17 under the License. 18 =================== DO NOT EDIT THIS FILE ==================== 19 Generated by Modello 2.4.0, 20 any modifications will be overwritten. 21 ============================================================== 22 */ 23 24 package org.apache.maven.model; 25 26 /** 27 * Contains the information needed for deploying websites. 28 * 29 * @version $Revision$ $Date$ 30 */ 31 @SuppressWarnings( "all" ) 32 public class Site 33 implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker 34 { 35 36 //--------------------------/ 37 //- Class/Member Variables -/ 38 //--------------------------/ 39 40 /** 41 * 42 * 43 * A unique identifier for a deployment location. 44 * This is used to match the 45 * site to configuration in the 46 * <code>settings.xml</code> file, for example. 47 * 48 * 49 */ 50 private String id; 51 52 /** 53 * Human readable name of the deployment location. 54 */ 55 private String name; 56 57 /** 58 * 59 * 60 * The url of the location where website is 61 * deployed, in the form <code>protocol://hostname/path</code>. 62 * <br><b>Default value is</b>: parent value [+ 63 * path adjustment] + (artifactId or project.directory 64 * property), or just parent value if 65 * site's 66 * <code>child.site.url.inherit.append.path="false"</code> 67 * 68 * 69 */ 70 private String url; 71 72 /** 73 * 74 * 75 * When children inherit from distribution 76 * management site url, append path or not? Note: While the 77 * type 78 * of this field is <code>String</code> for 79 * technical reasons, the semantic type is actually 80 * <code>Boolean</code> 81 * <br><b>Default value is</b>: <code>true</code> 82 * <br><b>Since</b>: Maven 3.6.1 83 * 84 * . 85 */ 86 private String childSiteUrlInheritAppendPath; 87 88 /** 89 * Field locations. 90 */ 91 private java.util.Map<Object, InputLocation> locations; 92 93 /** 94 * Field location. 95 */ 96 private InputLocation location; 97 98 /** 99 * Field idLocation. 100 */ 101 private InputLocation idLocation; 102 103 /** 104 * Field nameLocation. 105 */ 106 private InputLocation nameLocation; 107 108 /** 109 * Field urlLocation. 110 */ 111 private InputLocation urlLocation; 112 113 /** 114 * Field childSiteUrlInheritAppendPathLocation. 115 */ 116 private InputLocation childSiteUrlInheritAppendPathLocation; 117 118 119 //-----------/ 120 //- Methods -/ 121 //-----------/ 122 123 /** 124 * Method clone. 125 * 126 * @return Site 127 */ 128 public Site clone() 129 { 130 try 131 { 132 Site copy = (Site) super.clone(); 133 134 if ( copy.locations != null ) 135 { 136 copy.locations = new java.util.LinkedHashMap( copy.locations ); 137 } 138 139 return copy; 140 } 141 catch ( java.lang.Exception ex ) 142 { 143 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName() 144 + " does not support clone()" ).initCause( ex ); 145 } 146 } //-- Site clone() 147 148 /** 149 * Get when children inherit from distribution management site 150 * url, append path or not? Note: While the type 151 * of this field is <code>String</code> for 152 * technical reasons, the semantic type is actually 153 * <code>Boolean</code> 154 * <br><b>Default value is</b>: <code>true</code> 155 * <br><b>Since</b>: Maven 3.6.1. 156 * 157 * @return String 158 */ 159 public String getChildSiteUrlInheritAppendPath() 160 { 161 return this.childSiteUrlInheritAppendPath; 162 } //-- String getChildSiteUrlInheritAppendPath() 163 164 /** 165 * Get a unique identifier for a deployment location. This is 166 * used to match the 167 * site to configuration in the 168 * <code>settings.xml</code> file, for example. 169 * 170 * @return String 171 */ 172 public String getId() 173 { 174 return this.id; 175 } //-- String getId() 176 177 /** 178 * 179 * 180 * @param key a key object. 181 * @return InputLocation 182 */ 183 public InputLocation getLocation( Object key ) 184 { 185 if ( key instanceof String ) 186 { 187 switch ( ( String ) key ) 188 { 189 case "" : 190 { 191 return this.location; 192 } 193 case "id" : 194 { 195 return idLocation; 196 } 197 case "name" : 198 { 199 return nameLocation; 200 } 201 case "url" : 202 { 203 return urlLocation; 204 } 205 case "childSiteUrlInheritAppendPath" : 206 { 207 return childSiteUrlInheritAppendPathLocation; 208 } 209 default : 210 { 211 return getOtherLocation( key ); 212 } 213 } 214 } 215 else 216 { 217 return getOtherLocation( key ); 218 } 219 } //-- InputLocation getLocation( Object ) 220 221 /** 222 * Get human readable name of the deployment location. 223 * 224 * @return String 225 */ 226 public String getName() 227 { 228 return this.name; 229 } //-- String getName() 230 231 /** 232 * 233 * 234 * @param key a key object. 235 * @param location a location object. 236 */ 237 public void setLocation( Object key, InputLocation location ) 238 { 239 if ( key instanceof String ) 240 { 241 switch ( ( String ) key ) 242 { 243 case "" : 244 { 245 this.location = location; 246 return; 247 } 248 case "id" : 249 { 250 idLocation = location; 251 return; 252 } 253 case "name" : 254 { 255 nameLocation = location; 256 return; 257 } 258 case "url" : 259 { 260 urlLocation = location; 261 return; 262 } 263 case "childSiteUrlInheritAppendPath" : 264 { 265 childSiteUrlInheritAppendPathLocation = location; 266 return; 267 } 268 default : 269 { 270 setOtherLocation( key, location ); 271 return; 272 } 273 } 274 } 275 else 276 { 277 setOtherLocation( key, location ); 278 } 279 } //-- void setLocation( Object, InputLocation ) 280 281 /** 282 * 283 * 284 * @param key a key object. 285 * @param location a location object. 286 */ 287 public void setOtherLocation( Object key, InputLocation location ) 288 { 289 if ( location != null ) 290 { 291 if ( this.locations == null ) 292 { 293 this.locations = new java.util.LinkedHashMap<Object, InputLocation>(); 294 } 295 this.locations.put( key, location ); 296 } 297 } //-- void setOtherLocation( Object, InputLocation ) 298 299 /** 300 * 301 * 302 * @param key a key object. 303 * @return InputLocation 304 */ 305 private InputLocation getOtherLocation( Object key ) 306 { 307 return ( locations != null ) ? locations.get( key ) : null; 308 } //-- InputLocation getOtherLocation( Object ) 309 310 /** 311 * Get the url of the location where website is deployed, in 312 * the form <code>protocol://hostname/path</code>. 313 * <br><b>Default value is</b>: parent value [+ 314 * path adjustment] + (artifactId or project.directory 315 * property), or just parent value if 316 * site's 317 * <code>child.site.url.inherit.append.path="false"</code> 318 * 319 * @return String 320 */ 321 public String getUrl() 322 { 323 return this.url; 324 } //-- String getUrl() 325 326 /** 327 * Set when children inherit from distribution management site 328 * url, append path or not? Note: While the type 329 * of this field is <code>String</code> for 330 * technical reasons, the semantic type is actually 331 * <code>Boolean</code> 332 * <br><b>Default value is</b>: <code>true</code> 333 * <br><b>Since</b>: Maven 3.6.1. 334 * 335 * @param childSiteUrlInheritAppendPath a 336 * childSiteUrlInheritAppendPath object. 337 */ 338 public void setChildSiteUrlInheritAppendPath( String childSiteUrlInheritAppendPath ) 339 { 340 this.childSiteUrlInheritAppendPath = childSiteUrlInheritAppendPath; 341 } //-- void setChildSiteUrlInheritAppendPath( String ) 342 343 /** 344 * Set a unique identifier for a deployment location. This is 345 * used to match the 346 * site to configuration in the 347 * <code>settings.xml</code> file, for example. 348 * 349 * @param id a id object. 350 */ 351 public void setId( String id ) 352 { 353 this.id = id; 354 } //-- void setId( String ) 355 356 /** 357 * Set human readable name of the deployment location. 358 * 359 * @param name a name object. 360 */ 361 public void setName( String name ) 362 { 363 this.name = name; 364 } //-- void setName( String ) 365 366 /** 367 * Set the url of the location where website is deployed, in 368 * the form <code>protocol://hostname/path</code>. 369 * <br><b>Default value is</b>: parent value [+ 370 * path adjustment] + (artifactId or project.directory 371 * property), or just parent value if 372 * site's 373 * <code>child.site.url.inherit.append.path="false"</code> 374 * 375 * @param url a url object. 376 */ 377 public void setUrl( String url ) 378 { 379 this.url = url; 380 } //-- void setUrl( String ) 381 382 383 384 385 public boolean isChildSiteUrlInheritAppendPath() 386 { 387 return ( childSiteUrlInheritAppendPath != null ) ? Boolean.parseBoolean( childSiteUrlInheritAppendPath ) : true; 388 } 389 390 public void setChildSiteUrlInheritAppendPath( boolean childSiteUrlInheritAppendPath ) 391 { 392 this.childSiteUrlInheritAppendPath = String.valueOf( childSiteUrlInheritAppendPath ); 393 } 394 395 396 397 }