Coverage Report - org.apache.maven.settings.io.xpp3.SettingsXpp3Writer
 
Classes in this File Line Coverage Branch Coverage Complexity
SettingsXpp3Writer
0 %
0/239
0 %
0/204
6,667
 
 1  
 /*
 2  
  =================== DO NOT EDIT THIS FILE ====================
 3  
  Generated by Modello 1.0.1 on 2009-09-09 03:05:33,
 4  
  any modifications will be overwritten.
 5  
  ==============================================================
 6  
  */
 7  
 
 8  
 package org.apache.maven.settings.io.xpp3;
 9  
 
 10  
   //---------------------------------/
 11  
  //- Imported classes and packages -/
 12  
 //---------------------------------/
 13  
 
 14  
 import java.io.Writer;
 15  
 import java.text.DateFormat;
 16  
 import java.util.Iterator;
 17  
 import java.util.Locale;
 18  
 import org.apache.maven.settings.Activation;
 19  
 import org.apache.maven.settings.ActivationFile;
 20  
 import org.apache.maven.settings.ActivationOS;
 21  
 import org.apache.maven.settings.ActivationProperty;
 22  
 import org.apache.maven.settings.IdentifiableBase;
 23  
 import org.apache.maven.settings.Mirror;
 24  
 import org.apache.maven.settings.Profile;
 25  
 import org.apache.maven.settings.Proxy;
 26  
 import org.apache.maven.settings.Repository;
 27  
 import org.apache.maven.settings.RepositoryBase;
 28  
 import org.apache.maven.settings.RepositoryPolicy;
 29  
 import org.apache.maven.settings.Server;
 30  
 import org.apache.maven.settings.Settings;
 31  
 import org.apache.maven.settings.TrackableBase;
 32  
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 33  
 import org.codehaus.plexus.util.xml.pull.MXSerializer;
 34  
 import org.codehaus.plexus.util.xml.pull.XmlSerializer;
 35  
 
 36  
 /**
 37  
  * Class SettingsXpp3Writer.
 38  
  * 
 39  
  * @version $Revision$ $Date$
 40  
  */
 41  0
 public class SettingsXpp3Writer
 42  
 {
 43  
 
 44  
       //--------------------------/
 45  
      //- Class/Member Variables -/
 46  
     //--------------------------/
 47  
 
 48  
     /**
 49  
      * Field NAMESPACE.
 50  
      */
 51  0
     private static final String NAMESPACE = null;
 52  
 
 53  
 
 54  
       //-----------/
 55  
      //- Methods -/
 56  
     //-----------/
 57  
 
 58  
     /**
 59  
      * Method write.
 60  
      * 
 61  
      * @param writer
 62  
      * @param settings
 63  
      * @throws java.io.IOException
 64  
      */
 65  
     public void write( Writer writer, Settings settings )
 66  
         throws java.io.IOException
 67  
     {
 68  0
         XmlSerializer serializer = new MXSerializer();
 69  0
         serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-indentation", "  " );
 70  0
         serializer.setProperty( "http://xmlpull.org/v1/doc/properties.html#serializer-line-separator", "\n" );
 71  0
         serializer.setOutput( writer );
 72  0
         serializer.startDocument( settings.getModelEncoding(), null );
 73  0
         writeSettings( settings, "settings", serializer );
 74  0
         serializer.endDocument();
 75  0
     } //-- void write( Writer, Settings )
 76  
 
 77  
     /**
 78  
      * Method writeActivation.
 79  
      * 
 80  
      * @param activation
 81  
      * @param serializer
 82  
      * @param tagName
 83  
      * @throws java.io.IOException
 84  
      */
 85  
     private void writeActivation( Activation activation, String tagName, XmlSerializer serializer )
 86  
         throws java.io.IOException
 87  
     {
 88  0
         if ( activation != null )
 89  
         {
 90  0
             serializer.startTag( NAMESPACE, tagName );
 91  0
             if ( activation.isActiveByDefault() != false )
 92  
             {
 93  0
                 serializer.startTag( NAMESPACE, "activeByDefault" ).text( String.valueOf( activation.isActiveByDefault() ) ).endTag( NAMESPACE, "activeByDefault" );
 94  
             }
 95  0
             if ( activation.getJdk() != null )
 96  
             {
 97  0
                 serializer.startTag( NAMESPACE, "jdk" ).text( activation.getJdk() ).endTag( NAMESPACE, "jdk" );
 98  
             }
 99  0
             if ( activation.getOs() != null )
 100  
             {
 101  0
                 writeActivationOS( (ActivationOS) activation.getOs(), "os", serializer );
 102  
             }
 103  0
             if ( activation.getProperty() != null )
 104  
             {
 105  0
                 writeActivationProperty( (ActivationProperty) activation.getProperty(), "property", serializer );
 106  
             }
 107  0
             if ( activation.getFile() != null )
 108  
             {
 109  0
                 writeActivationFile( (ActivationFile) activation.getFile(), "file", serializer );
 110  
             }
 111  0
             serializer.endTag( NAMESPACE, tagName );
 112  
         }
 113  0
     } //-- void writeActivation( Activation, String, XmlSerializer )
 114  
 
 115  
     /**
 116  
      * Method writeActivationFile.
 117  
      * 
 118  
      * @param activationFile
 119  
      * @param serializer
 120  
      * @param tagName
 121  
      * @throws java.io.IOException
 122  
      */
 123  
     private void writeActivationFile( ActivationFile activationFile, String tagName, XmlSerializer serializer )
 124  
         throws java.io.IOException
 125  
     {
 126  0
         if ( activationFile != null )
 127  
         {
 128  0
             serializer.startTag( NAMESPACE, tagName );
 129  0
             if ( activationFile.getMissing() != null )
 130  
             {
 131  0
                 serializer.startTag( NAMESPACE, "missing" ).text( activationFile.getMissing() ).endTag( NAMESPACE, "missing" );
 132  
             }
 133  0
             if ( activationFile.getExists() != null )
 134  
             {
 135  0
                 serializer.startTag( NAMESPACE, "exists" ).text( activationFile.getExists() ).endTag( NAMESPACE, "exists" );
 136  
             }
 137  0
             serializer.endTag( NAMESPACE, tagName );
 138  
         }
 139  0
     } //-- void writeActivationFile( ActivationFile, String, XmlSerializer )
 140  
 
 141  
     /**
 142  
      * Method writeActivationOS.
 143  
      * 
 144  
      * @param activationOS
 145  
      * @param serializer
 146  
      * @param tagName
 147  
      * @throws java.io.IOException
 148  
      */
 149  
     private void writeActivationOS( ActivationOS activationOS, String tagName, XmlSerializer serializer )
 150  
         throws java.io.IOException
 151  
     {
 152  0
         if ( activationOS != null )
 153  
         {
 154  0
             serializer.startTag( NAMESPACE, tagName );
 155  0
             if ( activationOS.getName() != null )
 156  
             {
 157  0
                 serializer.startTag( NAMESPACE, "name" ).text( activationOS.getName() ).endTag( NAMESPACE, "name" );
 158  
             }
 159  0
             if ( activationOS.getFamily() != null )
 160  
             {
 161  0
                 serializer.startTag( NAMESPACE, "family" ).text( activationOS.getFamily() ).endTag( NAMESPACE, "family" );
 162  
             }
 163  0
             if ( activationOS.getArch() != null )
 164  
             {
 165  0
                 serializer.startTag( NAMESPACE, "arch" ).text( activationOS.getArch() ).endTag( NAMESPACE, "arch" );
 166  
             }
 167  0
             if ( activationOS.getVersion() != null )
 168  
             {
 169  0
                 serializer.startTag( NAMESPACE, "version" ).text( activationOS.getVersion() ).endTag( NAMESPACE, "version" );
 170  
             }
 171  0
             serializer.endTag( NAMESPACE, tagName );
 172  
         }
 173  0
     } //-- void writeActivationOS( ActivationOS, String, XmlSerializer )
 174  
 
 175  
     /**
 176  
      * Method writeActivationProperty.
 177  
      * 
 178  
      * @param activationProperty
 179  
      * @param serializer
 180  
      * @param tagName
 181  
      * @throws java.io.IOException
 182  
      */
 183  
     private void writeActivationProperty( ActivationProperty activationProperty, String tagName, XmlSerializer serializer )
 184  
         throws java.io.IOException
 185  
     {
 186  0
         if ( activationProperty != null )
 187  
         {
 188  0
             serializer.startTag( NAMESPACE, tagName );
 189  0
             if ( activationProperty.getName() != null )
 190  
             {
 191  0
                 serializer.startTag( NAMESPACE, "name" ).text( activationProperty.getName() ).endTag( NAMESPACE, "name" );
 192  
             }
 193  0
             if ( activationProperty.getValue() != null )
 194  
             {
 195  0
                 serializer.startTag( NAMESPACE, "value" ).text( activationProperty.getValue() ).endTag( NAMESPACE, "value" );
 196  
             }
 197  0
             serializer.endTag( NAMESPACE, tagName );
 198  
         }
 199  0
     } //-- void writeActivationProperty( ActivationProperty, String, XmlSerializer )
 200  
 
 201  
     /**
 202  
      * Method writeIdentifiableBase.
 203  
      * 
 204  
      * @param identifiableBase
 205  
      * @param serializer
 206  
      * @param tagName
 207  
      * @throws java.io.IOException
 208  
      */
 209  
     private void writeIdentifiableBase( IdentifiableBase identifiableBase, String tagName, XmlSerializer serializer )
 210  
         throws java.io.IOException
 211  
     {
 212  0
         if ( identifiableBase != null )
 213  
         {
 214  0
             serializer.startTag( NAMESPACE, tagName );
 215  0
             if ( ( identifiableBase.getId() != null ) && !identifiableBase.getId().equals( "default" ) )
 216  
             {
 217  0
                 serializer.startTag( NAMESPACE, "id" ).text( identifiableBase.getId() ).endTag( NAMESPACE, "id" );
 218  
             }
 219  0
             serializer.endTag( NAMESPACE, tagName );
 220  
         }
 221  0
     } //-- void writeIdentifiableBase( IdentifiableBase, String, XmlSerializer )
 222  
 
 223  
     /**
 224  
      * Method writeMirror.
 225  
      * 
 226  
      * @param mirror
 227  
      * @param serializer
 228  
      * @param tagName
 229  
      * @throws java.io.IOException
 230  
      */
 231  
     private void writeMirror( Mirror mirror, String tagName, XmlSerializer serializer )
 232  
         throws java.io.IOException
 233  
     {
 234  0
         if ( mirror != null )
 235  
         {
 236  0
             serializer.startTag( NAMESPACE, tagName );
 237  0
             if ( mirror.getMirrorOf() != null )
 238  
             {
 239  0
                 serializer.startTag( NAMESPACE, "mirrorOf" ).text( mirror.getMirrorOf() ).endTag( NAMESPACE, "mirrorOf" );
 240  
             }
 241  0
             if ( mirror.getName() != null )
 242  
             {
 243  0
                 serializer.startTag( NAMESPACE, "name" ).text( mirror.getName() ).endTag( NAMESPACE, "name" );
 244  
             }
 245  0
             if ( mirror.getUrl() != null )
 246  
             {
 247  0
                 serializer.startTag( NAMESPACE, "url" ).text( mirror.getUrl() ).endTag( NAMESPACE, "url" );
 248  
             }
 249  0
             if ( ( mirror.getId() != null ) && !mirror.getId().equals( "default" ) )
 250  
             {
 251  0
                 serializer.startTag( NAMESPACE, "id" ).text( mirror.getId() ).endTag( NAMESPACE, "id" );
 252  
             }
 253  0
             serializer.endTag( NAMESPACE, tagName );
 254  
         }
 255  0
     } //-- void writeMirror( Mirror, String, XmlSerializer )
 256  
 
 257  
     /**
 258  
      * Method writeProfile.
 259  
      * 
 260  
      * @param profile
 261  
      * @param serializer
 262  
      * @param tagName
 263  
      * @throws java.io.IOException
 264  
      */
 265  
     private void writeProfile( Profile profile, String tagName, XmlSerializer serializer )
 266  
         throws java.io.IOException
 267  
     {
 268  0
         if ( profile != null )
 269  
         {
 270  0
             serializer.startTag( NAMESPACE, tagName );
 271  0
             if ( profile.getActivation() != null )
 272  
             {
 273  0
                 writeActivation( (Activation) profile.getActivation(), "activation", serializer );
 274  
             }
 275  0
             if ( ( profile.getProperties() != null ) && ( profile.getProperties().size() > 0 ) )
 276  
             {
 277  0
                 serializer.startTag( NAMESPACE, "properties" );
 278  0
                 for ( Iterator iter = profile.getProperties().keySet().iterator(); iter.hasNext(); )
 279  
                 {
 280  0
                     String key = (String) iter.next();
 281  0
                     String value = (String) profile.getProperties().get( key );
 282  0
                     serializer.startTag( NAMESPACE, "" + key + "" ).text( value ).endTag( NAMESPACE, "" + key + "" );
 283  0
                 }
 284  0
                 serializer.endTag( NAMESPACE, "properties" );
 285  
             }
 286  0
             if ( ( profile.getRepositories() != null ) && ( profile.getRepositories().size() > 0 ) )
 287  
             {
 288  0
                 serializer.startTag( NAMESPACE, "repositories" );
 289  0
                 for ( Iterator iter = profile.getRepositories().iterator(); iter.hasNext(); )
 290  
                 {
 291  0
                     Repository o = (Repository) iter.next();
 292  0
                     writeRepository( o, "repository", serializer );
 293  0
                 }
 294  0
                 serializer.endTag( NAMESPACE, "repositories" );
 295  
             }
 296  0
             if ( ( profile.getPluginRepositories() != null ) && ( profile.getPluginRepositories().size() > 0 ) )
 297  
             {
 298  0
                 serializer.startTag( NAMESPACE, "pluginRepositories" );
 299  0
                 for ( Iterator iter = profile.getPluginRepositories().iterator(); iter.hasNext(); )
 300  
                 {
 301  0
                     Repository o = (Repository) iter.next();
 302  0
                     writeRepository( o, "pluginRepository", serializer );
 303  0
                 }
 304  0
                 serializer.endTag( NAMESPACE, "pluginRepositories" );
 305  
             }
 306  0
             if ( ( profile.getId() != null ) && !profile.getId().equals( "default" ) )
 307  
             {
 308  0
                 serializer.startTag( NAMESPACE, "id" ).text( profile.getId() ).endTag( NAMESPACE, "id" );
 309  
             }
 310  0
             serializer.endTag( NAMESPACE, tagName );
 311  
         }
 312  0
     } //-- void writeProfile( Profile, String, XmlSerializer )
 313  
 
 314  
     /**
 315  
      * Method writeProxy.
 316  
      * 
 317  
      * @param proxy
 318  
      * @param serializer
 319  
      * @param tagName
 320  
      * @throws java.io.IOException
 321  
      */
 322  
     private void writeProxy( Proxy proxy, String tagName, XmlSerializer serializer )
 323  
         throws java.io.IOException
 324  
     {
 325  0
         if ( proxy != null )
 326  
         {
 327  0
             serializer.startTag( NAMESPACE, tagName );
 328  0
             if ( proxy.isActive() != true )
 329  
             {
 330  0
                 serializer.startTag( NAMESPACE, "active" ).text( String.valueOf( proxy.isActive() ) ).endTag( NAMESPACE, "active" );
 331  
             }
 332  0
             if ( ( proxy.getProtocol() != null ) && !proxy.getProtocol().equals( "http" ) )
 333  
             {
 334  0
                 serializer.startTag( NAMESPACE, "protocol" ).text( proxy.getProtocol() ).endTag( NAMESPACE, "protocol" );
 335  
             }
 336  0
             if ( proxy.getUsername() != null )
 337  
             {
 338  0
                 serializer.startTag( NAMESPACE, "username" ).text( proxy.getUsername() ).endTag( NAMESPACE, "username" );
 339  
             }
 340  0
             if ( proxy.getPassword() != null )
 341  
             {
 342  0
                 serializer.startTag( NAMESPACE, "password" ).text( proxy.getPassword() ).endTag( NAMESPACE, "password" );
 343  
             }
 344  0
             if ( proxy.getPort() != 8080 )
 345  
             {
 346  0
                 serializer.startTag( NAMESPACE, "port" ).text( String.valueOf( proxy.getPort() ) ).endTag( NAMESPACE, "port" );
 347  
             }
 348  0
             if ( proxy.getHost() != null )
 349  
             {
 350  0
                 serializer.startTag( NAMESPACE, "host" ).text( proxy.getHost() ).endTag( NAMESPACE, "host" );
 351  
             }
 352  0
             if ( proxy.getNonProxyHosts() != null )
 353  
             {
 354  0
                 serializer.startTag( NAMESPACE, "nonProxyHosts" ).text( proxy.getNonProxyHosts() ).endTag( NAMESPACE, "nonProxyHosts" );
 355  
             }
 356  0
             if ( ( proxy.getId() != null ) && !proxy.getId().equals( "default" ) )
 357  
             {
 358  0
                 serializer.startTag( NAMESPACE, "id" ).text( proxy.getId() ).endTag( NAMESPACE, "id" );
 359  
             }
 360  0
             serializer.endTag( NAMESPACE, tagName );
 361  
         }
 362  0
     } //-- void writeProxy( Proxy, String, XmlSerializer )
 363  
 
 364  
     /**
 365  
      * Method writeRepository.
 366  
      * 
 367  
      * @param repository
 368  
      * @param serializer
 369  
      * @param tagName
 370  
      * @throws java.io.IOException
 371  
      */
 372  
     private void writeRepository( Repository repository, String tagName, XmlSerializer serializer )
 373  
         throws java.io.IOException
 374  
     {
 375  0
         if ( repository != null )
 376  
         {
 377  0
             serializer.startTag( NAMESPACE, tagName );
 378  0
             if ( repository.getReleases() != null )
 379  
             {
 380  0
                 writeRepositoryPolicy( (RepositoryPolicy) repository.getReleases(), "releases", serializer );
 381  
             }
 382  0
             if ( repository.getSnapshots() != null )
 383  
             {
 384  0
                 writeRepositoryPolicy( (RepositoryPolicy) repository.getSnapshots(), "snapshots", serializer );
 385  
             }
 386  0
             if ( repository.getId() != null )
 387  
             {
 388  0
                 serializer.startTag( NAMESPACE, "id" ).text( repository.getId() ).endTag( NAMESPACE, "id" );
 389  
             }
 390  0
             if ( repository.getName() != null )
 391  
             {
 392  0
                 serializer.startTag( NAMESPACE, "name" ).text( repository.getName() ).endTag( NAMESPACE, "name" );
 393  
             }
 394  0
             if ( repository.getUrl() != null )
 395  
             {
 396  0
                 serializer.startTag( NAMESPACE, "url" ).text( repository.getUrl() ).endTag( NAMESPACE, "url" );
 397  
             }
 398  0
             if ( ( repository.getLayout() != null ) && !repository.getLayout().equals( "default" ) )
 399  
             {
 400  0
                 serializer.startTag( NAMESPACE, "layout" ).text( repository.getLayout() ).endTag( NAMESPACE, "layout" );
 401  
             }
 402  0
             serializer.endTag( NAMESPACE, tagName );
 403  
         }
 404  0
     } //-- void writeRepository( Repository, String, XmlSerializer )
 405  
 
 406  
     /**
 407  
      * Method writeRepositoryBase.
 408  
      * 
 409  
      * @param repositoryBase
 410  
      * @param serializer
 411  
      * @param tagName
 412  
      * @throws java.io.IOException
 413  
      */
 414  
     private void writeRepositoryBase( RepositoryBase repositoryBase, String tagName, XmlSerializer serializer )
 415  
         throws java.io.IOException
 416  
     {
 417  0
         if ( repositoryBase != null )
 418  
         {
 419  0
             serializer.startTag( NAMESPACE, tagName );
 420  0
             if ( repositoryBase.getId() != null )
 421  
             {
 422  0
                 serializer.startTag( NAMESPACE, "id" ).text( repositoryBase.getId() ).endTag( NAMESPACE, "id" );
 423  
             }
 424  0
             if ( repositoryBase.getName() != null )
 425  
             {
 426  0
                 serializer.startTag( NAMESPACE, "name" ).text( repositoryBase.getName() ).endTag( NAMESPACE, "name" );
 427  
             }
 428  0
             if ( repositoryBase.getUrl() != null )
 429  
             {
 430  0
                 serializer.startTag( NAMESPACE, "url" ).text( repositoryBase.getUrl() ).endTag( NAMESPACE, "url" );
 431  
             }
 432  0
             if ( ( repositoryBase.getLayout() != null ) && !repositoryBase.getLayout().equals( "default" ) )
 433  
             {
 434  0
                 serializer.startTag( NAMESPACE, "layout" ).text( repositoryBase.getLayout() ).endTag( NAMESPACE, "layout" );
 435  
             }
 436  0
             serializer.endTag( NAMESPACE, tagName );
 437  
         }
 438  0
     } //-- void writeRepositoryBase( RepositoryBase, String, XmlSerializer )
 439  
 
 440  
     /**
 441  
      * Method writeRepositoryPolicy.
 442  
      * 
 443  
      * @param repositoryPolicy
 444  
      * @param serializer
 445  
      * @param tagName
 446  
      * @throws java.io.IOException
 447  
      */
 448  
     private void writeRepositoryPolicy( RepositoryPolicy repositoryPolicy, String tagName, XmlSerializer serializer )
 449  
         throws java.io.IOException
 450  
     {
 451  0
         if ( repositoryPolicy != null )
 452  
         {
 453  0
             serializer.startTag( NAMESPACE, tagName );
 454  0
             if ( repositoryPolicy.isEnabled() != true )
 455  
             {
 456  0
                 serializer.startTag( NAMESPACE, "enabled" ).text( String.valueOf( repositoryPolicy.isEnabled() ) ).endTag( NAMESPACE, "enabled" );
 457  
             }
 458  0
             if ( repositoryPolicy.getUpdatePolicy() != null )
 459  
             {
 460  0
                 serializer.startTag( NAMESPACE, "updatePolicy" ).text( repositoryPolicy.getUpdatePolicy() ).endTag( NAMESPACE, "updatePolicy" );
 461  
             }
 462  0
             if ( repositoryPolicy.getChecksumPolicy() != null )
 463  
             {
 464  0
                 serializer.startTag( NAMESPACE, "checksumPolicy" ).text( repositoryPolicy.getChecksumPolicy() ).endTag( NAMESPACE, "checksumPolicy" );
 465  
             }
 466  0
             serializer.endTag( NAMESPACE, tagName );
 467  
         }
 468  0
     } //-- void writeRepositoryPolicy( RepositoryPolicy, String, XmlSerializer )
 469  
 
 470  
     /**
 471  
      * Method writeServer.
 472  
      * 
 473  
      * @param server
 474  
      * @param serializer
 475  
      * @param tagName
 476  
      * @throws java.io.IOException
 477  
      */
 478  
     private void writeServer( Server server, String tagName, XmlSerializer serializer )
 479  
         throws java.io.IOException
 480  
     {
 481  0
         if ( server != null )
 482  
         {
 483  0
             serializer.startTag( NAMESPACE, tagName );
 484  0
             if ( server.getUsername() != null )
 485  
             {
 486  0
                 serializer.startTag( NAMESPACE, "username" ).text( server.getUsername() ).endTag( NAMESPACE, "username" );
 487  
             }
 488  0
             if ( server.getPassword() != null )
 489  
             {
 490  0
                 serializer.startTag( NAMESPACE, "password" ).text( server.getPassword() ).endTag( NAMESPACE, "password" );
 491  
             }
 492  0
             if ( server.getPrivateKey() != null )
 493  
             {
 494  0
                 serializer.startTag( NAMESPACE, "privateKey" ).text( server.getPrivateKey() ).endTag( NAMESPACE, "privateKey" );
 495  
             }
 496  0
             if ( server.getPassphrase() != null )
 497  
             {
 498  0
                 serializer.startTag( NAMESPACE, "passphrase" ).text( server.getPassphrase() ).endTag( NAMESPACE, "passphrase" );
 499  
             }
 500  0
             if ( server.getFilePermissions() != null )
 501  
             {
 502  0
                 serializer.startTag( NAMESPACE, "filePermissions" ).text( server.getFilePermissions() ).endTag( NAMESPACE, "filePermissions" );
 503  
             }
 504  0
             if ( server.getDirectoryPermissions() != null )
 505  
             {
 506  0
                 serializer.startTag( NAMESPACE, "directoryPermissions" ).text( server.getDirectoryPermissions() ).endTag( NAMESPACE, "directoryPermissions" );
 507  
             }
 508  0
             if ( server.getConfiguration() != null )
 509  
             {
 510  0
                 ((Xpp3Dom) server.getConfiguration()).writeToSerializer( NAMESPACE, serializer );
 511  
             }
 512  0
             if ( ( server.getId() != null ) && !server.getId().equals( "default" ) )
 513  
             {
 514  0
                 serializer.startTag( NAMESPACE, "id" ).text( server.getId() ).endTag( NAMESPACE, "id" );
 515  
             }
 516  0
             serializer.endTag( NAMESPACE, tagName );
 517  
         }
 518  0
     } //-- void writeServer( Server, String, XmlSerializer )
 519  
 
 520  
     /**
 521  
      * Method writeSettings.
 522  
      * 
 523  
      * @param settings
 524  
      * @param serializer
 525  
      * @param tagName
 526  
      * @throws java.io.IOException
 527  
      */
 528  
     private void writeSettings( Settings settings, String tagName, XmlSerializer serializer )
 529  
         throws java.io.IOException
 530  
     {
 531  0
         if ( settings != null )
 532  
         {
 533  0
             serializer.setPrefix( "", "http://maven.apache.org/SETTINGS/1.0.0" );
 534  0
             serializer.setPrefix( "xsi", "http://www.w3.org/2001/XMLSchema-instance" );
 535  0
             serializer.startTag( NAMESPACE, tagName );
 536  0
             serializer.attribute( "", "xsi:schemaLocation", "http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" );
 537  0
             if ( settings.getLocalRepository() != null )
 538  
             {
 539  0
                 serializer.startTag( NAMESPACE, "localRepository" ).text( settings.getLocalRepository() ).endTag( NAMESPACE, "localRepository" );
 540  
             }
 541  0
             if ( settings.isInteractiveMode() != true )
 542  
             {
 543  0
                 serializer.startTag( NAMESPACE, "interactiveMode" ).text( String.valueOf( settings.isInteractiveMode() ) ).endTag( NAMESPACE, "interactiveMode" );
 544  
             }
 545  0
             if ( settings.isUsePluginRegistry() != false )
 546  
             {
 547  0
                 serializer.startTag( NAMESPACE, "usePluginRegistry" ).text( String.valueOf( settings.isUsePluginRegistry() ) ).endTag( NAMESPACE, "usePluginRegistry" );
 548  
             }
 549  0
             if ( settings.isOffline() != false )
 550  
             {
 551  0
                 serializer.startTag( NAMESPACE, "offline" ).text( String.valueOf( settings.isOffline() ) ).endTag( NAMESPACE, "offline" );
 552  
             }
 553  0
             if ( ( settings.getProxies() != null ) && ( settings.getProxies().size() > 0 ) )
 554  
             {
 555  0
                 serializer.startTag( NAMESPACE, "proxies" );
 556  0
                 for ( Iterator iter = settings.getProxies().iterator(); iter.hasNext(); )
 557  
                 {
 558  0
                     Proxy o = (Proxy) iter.next();
 559  0
                     writeProxy( o, "proxy", serializer );
 560  0
                 }
 561  0
                 serializer.endTag( NAMESPACE, "proxies" );
 562  
             }
 563  0
             if ( ( settings.getServers() != null ) && ( settings.getServers().size() > 0 ) )
 564  
             {
 565  0
                 serializer.startTag( NAMESPACE, "servers" );
 566  0
                 for ( Iterator iter = settings.getServers().iterator(); iter.hasNext(); )
 567  
                 {
 568  0
                     Server o = (Server) iter.next();
 569  0
                     writeServer( o, "server", serializer );
 570  0
                 }
 571  0
                 serializer.endTag( NAMESPACE, "servers" );
 572  
             }
 573  0
             if ( ( settings.getMirrors() != null ) && ( settings.getMirrors().size() > 0 ) )
 574  
             {
 575  0
                 serializer.startTag( NAMESPACE, "mirrors" );
 576  0
                 for ( Iterator iter = settings.getMirrors().iterator(); iter.hasNext(); )
 577  
                 {
 578  0
                     Mirror o = (Mirror) iter.next();
 579  0
                     writeMirror( o, "mirror", serializer );
 580  0
                 }
 581  0
                 serializer.endTag( NAMESPACE, "mirrors" );
 582  
             }
 583  0
             if ( ( settings.getProfiles() != null ) && ( settings.getProfiles().size() > 0 ) )
 584  
             {
 585  0
                 serializer.startTag( NAMESPACE, "profiles" );
 586  0
                 for ( Iterator iter = settings.getProfiles().iterator(); iter.hasNext(); )
 587  
                 {
 588  0
                     Profile o = (Profile) iter.next();
 589  0
                     writeProfile( o, "profile", serializer );
 590  0
                 }
 591  0
                 serializer.endTag( NAMESPACE, "profiles" );
 592  
             }
 593  0
             if ( ( settings.getActiveProfiles() != null ) && ( settings.getActiveProfiles().size() > 0 ) )
 594  
             {
 595  0
                 serializer.startTag( NAMESPACE, "activeProfiles" );
 596  0
                 for ( Iterator iter = settings.getActiveProfiles().iterator(); iter.hasNext(); )
 597  
                 {
 598  0
                     String activeProfile = (String) iter.next();
 599  0
                     serializer.startTag( NAMESPACE, "activeProfile" ).text( activeProfile ).endTag( NAMESPACE, "activeProfile" );
 600  0
                 }
 601  0
                 serializer.endTag( NAMESPACE, "activeProfiles" );
 602  
             }
 603  0
             if ( ( settings.getPluginGroups() != null ) && ( settings.getPluginGroups().size() > 0 ) )
 604  
             {
 605  0
                 serializer.startTag( NAMESPACE, "pluginGroups" );
 606  0
                 for ( Iterator iter = settings.getPluginGroups().iterator(); iter.hasNext(); )
 607  
                 {
 608  0
                     String pluginGroup = (String) iter.next();
 609  0
                     serializer.startTag( NAMESPACE, "pluginGroup" ).text( pluginGroup ).endTag( NAMESPACE, "pluginGroup" );
 610  0
                 }
 611  0
                 serializer.endTag( NAMESPACE, "pluginGroups" );
 612  
             }
 613  0
             serializer.endTag( NAMESPACE, tagName );
 614  
         }
 615  0
     } //-- void writeSettings( Settings, String, XmlSerializer )
 616  
 
 617  
     /**
 618  
      * Method writeTrackableBase.
 619  
      * 
 620  
      * @param trackableBase
 621  
      * @param serializer
 622  
      * @param tagName
 623  
      * @throws java.io.IOException
 624  
      */
 625  
     private void writeTrackableBase( TrackableBase trackableBase, String tagName, XmlSerializer serializer )
 626  
         throws java.io.IOException
 627  
     {
 628  0
         if ( trackableBase != null )
 629  
         {
 630  0
             serializer.startTag( NAMESPACE, tagName );
 631  0
             serializer.endTag( NAMESPACE, tagName );
 632  
         }
 633  0
     } //-- void writeTrackableBase( TrackableBase, String, XmlSerializer )
 634  
 
 635  
 
 636  
 }