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