Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CF5741888D for ; Mon, 16 Nov 2015 12:01:58 +0000 (UTC) Received: (qmail 23108 invoked by uid 500); 16 Nov 2015 12:01:58 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 23075 invoked by uid 500); 16 Nov 2015 12:01:58 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 23066 invoked by uid 99); 16 Nov 2015 12:01:58 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2015 12:01:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 0D0021A09B4 for ; Mon, 16 Nov 2015 12:01:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.99 X-Spam-Level: X-Spam-Status: No, score=0.99 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Kq6rxc7zHMf0 for ; Mon, 16 Nov 2015 12:01:40 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 97BAA44521 for ; Mon, 16 Nov 2015 12:01:39 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E2DA1E0FEB for ; Mon, 16 Nov 2015 12:01:38 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id D77B83A0554 for ; Mon, 16 Nov 2015 12:01:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r972586 [20/28] - in /websites/production/felix/content/components/bundle-plugin-archives/bundle-plugin-LATEST: ./ css/ images/ images/logos/ images/profiles/ img/ js/ xref-test/ xref-test/org/ xref-test/org/apache/ xref-test/org/apache/fel... Date: Mon, 16 Nov 2015 12:01:37 -0000 To: commits@felix.apache.org From: bimargulies@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151116120138.D77B83A0554@svn01-us-west.apache.org> Added: websites/production/felix/content/components/bundle-plugin-archives/bundle-plugin-LATEST/xref/org/apache/felix/bundleplugin/pom/MavenJDOMWriter.html ============================================================================== --- websites/production/felix/content/components/bundle-plugin-archives/bundle-plugin-LATEST/xref/org/apache/felix/bundleplugin/pom/MavenJDOMWriter.html (added) +++ websites/production/felix/content/components/bundle-plugin-archives/bundle-plugin-LATEST/xref/org/apache/felix/bundleplugin/pom/MavenJDOMWriter.html Mon Nov 16 12:01:35 2015 @@ -0,0 +1,2209 @@ + + + +MavenJDOMWriter xref + + + +
+1   package org.apache.felix.bundleplugin.pom;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one
+5    * or more contributor license agreements.  See the NOTICE file
+6    * distributed with this work for additional information
+7    * regarding copyright ownership.  The ASF licenses this file
+8    * to you under the Apache License, Version 2.0 (the
+9    * "License"); you may not use this file except in compliance
+10   * with the License.  You may obtain a copy of the License at
+11   *
+12   *   http://www.apache.org/licenses/LICENSE-2.0
+13   *
+14   * Unless required by applicable law or agreed to in writing,
+15   * software distributed under the License is distributed on an
+16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+17   * KIND, either express or implied.  See the License for the
+18   * specific language governing permissions and limitations
+19   * under the License.
+20   */
+21  
+22  import org.apache.maven.model.ActivationFile;
+23  import org.apache.maven.model.ActivationOS;
+24  import org.apache.maven.model.ActivationProperty;
+25  import org.apache.maven.model.Build;
+26  import org.apache.maven.model.BuildBase;
+27  import org.apache.maven.model.CiManagement;
+28  import org.apache.maven.model.ConfigurationContainer;
+29  import org.apache.maven.model.Contributor;
+30  import org.apache.maven.model.Dependency;
+31  import org.apache.maven.model.DependencyManagement;
+32  import org.apache.maven.model.DeploymentRepository;
+33  import org.apache.maven.model.Developer;
+34  import org.apache.maven.model.DistributionManagement;
+35  import org.apache.maven.model.Exclusion;
+36  import org.apache.maven.model.Extension;
+37  import org.apache.maven.model.FileSet;
+38  import org.apache.maven.model.IssueManagement;
+39  import org.apache.maven.model.License;
+40  import org.apache.maven.model.MailingList;
+41  import org.apache.maven.model.Model;
+42  import org.apache.maven.model.ModelBase;
+43  import org.apache.maven.model.Notifier;
+44  import org.apache.maven.model.Organization;
+45  import org.apache.maven.model.Parent;
+46  import org.apache.maven.model.PatternSet;
+47  import org.apache.maven.model.Plugin;
+48  import org.apache.maven.model.PluginConfiguration;
+49  import org.apache.maven.model.PluginContainer;
+50  import org.apache.maven.model.PluginExecution;
+51  import org.apache.maven.model.PluginManagement;
+52  import org.apache.maven.model.Prerequisites;
+53  import org.apache.maven.model.Profile;
+54  import org.apache.maven.model.Relocation;
+55  import org.apache.maven.model.ReportPlugin;
+56  import org.apache.maven.model.ReportSet;
+57  import org.apache.maven.model.Reporting;
+58  import org.apache.maven.model.Repository;
+59  import org.apache.maven.model.RepositoryBase;
+60  import org.apache.maven.model.RepositoryPolicy;
+61  import org.apache.maven.model.Resource;
+62  import org.apache.maven.model.Scm;
+63  import org.apache.maven.model.Site;
+64  import org.codehaus.plexus.util.xml.Xpp3Dom;
+65  import org.jdom.Content;
+66  import org.jdom.DefaultJDOMFactory;
+67  import org.jdom.Document;
+68  import org.jdom.Element;
+69  import org.jdom.Text;
+70  import org.jdom.output.Format;
+71  import org.jdom.output.XMLOutputter;
+72  
+73  import java.io.OutputStream;
+74  import java.io.OutputStreamWriter;
+75  import java.io.Writer;
+76  import java.util.ArrayList;
+77  import java.util.Collection;
+78  import java.util.Collections;
+79  import java.util.Iterator;
+80  import java.util.List;
+81  import java.util.Map;
+82  
+83  /**
+84   * Class MavenJDOMWriter.
+85   *
+86   * @version $Revision: 1682559 $ $Date: 2015-05-29 18:04:04 -0400 (Fri, 29 May 2015) $
+87   */
+88  public class MavenJDOMWriter
+89  {
+90      /**
+91       * Field factory
+92       */
+93      private DefaultJDOMFactory factory;
+94  
+95      /**
+96       * Field lineSeparator
+97       */
+98      private String lineSeparator;
+99  
+100     public MavenJDOMWriter()
+101     {
+102         factory = new DefaultJDOMFactory();
+103         lineSeparator = "\n";
+104     } // -- org.apache.maven.model.io.jdom.MavenJDOMWriter()
+105 
+106     /**
+107      * Method findAndReplaceProperties
+108      *
+109      * @param counter
+110      * @param props
+111      * @param name
+112      * @param parent
+113      */
+114     protected Element findAndReplaceProperties( Counter counter, Element parent, String name, Map props )
+115     {
+116         boolean shouldExist = props != null && !props.isEmpty();
+117         Element element = updateElement( counter, parent, name, shouldExist );
+118         if ( shouldExist )
+119         {
+120             Counter innerCounter = new Counter( counter.getDepth() + 1 );
+121             // while ( it.hasNext() )
+122             for ( Map.Entry<String, String> entry : ( (Map<String, String>) props ).entrySet() )
+123             {
+124                 String key = entry.getKey();
+125                 findAndReplaceSimpleElement( innerCounter, element, key, entry.getValue(), null );
+126             }
+127             List lst = new ArrayList( props.keySet() );
+128             Iterator it = element.getChildren().iterator();
+129             while ( it.hasNext() )
+130             {
+131                 Element elem = (Element) it.next();
+132                 String key = elem.getName();
+133                 if ( !lst.contains( key ) )
+134                 {
+135                     it.remove();
+136                 }
+137             }
+138         }
+139         return element;
+140     } // -- Element findAndReplaceProperties(Counter, Element, String, Map)
+141 
+142     /**
+143      * Method findAndReplaceSimpleElement
+144      *
+145      * @param counter
+146      * @param defaultValue
+147      * @param text
+148      * @param name
+149      * @param parent
+150      */
+151     protected Element findAndReplaceSimpleElement( Counter counter, Element parent, String name, String text,
+152                                                    String defaultValue )
+153     {
+154         if ( defaultValue != null && text != null && defaultValue.equals( text ) )
+155         {
+156             Element element = parent.getChild( name, parent.getNamespace() );
+157             // if exist and is default value or if doesn't exist.. just keep the way it is..
+158             if ( ( element != null && defaultValue.equals( element.getText() ) ) || element == null )
+159             {
+160                 return element;
+161             }
+162         }
+163         boolean shouldExist = text != null && text.trim().length() > 0;
+164         Element element = updateElement( counter, parent, name, shouldExist );
+165         if ( shouldExist )
+166         {
+167             element.setText( text );
+168         }
+169         return element;
+170     } // -- Element findAndReplaceSimpleElement(Counter, Element, String, String, String)
+171 
+172     /**
+173      * Method findAndReplaceSimpleLists
+174      *
+175      * @param counter
+176      * @param childName
+177      * @param parentName
+178      * @param list
+179      * @param parent
+180      */
+181     protected Element findAndReplaceSimpleLists( Counter counter, Element parent, Collection list,
+182                                                  String parentName, String childName )
+183     {
+184         boolean shouldExist = list != null && list.size() > 0;
+185         Element element = updateElement( counter, parent, parentName, shouldExist );
+186         if ( shouldExist )
+187         {
+188             Iterator it = list.iterator();
+189             Iterator elIt = element.getChildren( childName, element.getNamespace() ).iterator();
+190             if ( !elIt.hasNext() )
+191             {
+192                 elIt = null;
+193             }
+194             Counter innerCount = new Counter( counter.getDepth() + 1 );
+195             while ( it.hasNext() )
+196             {
+197                 String value = (String) it.next();
+198                 Element el;
+199                 if ( elIt != null && elIt.hasNext() )
+200                 {
+201                     el = (Element) elIt.next();
+202                     if ( !elIt.hasNext() )
+203                     {
+204                         elIt = null;
+205                     }
+206                 }
+207                 else
+208                 {
+209                     el = factory.element( childName, element.getNamespace() );
+210                     insertAtPreferredLocation( element, el, innerCount );
+211                 }
+212                 el.setText( value );
+213                 innerCount.increaseCount();
+214             }
+215             if ( elIt != null )
+216             {
+217                 while ( elIt.hasNext() )
+218                 {
+219                     elIt.next();
+220                     elIt.remove();
+221                 }
+222             }
+223         }
+224         return element;
+225     } // -- Element findAndReplaceSimpleLists(Counter, Element, java.util.Collection, String, String)
+226 
+227     /**
+228      * Method findAndReplaceXpp3DOM
+229      *
+230      * @param counter
+231      * @param dom
+232      * @param name
+233      * @param parent
+234      */
+235     protected Element findAndReplaceXpp3DOM( Counter counter, Element parent, String name, Xpp3Dom dom )
+236     {
+237         boolean shouldExist = dom != null && ( dom.getChildCount() > 0 || dom.getValue() != null );
+238         Element element = updateElement( counter, parent, name, shouldExist );
+239         if ( shouldExist )
+240         {
+241             replaceXpp3DOM( element, dom, new Counter( counter.getDepth() + 1 ) );
+242         }
+243         return element;
+244     } // -- Element findAndReplaceXpp3DOM(Counter, Element, String, Xpp3Dom)
+245 
+246     /**
+247      * Method insertAtPreferredLocation
+248      *
+249      * @param parent
+250      * @param counter
+251      * @param child
+252      */
+253     protected void insertAtPreferredLocation( Element parent, Element child, Counter counter )
+254     {
+255         int contentIndex = 0;
+256         int elementCounter = 0;
+257         Iterator it = parent.getContent().iterator();
+258         Text lastText = null;
+259         int offset = 0;
+260         while ( it.hasNext() && elementCounter <= counter.getCurrentIndex() )
+261         {
+262             Object next = it.next();
+263             offset = offset + 1;
+264             if ( next instanceof Element )
+265             {
+266                 elementCounter = elementCounter + 1;
+267                 contentIndex = contentIndex + offset;
+268                 offset = 0;
+269             }
+270             if ( next instanceof Text && it.hasNext() )
+271             {
+272                 lastText = (Text) next;
+273             }
+274         }
+275         if ( lastText != null && lastText.getTextTrim().length() == 0 )
+276         {
+277             lastText = (Text) lastText.clone();
+278         }
+279         else
+280         {
+281             String starter = lineSeparator;
+282             for ( int i = 0; i < counter.getDepth(); i++ )
+283             {
+284                 starter = starter + "    "; // TODO make settable?
+285             }
+286             lastText = factory.text( starter );
+287         }
+288         if ( parent.getContentSize() == 0 )
+289         {
+290             Text finalText = (Text) lastText.clone();
+291             finalText.setText( finalText.getText().substring( 0, finalText.getText().length() - "    ".length() ) );
+292             parent.addContent( contentIndex, finalText );
+293         }
+294         parent.addContent( contentIndex, child );
+295         parent.addContent( contentIndex, lastText );
+296     } // -- void insertAtPreferredLocation(Element, Element, Counter)
+297 
+298     /**
+299      * Method iterateContributor
+300      *
+301      * @param counter
+302      * @param childTag
+303      * @param parentTag
+304      * @param list
+305      * @param parent
+306      */
+307     protected void iterateContributor( Counter counter, Element parent, Collection list,
+308                                        String parentTag, String childTag )
+309     {
+310         boolean shouldExist = list != null && list.size() > 0;
+311         Element element = updateElement( counter, parent, parentTag, shouldExist );
+312         if ( shouldExist )
+313         {
+314             Iterator it = list.iterator();
+315             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+316             if ( !elIt.hasNext() )
+317             {
+318                 elIt = null;
+319             }
+320             Counter innerCount = new Counter( counter.getDepth() + 1 );
+321             while ( it.hasNext() )
+322             {
+323                 Contributor value = (Contributor) it.next();
+324                 Element el;
+325                 if ( elIt != null && elIt.hasNext() )
+326                 {
+327                     el = (Element) elIt.next();
+328                     if ( !elIt.hasNext() )
+329                     {
+330                         elIt = null;
+331                     }
+332                 }
+333                 else
+334                 {
+335                     el = factory.element( childTag, element.getNamespace() );
+336                     insertAtPreferredLocation( element, el, innerCount );
+337                 }
+338                 updateContributor( value, childTag, innerCount, el );
+339                 innerCount.increaseCount();
+340             }
+341             if ( elIt != null )
+342             {
+343                 while ( elIt.hasNext() )
+344                 {
+345                     elIt.next();
+346                     elIt.remove();
+347                 }
+348             }
+349         }
+350     } // -- void iterateContributor(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
+351 
+352     /**
+353      * Method iterateDependency
+354      *
+355      * @param counter
+356      * @param childTag
+357      * @param parentTag
+358      * @param list
+359      * @param parent
+360      */
+361     protected void iterateDependency( Counter counter, Element parent, Collection list,
+362                                       String parentTag, String childTag )
+363     {
+364         boolean shouldExist = list != null && list.size() > 0;
+365         Element element = updateElement( counter, parent, parentTag, shouldExist );
+366         if ( shouldExist )
+367         {
+368             Iterator it = list.iterator();
+369             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+370             if ( !elIt.hasNext() )
+371             {
+372                 elIt = null;
+373             }
+374             Counter innerCount = new Counter( counter.getDepth() + 1 );
+375             while ( it.hasNext() )
+376             {
+377                 Dependency value = (Dependency) it.next();
+378                 Element el;
+379                 if ( elIt != null && elIt.hasNext() )
+380                 {
+381                     el = (Element) elIt.next();
+382                     if ( !elIt.hasNext() )
+383                     {
+384                         elIt = null;
+385                     }
+386                 }
+387                 else
+388                 {
+389                     el = factory.element( childTag, element.getNamespace() );
+390                     insertAtPreferredLocation( element, el, innerCount );
+391                 }
+392                 updateDependency( value, childTag, innerCount, el );
+393                 innerCount.increaseCount();
+394             }
+395             if ( elIt != null )
+396             {
+397                 while ( elIt.hasNext() )
+398                 {
+399                     elIt.next();
+400                     elIt.remove();
+401                 }
+402             }
+403         }
+404     } // -- void iterateDependency(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
+405 
+406     /**
+407      * Method iterateDeveloper
+408      *
+409      * @param counter
+410      * @param childTag
+411      * @param parentTag
+412      * @param list
+413      * @param parent
+414      */
+415     protected void iterateDeveloper( Counter counter, Element parent, Collection list,
+416                                      String parentTag, String childTag )
+417     {
+418         boolean shouldExist = list != null && list.size() > 0;
+419         Element element = updateElement( counter, parent, parentTag, shouldExist );
+420         if ( shouldExist )
+421         {
+422             Iterator it = list.iterator();
+423             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+424             if ( !elIt.hasNext() )
+425             {
+426                 elIt = null;
+427             }
+428             Counter innerCount = new Counter( counter.getDepth() + 1 );
+429             while ( it.hasNext() )
+430             {
+431                 Developer value = (Developer) it.next();
+432                 Element el;
+433                 if ( elIt != null && elIt.hasNext() )
+434                 {
+435                     el = (Element) elIt.next();
+436                     if ( !elIt.hasNext() )
+437                     {
+438                         elIt = null;
+439                     }
+440                 }
+441                 else
+442                 {
+443                     el = factory.element( childTag, element.getNamespace() );
+444                     insertAtPreferredLocation( element, el, innerCount );
+445                 }
+446                 updateDeveloper( value, childTag, innerCount, el );
+447                 innerCount.increaseCount();
+448             }
+449             if ( elIt != null )
+450             {
+451                 while ( elIt.hasNext() )
+452                 {
+453                     elIt.next();
+454                     elIt.remove();
+455                 }
+456             }
+457         }
+458     } // -- void iterateDeveloper(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
+459 
+460     /**
+461      * Method iterateExclusion
+462      *
+463      * @param counter
+464      * @param childTag
+465      * @param parentTag
+466      * @param list
+467      * @param parent
+468      */
+469     protected void iterateExclusion( Counter counter, Element parent, Collection list,
+470                                      String parentTag, String childTag )
+471     {
+472         boolean shouldExist = list != null && list.size() > 0;
+473         Element element = updateElement( counter, parent, parentTag, shouldExist );
+474         if ( shouldExist )
+475         {
+476             Iterator it = list.iterator();
+477             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+478             if ( !elIt.hasNext() )
+479             {
+480                 elIt = null;
+481             }
+482             Counter innerCount = new Counter( counter.getDepth() + 1 );
+483             while ( it.hasNext() )
+484             {
+485                 Exclusion value = (Exclusion) it.next();
+486                 Element el;
+487                 if ( elIt != null && elIt.hasNext() )
+488                 {
+489                     el = (Element) elIt.next();
+490                     if ( !elIt.hasNext() )
+491                     {
+492                         elIt = null;
+493                     }
+494                 }
+495                 else
+496                 {
+497                     el = factory.element( childTag, element.getNamespace() );
+498                     insertAtPreferredLocation( element, el, innerCount );
+499                 }
+500                 updateExclusion( value, childTag, innerCount, el );
+501                 innerCount.increaseCount();
+502             }
+503             if ( elIt != null )
+504             {
+505                 while ( elIt.hasNext() )
+506                 {
+507                     elIt.next();
+508                     elIt.remove();
+509                 }
+510             }
+511         }
+512     } // -- void iterateExclusion(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
+513 
+514     /**
+515      * Method iterateExtension
+516      *
+517      * @param counter
+518      * @param childTag
+519      * @param parentTag
+520      * @param list
+521      * @param parent
+522      */
+523     protected void iterateExtension( Counter counter, Element parent, Collection list,
+524                                      String parentTag, String childTag )
+525     {
+526         boolean shouldExist = list != null && list.size() > 0;
+527         Element element = updateElement( counter, parent, parentTag, shouldExist );
+528         if ( shouldExist )
+529         {
+530             Iterator it = list.iterator();
+531             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+532             if ( !elIt.hasNext() )
+533             {
+534                 elIt = null;
+535             }
+536             Counter innerCount = new Counter( counter.getDepth() + 1 );
+537             while ( it.hasNext() )
+538             {
+539                 Extension value = (Extension) it.next();
+540                 Element el;
+541                 if ( elIt != null && elIt.hasNext() )
+542                 {
+543                     el = (Element) elIt.next();
+544                     if ( !elIt.hasNext() )
+545                     {
+546                         elIt = null;
+547                     }
+548                 }
+549                 else
+550                 {
+551                     el = factory.element( childTag, element.getNamespace() );
+552                     insertAtPreferredLocation( element, el, innerCount );
+553                 }
+554                 updateExtension( value, childTag, innerCount, el );
+555                 innerCount.increaseCount();
+556             }
+557             if ( elIt != null )
+558             {
+559                 while ( elIt.hasNext() )
+560                 {
+561                     elIt.next();
+562                     elIt.remove();
+563                 }
+564             }
+565         }
+566     } // -- void iterateExtension(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
+567 
+568     /**
+569      * Method iterateLicense
+570      *
+571      * @param counter
+572      * @param childTag
+573      * @param parentTag
+574      * @param list
+575      * @param parent
+576      */
+577     protected void iterateLicense( Counter counter, Element parent, Collection list,
+578                                    String parentTag, String childTag )
+579     {
+580         boolean shouldExist = list != null && list.size() > 0;
+581         Element element = updateElement( counter, parent, parentTag, shouldExist );
+582         if ( shouldExist )
+583         {
+584             Iterator it = list.iterator();
+585             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+586             if ( !elIt.hasNext() )
+587             {
+588                 elIt = null;
+589             }
+590             Counter innerCount = new Counter( counter.getDepth() + 1 );
+591             while ( it.hasNext() )
+592             {
+593                 License value = (License) it.next();
+594                 Element el;
+595                 if ( elIt != null && elIt.hasNext() )
+596                 {
+597                     el = (Element) elIt.next();
+598                     if ( !elIt.hasNext() )
+599                     {
+600                         elIt = null;
+601                     }
+602                 }
+603                 else
+604                 {
+605                     el = factory.element( childTag, element.getNamespace() );
+606                     insertAtPreferredLocation( element, el, innerCount );
+607                 }
+608                 updateLicense( value, childTag, innerCount, el );
+609                 innerCount.increaseCount();
+610             }
+611             if ( elIt != null )
+612             {
+613                 while ( elIt.hasNext() )
+614                 {
+615                     elIt.next();
+616                     elIt.remove();
+617                 }
+618             }
+619         }
+620     } // -- void iterateLicense(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
+621 
+622     /**
+623      * Method iterateMailingList
+624      *
+625      * @param counter
+626      * @param childTag
+627      * @param parentTag
+628      * @param list
+629      * @param parent
+630      */
+631     protected void iterateMailingList( Counter counter, Element parent, Collection list,
+632                                        String parentTag, String childTag )
+633     {
+634         boolean shouldExist = list != null && list.size() > 0;
+635         Element element = updateElement( counter, parent, parentTag, shouldExist );
+636         if ( shouldExist )
+637         {
+638             Iterator it = list.iterator();
+639             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+640             if ( !elIt.hasNext() )
+641             {
+642                 elIt = null;
+643             }
+644             Counter innerCount = new Counter( counter.getDepth() + 1 );
+645             while ( it.hasNext() )
+646             {
+647                 MailingList value = (MailingList) it.next();
+648                 Element el;
+649                 if ( elIt != null && elIt.hasNext() )
+650                 {
+651                     el = (Element) elIt.next();
+652                     if ( !elIt.hasNext() )
+653                     {
+654                         elIt = null;
+655                     }
+656                 }
+657                 else
+658                 {
+659                     el = factory.element( childTag, element.getNamespace() );
+660                     insertAtPreferredLocation( element, el, innerCount );
+661                 }
+662                 updateMailingList( value, childTag, innerCount, el );
+663                 innerCount.increaseCount();
+664             }
+665             if ( elIt != null )
+666             {
+667                 while ( elIt.hasNext() )
+668                 {
+669                     elIt.next();
+670                     elIt.remove();
+671                 }
+672             }
+673         }
+674     } // -- void iterateMailingList(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
+675 
+676     /**
+677      * Method iterateNotifier
+678      *
+679      * @param counter
+680      * @param childTag
+681      * @param parentTag
+682      * @param list
+683      * @param parent
+684      */
+685     protected void iterateNotifier( Counter counter, Element parent, Collection list,
+686                                     String parentTag, String childTag )
+687     {
+688         boolean shouldExist = list != null && list.size() > 0;
+689         Element element = updateElement( counter, parent, parentTag, shouldExist );
+690         if ( shouldExist )
+691         {
+692             Iterator it = list.iterator();
+693             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+694             if ( !elIt.hasNext() )
+695             {
+696                 elIt = null;
+697             }
+698             Counter innerCount = new Counter( counter.getDepth() + 1 );
+699             while ( it.hasNext() )
+700             {
+701                 Notifier value = (Notifier) it.next();
+702                 Element el;
+703                 if ( elIt != null && elIt.hasNext() )
+704                 {
+705                     el = (Element) elIt.next();
+706                     if ( !elIt.hasNext() )
+707                     {
+708                         elIt = null;
+709                     }
+710                 }
+711                 else
+712                 {
+713                     el = factory.element( childTag, element.getNamespace() );
+714                     insertAtPreferredLocation( element, el, innerCount );
+715                 }
+716                 updateNotifier( value, childTag, innerCount, el );
+717                 innerCount.increaseCount();
+718             }
+719             if ( elIt != null )
+720             {
+721                 while ( elIt.hasNext() )
+722                 {
+723                     elIt.next();
+724                     elIt.remove();
+725                 }
+726             }
+727         }
+728     } // -- void iterateNotifier(Counter, Element, java.util.Collection, java.lang.String, java.lang.String)
+729 
+730     /**
+731      * Method iteratePlugin
+732      *
+733      * @param counter
+734      * @param childTag
+735      * @param parentTag
+736      * @param list
+737      * @param parent
+738      */
+739     protected void iteratePlugin( Counter counter, Element parent, Collection list,
+740                                   String parentTag, String childTag )
+741     {
+742         boolean shouldExist = list != null && list.size() > 0;
+743         Element element = updateElement( counter, parent, parentTag, shouldExist );
+744         if ( shouldExist )
+745         {
+746             Iterator it = list.iterator();
+747             Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+748             if ( !elIt.hasNext() )
+749             {

[... 1454 lines stripped ...]