You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2007/09/20 04:17:18 UTC
svn commit: r577504 [4/14] - in /maven/sandbox/trunk/archetypeng: ./
archetype-common/
archetype-common/src/main/java/org/apache/maven/archetype/common/
archetype-common/src/main/java/org/apache/maven/archetype/common/util/
archetype-common/src/main/ja...
Modified: maven/sandbox/trunk/archetypeng/archetype-common/src/main/java/org/apache/maven/archetype/common/MavenJDOMWriter.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/archetypeng/archetype-common/src/main/java/org/apache/maven/archetype/common/MavenJDOMWriter.java?rev=577504&r1=577503&r2=577504&view=diff
==============================================================================
--- maven/sandbox/trunk/archetypeng/archetype-common/src/main/java/org/apache/maven/archetype/common/MavenJDOMWriter.java (original)
+++ maven/sandbox/trunk/archetypeng/archetype-common/src/main/java/org/apache/maven/archetype/common/MavenJDOMWriter.java Wed Sep 19 19:17:13 2007
@@ -94,7 +94,7 @@
/**
* Class MavenJDOMWriter.
*
- * @version $Revision$ $Date$
+ * @version $Revision$ $Date$
*/
public class MavenJDOMWriter
{
@@ -102,82 +102,87 @@
// - Class/Member Variables -/
// --------------------------/
- /**
- * Field factory.
- */
+ /** Field factory. */
private DefaultJDOMFactory factory;
- /**
- * Field lineSeparator.
- */
+ /** Field lineSeparator. */
private String lineSeparator;
// ----------------/
// - Constructors -/
// ----------------/
- public MavenJDOMWriter ()
+ public MavenJDOMWriter()
{
- factory = new DefaultJDOMFactory ();
+ factory = new DefaultJDOMFactory();
lineSeparator = "\n";
} // -- org.apache.maven.model.io.jdom.MavenJDOMWriter()
/**
* Method write.
*
- * @param project
- * @param stream
- * @param document
- *
+ * @param project
+ * @param stream
+ * @param document
* @deprecated
*/
- public void write ( Model project, Document document, OutputStream stream )
- throws java.io.IOException
- {
- updateModel ( project, "project", new Counter ( 0 ), document.getRootElement () );
-
- XMLOutputter outputter = new XMLOutputter ();
- outputter.setFormat (
- Format.getPrettyFormat ().setIndent ( " " ).setLineSeparator (
- System.getProperty ( "line.separator" )
+ public void write( Model project,
+ Document document,
+ OutputStream stream )
+ throws
+ java.io.IOException
+ {
+ updateModel( project, "project", new Counter( 0 ), document.getRootElement() );
+
+ XMLOutputter outputter = new XMLOutputter();
+ outputter.setFormat(
+ Format.getPrettyFormat().setIndent( " " ).setLineSeparator(
+ System.getProperty( "line.separator" )
)
);
- outputter.output ( document, stream );
+ outputter.output( document, stream );
} // -- void write(Model, Document, OutputStream)
/**
* Method write.
*
- * @param project
- * @param writer
- * @param document
- */
- public void write ( Model project, Document document, OutputStreamWriter writer )
- throws java.io.IOException
+ * @param project
+ * @param writer
+ * @param document
+ */
+ public void write( Model project,
+ Document document,
+ OutputStreamWriter writer )
+ throws
+ java.io.IOException
{
Format format =
- Format.getRawFormat ().setEncoding ( writer.getEncoding () ).setLineSeparator (
- System.getProperty ( "line.separator" )
+ Format.getRawFormat().setEncoding( writer.getEncoding() ).setLineSeparator(
+ System.getProperty( "line.separator" )
);
- write ( project, document, writer, format );
+ write( project, document, writer, format );
} // -- void write(Model, Document, OutputStreamWriter)
/**
* Method write.
*
- * @param project
- * @param jdomFormat
- * @param writer
- * @param document
- */
- public void write ( Model project, Document document, Writer writer, Format jdomFormat )
- throws java.io.IOException
- {
- updateModel ( project, "project", new Counter ( 0 ), document.getRootElement () );
-
- XMLOutputter outputter = new XMLOutputter ();
- outputter.setFormat ( jdomFormat );
- outputter.output ( document, writer );
+ * @param project
+ * @param jdomFormat
+ * @param writer
+ * @param document
+ */
+ public void write( Model project,
+ Document document,
+ Writer writer,
+ Format jdomFormat )
+ throws
+ java.io.IOException
+ {
+ updateModel( project, "project", new Counter( 0 ), document.getRootElement() );
+
+ XMLOutputter outputter = new XMLOutputter();
+ outputter.setFormat( jdomFormat );
+ outputter.output( document, writer );
} // -- void write(Model, Document, Writer, Format)
// -----------/
@@ -187,45 +192,45 @@
/**
* Method findAndReplaceProperties.
*
- * @param counter
- * @param props
- * @param name
- * @param parent
+ * @param counter
+ * @param props
+ * @param name
+ * @param parent
*/
- protected Element findAndReplaceProperties (
+ protected Element findAndReplaceProperties(
Counter counter,
Element parent,
String name,
Map props
)
{
- boolean shouldExist = ( props != null ) && !props.isEmpty ();
- Element element = updateElement ( counter, parent, name, shouldExist );
+ boolean shouldExist = ( props != null ) && !props.isEmpty();
+ Element element = updateElement( counter, parent, name, shouldExist );
if ( shouldExist )
{
- Iterator it = props.keySet ().iterator ();
- Counter innerCounter = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Iterator it = props.keySet().iterator();
+ Counter innerCounter = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- String key = (String) it.next ();
- findAndReplaceSimpleElement (
+ String key = (String) it.next();
+ findAndReplaceSimpleElement(
innerCounter,
element,
key,
- (String) props.get ( key ),
+ (String) props.get( key ),
null
);
}
- ArrayList lst = new ArrayList ( props.keySet () );
- it = element.getChildren ().iterator ();
- while ( it.hasNext () )
- {
- Element elem = (Element) it.next ();
- String key = elem.getName ();
- if ( !lst.contains ( key ) )
+ ArrayList lst = new ArrayList( props.keySet() );
+ it = element.getChildren().iterator();
+ while ( it.hasNext() )
+ {
+ Element elem = (Element) it.next();
+ String key = elem.getName();
+ if ( !lst.contains( key ) )
{
- it.remove ();
+ it.remove();
}
}
}
@@ -235,13 +240,13 @@
/**
* Method findAndReplaceSimpleElement.
*
- * @param counter
- * @param defaultValue
- * @param text
- * @param name
- * @param parent
+ * @param counter
+ * @param defaultValue
+ * @param text
+ * @param name
+ * @param parent
*/
- protected Element findAndReplaceSimpleElement (
+ protected Element findAndReplaceSimpleElement(
Counter counter,
Element parent,
String name,
@@ -249,23 +254,23 @@
String defaultValue
)
{
- if ( ( defaultValue != null ) && ( text != null ) && defaultValue.equals ( text ) )
+ if ( ( defaultValue != null ) && ( text != null ) && defaultValue.equals( text ) )
{
- Element element = parent.getChild ( name, parent.getNamespace () );
+ Element element = parent.getChild( name, parent.getNamespace() );
// if exist and is default value or if doesn't exist.. just keep the way it is..
- if ( ( ( element != null ) && defaultValue.equals ( element.getText () ) )
+ if ( ( ( element != null ) && defaultValue.equals( element.getText() ) )
|| ( element == null )
- )
+ )
{
return element;
}
}
- boolean shouldExist = ( text != null ) && ( text.trim ().length () > 0 );
- Element element = updateElement ( counter, parent, name, shouldExist );
+ boolean shouldExist = ( text != null ) && ( text.trim().length() > 0 );
+ Element element = updateElement( counter, parent, name, shouldExist );
if ( shouldExist )
{
- element.setText ( text );
+ element.setText( text );
}
return element;
} // -- Element findAndReplaceSimpleElement(Counter, Element, String, String, String)
@@ -273,13 +278,13 @@
/**
* Method findAndReplaceSimpleLists.
*
- * @param counter
- * @param childName
- * @param parentName
- * @param list
- * @param parent
+ * @param counter
+ * @param childName
+ * @param parentName
+ * @param list
+ * @param parent
*/
- protected Element findAndReplaceSimpleLists (
+ protected Element findAndReplaceSimpleLists(
Counter counter,
Element parent,
java.util.Collection list,
@@ -287,60 +292,60 @@
String childName
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentName, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentName, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childName, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childName, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- String value = (String) it.next ();
+ String value = (String) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childName, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childName, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- el.setText ( value );
- innerCount.increaseCount ();
+ el.setText( value );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
return element;
} // -- Element findAndReplaceSimpleLists(Counter, Element, java.util.Collection, String,
- // String)
+ // String)
/**
* Method findAndReplaceXpp3DOM.
*
- * @param counter
- * @param dom
- * @param name
- * @param parent
+ * @param counter
+ * @param dom
+ * @param name
+ * @param parent
*/
- protected Element findAndReplaceXpp3DOM (
+ protected Element findAndReplaceXpp3DOM(
Counter counter,
Element parent,
String name,
@@ -348,11 +353,11 @@
)
{
boolean shouldExist =
- ( dom != null ) && ( ( dom.getChildCount () > 0 ) || ( dom.getValue () != null ) );
- Element element = updateElement ( counter, parent, name, shouldExist );
+ ( dom != null ) && ( ( dom.getChildCount() > 0 ) || ( dom.getValue() != null ) );
+ Element element = updateElement( counter, parent, name, shouldExist );
if ( shouldExist )
{
- replaceXpp3DOM ( element, dom, new Counter ( counter.getDepth () + 1 ) );
+ replaceXpp3DOM( element, dom, new Counter( counter.getDepth() + 1 ) );
}
return element;
} // -- Element findAndReplaceXpp3DOM(Counter, Element, String, Xpp3Dom)
@@ -360,20 +365,22 @@
/**
* Method insertAtPreferredLocation.
*
- * @param parent
- * @param counter
- * @param child
- */
- protected void insertAtPreferredLocation ( Element parent, Element child, Counter counter )
+ * @param parent
+ * @param counter
+ * @param child
+ */
+ protected void insertAtPreferredLocation( Element parent,
+ Element child,
+ Counter counter )
{
int contentIndex = 0;
int elementCounter = 0;
- Iterator it = parent.getContent ().iterator ();
+ Iterator it = parent.getContent().iterator();
Text lastText = null;
int offset = 0;
- while ( it.hasNext () && ( elementCounter <= counter.getCurrentIndex () ) )
+ while ( it.hasNext() && ( elementCounter <= counter.getCurrentIndex() ) )
{
- Object next = it.next ();
+ Object next = it.next();
offset = offset + 1;
if ( next instanceof Element )
{
@@ -381,49 +388,49 @@
contentIndex = contentIndex + offset;
offset = 0;
}
- if ( ( next instanceof Text ) && it.hasNext () )
+ if ( ( next instanceof Text ) && it.hasNext() )
{
lastText = (Text) next;
}
}
- if ( ( lastText != null ) && ( lastText.getTextTrim ().length () == 0 ) )
+ if ( ( lastText != null ) && ( lastText.getTextTrim().length() == 0 ) )
{
- lastText = (Text) lastText.clone ();
+ lastText = (Text) lastText.clone();
}
else
{
String starter = lineSeparator;
- for ( int i = 0; i < counter.getDepth (); i++ )
+ for ( int i = 0; i < counter.getDepth(); i++ )
{
starter = starter + " "; // TODO make settable?
}
- lastText = factory.text ( starter );
+ lastText = factory.text( starter );
}
- if ( parent.getContentSize () == 0 )
+ if ( parent.getContentSize() == 0 )
{
- Text finalText = (Text) lastText.clone ();
- finalText.setText (
- finalText.getText ().substring (
+ Text finalText = (Text) lastText.clone();
+ finalText.setText(
+ finalText.getText().substring(
0,
- finalText.getText ().length () - " ".length ()
+ finalText.getText().length() - " ".length()
)
);
- parent.addContent ( contentIndex, finalText );
+ parent.addContent( contentIndex, finalText );
}
- parent.addContent ( contentIndex, child );
- parent.addContent ( contentIndex, lastText );
+ parent.addContent( contentIndex, child );
+ parent.addContent( contentIndex, lastText );
} // -- void insertAtPreferredLocation(Element, Element, Counter)
/**
* Method iterateContributor.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateContributor (
+ protected void iterateContributor(
Counter counter,
Element parent,
java.util.Collection list,
@@ -431,60 +438,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Contributor value = (Contributor) it.next ();
+ Contributor value = (Contributor) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateContributor ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateContributor( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateContributor(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateDependency.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateDependency (
+ protected void iterateDependency(
Counter counter,
Element parent,
java.util.Collection list,
@@ -492,60 +499,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Dependency value = (Dependency) it.next ();
+ Dependency value = (Dependency) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateDependency ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateDependency( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateDependency(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateDeveloper.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateDeveloper (
+ protected void iterateDeveloper(
Counter counter,
Element parent,
java.util.Collection list,
@@ -553,60 +560,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Developer value = (Developer) it.next ();
+ Developer value = (Developer) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateDeveloper ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateDeveloper( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateDeveloper(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateExclusion.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateExclusion (
+ protected void iterateExclusion(
Counter counter,
Element parent,
java.util.Collection list,
@@ -614,60 +621,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Exclusion value = (Exclusion) it.next ();
+ Exclusion value = (Exclusion) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateExclusion ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateExclusion( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateExclusion(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateExtension.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateExtension (
+ protected void iterateExtension(
Counter counter,
Element parent,
java.util.Collection list,
@@ -675,60 +682,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Extension value = (Extension) it.next ();
+ Extension value = (Extension) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateExtension ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateExtension( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateExtension(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateLicense.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateLicense (
+ protected void iterateLicense(
Counter counter,
Element parent,
java.util.Collection list,
@@ -736,60 +743,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- License value = (License) it.next ();
+ License value = (License) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateLicense ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateLicense( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateLicense(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateMailingList.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateMailingList (
+ protected void iterateMailingList(
Counter counter,
Element parent,
java.util.Collection list,
@@ -797,60 +804,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- MailingList value = (MailingList) it.next ();
+ MailingList value = (MailingList) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateMailingList ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateMailingList( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateMailingList(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateNotifier.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateNotifier (
+ protected void iterateNotifier(
Counter counter,
Element parent,
java.util.Collection list,
@@ -858,60 +865,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Notifier value = (Notifier) it.next ();
+ Notifier value = (Notifier) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateNotifier ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateNotifier( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateNotifier(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iteratePlugin.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iteratePlugin (
+ protected void iteratePlugin(
Counter counter,
Element parent,
java.util.Collection list,
@@ -919,60 +926,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Plugin value = (Plugin) it.next ();
+ Plugin value = (Plugin) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updatePlugin ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updatePlugin( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iteratePlugin(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iteratePluginExecution.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iteratePluginExecution (
+ protected void iteratePluginExecution(
Counter counter,
Element parent,
java.util.Collection list,
@@ -980,60 +987,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- PluginExecution value = (PluginExecution) it.next ();
+ PluginExecution value = (PluginExecution) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updatePluginExecution ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updatePluginExecution( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iteratePluginExecution(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateProfile.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateProfile (
+ protected void iterateProfile(
Counter counter,
Element parent,
java.util.Collection list,
@@ -1041,60 +1048,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Profile value = (Profile) it.next ();
+ Profile value = (Profile) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateProfile ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateProfile( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateProfile(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateReportPlugin.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateReportPlugin (
+ protected void iterateReportPlugin(
Counter counter,
Element parent,
java.util.Collection list,
@@ -1102,60 +1109,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- ReportPlugin value = (ReportPlugin) it.next ();
+ ReportPlugin value = (ReportPlugin) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateReportPlugin ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateReportPlugin( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateReportPlugin(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateReportSet.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateReportSet (
+ protected void iterateReportSet(
Counter counter,
Element parent,
java.util.Collection list,
@@ -1163,60 +1170,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- ReportSet value = (ReportSet) it.next ();
+ ReportSet value = (ReportSet) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateReportSet ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateReportSet( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateReportSet(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateRepository.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateRepository (
+ protected void iterateRepository(
Counter counter,
Element parent,
java.util.Collection list,
@@ -1224,60 +1231,60 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Repository value = (Repository) it.next ();
+ Repository value = (Repository) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateRepository ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateRepository( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateRepository(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method iterateResource.
*
- * @param counter
- * @param childTag
- * @param parentTag
- * @param list
- * @param parent
+ * @param counter
+ * @param childTag
+ * @param parentTag
+ * @param list
+ * @param parent
*/
- protected void iterateResource (
+ protected void iterateResource(
Counter counter,
Element parent,
java.util.Collection list,
@@ -1285,79 +1292,81 @@
java.lang.String childTag
)
{
- boolean shouldExist = ( list != null ) && ( list.size () > 0 );
- Element element = updateElement ( counter, parent, parentTag, shouldExist );
+ boolean shouldExist = ( list != null ) && ( list.size() > 0 );
+ Element element = updateElement( counter, parent, parentTag, shouldExist );
if ( shouldExist )
{
- Iterator it = list.iterator ();
- Iterator elIt = element.getChildren ( childTag, element.getNamespace () ).iterator ();
- if ( !elIt.hasNext () )
+ Iterator it = list.iterator();
+ Iterator elIt = element.getChildren( childTag, element.getNamespace() ).iterator();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- while ( it.hasNext () )
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ while ( it.hasNext() )
{
- Resource value = (Resource) it.next ();
+ Resource value = (Resource) it.next();
Element el;
- if ( ( elIt != null ) && elIt.hasNext () )
+ if ( ( elIt != null ) && elIt.hasNext() )
{
- el = (Element) elIt.next ();
- if ( !elIt.hasNext () )
+ el = (Element) elIt.next();
+ if ( !elIt.hasNext() )
{
elIt = null;
}
}
else
{
- el = factory.element ( childTag, element.getNamespace () );
- insertAtPreferredLocation ( element, el, innerCount );
+ el = factory.element( childTag, element.getNamespace() );
+ insertAtPreferredLocation( element, el, innerCount );
}
- updateResource ( value, childTag, innerCount, el );
- innerCount.increaseCount ();
+ updateResource( value, childTag, innerCount, el );
+ innerCount.increaseCount();
}
if ( elIt != null )
{
- while ( elIt.hasNext () )
+ while ( elIt.hasNext() )
{
- elIt.next ();
- elIt.remove ();
+ elIt.next();
+ elIt.remove();
}
}
}
} // -- void iterateResource(Counter, Element, java.util.Collection, java.lang.String,
- // java.lang.String)
+ // java.lang.String)
/**
* Method replaceXpp3DOM.
*
- * @param parent
- * @param counter
- * @param parentDom
- */
- protected void replaceXpp3DOM ( Element parent, Xpp3Dom parentDom, Counter counter )
+ * @param parent
+ * @param counter
+ * @param parentDom
+ */
+ protected void replaceXpp3DOM( Element parent,
+ Xpp3Dom parentDom,
+ Counter counter )
{
- if ( parentDom.getChildCount () > 0 )
+ if ( parentDom.getChildCount() > 0 )
{
- Xpp3Dom[] childs = parentDom.getChildren ();
- Collection domChilds = new ArrayList ();
+ Xpp3Dom[] childs = parentDom.getChildren();
+ Collection domChilds = new ArrayList();
for ( int i = 0; i < childs.length; i++ )
{
- domChilds.add ( childs[i] );
+ domChilds.add( childs[i] );
}
int domIndex = 0;
- ListIterator it = parent.getChildren ().listIterator ();
- while ( it.hasNext () )
+ ListIterator it = parent.getChildren().listIterator();
+ while ( it.hasNext() )
{
- Element elem = (Element) it.next ();
- Iterator it2 = domChilds.iterator ();
+ Element elem = (Element) it.next();
+ Iterator it2 = domChilds.iterator();
Xpp3Dom corrDom = null;
- while ( it2.hasNext () )
+ while ( it2.hasNext() )
{
- Xpp3Dom dm = (Xpp3Dom) it2.next ();
- if ( dm.getName ().equals ( elem.getName () ) )
+ Xpp3Dom dm = (Xpp3Dom) it2.next();
+ if ( dm.getName().equals( elem.getName() ) )
{
corrDom = dm;
break;
@@ -1365,41 +1374,41 @@
}
if ( corrDom != null )
{
- domChilds.remove ( corrDom );
- replaceXpp3DOM ( elem, corrDom, new Counter ( counter.getDepth () + 1 ) );
- counter.increaseCount ();
+ domChilds.remove( corrDom );
+ replaceXpp3DOM( elem, corrDom, new Counter( counter.getDepth() + 1 ) );
+ counter.increaseCount();
}
else
{
- parent.removeContent ( elem );
+ parent.removeContent( elem );
}
}
- Iterator it2 = domChilds.iterator ();
- while ( it2.hasNext () )
+ Iterator it2 = domChilds.iterator();
+ while ( it2.hasNext() )
{
- Xpp3Dom dm = (Xpp3Dom) it2.next ();
- Element elem = factory.element ( dm.getName (), parent.getNamespace () );
- insertAtPreferredLocation ( parent, elem, counter );
- counter.increaseCount ();
- replaceXpp3DOM ( elem, dm, new Counter ( counter.getDepth () + 1 ) );
+ Xpp3Dom dm = (Xpp3Dom) it2.next();
+ Element elem = factory.element( dm.getName(), parent.getNamespace() );
+ insertAtPreferredLocation( parent, elem, counter );
+ counter.increaseCount();
+ replaceXpp3DOM( elem, dm, new Counter( counter.getDepth() + 1 ) );
}
}
- else if ( parentDom.getValue () != null )
+ else if ( parentDom.getValue() != null )
{
- parent.setText ( parentDom.getValue () );
+ parent.setText( parentDom.getValue() );
}
} // -- void replaceXpp3DOM(Element, Xpp3Dom, Counter)
/**
* Method updateActivation.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateActivation (
+ protected void updateActivation(
Activation value,
String xmlTag,
Counter counter,
@@ -1407,35 +1416,35 @@
)
{
boolean shouldExist = value != null;
- Element root = updateElement ( counter, element, xmlTag, shouldExist );
+ Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement (
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement(
innerCount,
root,
"activeByDefault",
- ( value.isActiveByDefault () == false )
- ? null
- : String.valueOf ( value.isActiveByDefault () ),
+ ( value.isActiveByDefault() == false )
+ ? null
+ : String.valueOf( value.isActiveByDefault() ),
"false"
);
- findAndReplaceSimpleElement ( innerCount, root, "jdk", value.getJdk (), null );
- updateActivationOS ( value.getOs (), "os", innerCount, root );
- updateActivationProperty ( value.getProperty (), "property", innerCount, root );
- updateActivationFile ( value.getFile (), "file", innerCount, root );
+ findAndReplaceSimpleElement( innerCount, root, "jdk", value.getJdk(), null );
+ updateActivationOS( value.getOs(), "os", innerCount, root );
+ updateActivationProperty( value.getProperty(), "property", innerCount, root );
+ updateActivationFile( value.getFile(), "file", innerCount, root );
}
} // -- void updateActivation(Activation, String, Counter, Element)
/**
* Method updateActivationFile.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateActivationFile (
+ protected void updateActivationFile(
ActivationFile value,
String xmlTag,
Counter counter,
@@ -1443,24 +1452,24 @@
)
{
boolean shouldExist = value != null;
- Element root = updateElement ( counter, element, xmlTag, shouldExist );
+ Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement ( innerCount, root, "missing", value.getMissing (), null );
- findAndReplaceSimpleElement ( innerCount, root, "exists", value.getExists (), null );
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement( innerCount, root, "missing", value.getMissing(), null );
+ findAndReplaceSimpleElement( innerCount, root, "exists", value.getExists(), null );
}
} // -- void updateActivationFile(ActivationFile, String, Counter, Element)
/**
* Method updateActivationOS.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateActivationOS (
+ protected void updateActivationOS(
ActivationOS value,
String xmlTag,
Counter counter,
@@ -1468,26 +1477,26 @@
)
{
boolean shouldExist = value != null;
- Element root = updateElement ( counter, element, xmlTag, shouldExist );
+ Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement ( innerCount, root, "name", value.getName (), null );
- findAndReplaceSimpleElement ( innerCount, root, "family", value.getFamily (), null );
- findAndReplaceSimpleElement ( innerCount, root, "arch", value.getArch (), null );
- findAndReplaceSimpleElement ( innerCount, root, "version", value.getVersion (), null );
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null );
+ findAndReplaceSimpleElement( innerCount, root, "family", value.getFamily(), null );
+ findAndReplaceSimpleElement( innerCount, root, "arch", value.getArch(), null );
+ findAndReplaceSimpleElement( innerCount, root, "version", value.getVersion(), null );
}
} // -- void updateActivationOS(ActivationOS, String, Counter, Element)
/**
* Method updateActivationProperty.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateActivationProperty (
+ protected void updateActivationProperty(
ActivationProperty value,
String xmlTag,
Counter counter,
@@ -1495,127 +1504,130 @@
)
{
boolean shouldExist = value != null;
- Element root = updateElement ( counter, element, xmlTag, shouldExist );
+ Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement ( innerCount, root, "name", value.getName (), null );
- findAndReplaceSimpleElement ( innerCount, root, "value", value.getValue (), null );
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null );
+ findAndReplaceSimpleElement( innerCount, root, "value", value.getValue(), null );
}
} // -- void updateActivationProperty(ActivationProperty, String, Counter, Element)
/**
* Method updateBuild.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateBuild ( Build value, String xmlTag, Counter counter, Element element )
+ protected void updateBuild( Build value,
+ String xmlTag,
+ Counter counter,
+ Element element )
{
boolean shouldExist = value != null;
- Element root = updateElement ( counter, element, xmlTag, shouldExist );
+ Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement (
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement(
innerCount,
root,
"sourceDirectory",
- value.getSourceDirectory (),
+ value.getSourceDirectory(),
null
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"scriptSourceDirectory",
- value.getScriptSourceDirectory (),
+ value.getScriptSourceDirectory(),
null
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"testSourceDirectory",
- value.getTestSourceDirectory (),
+ value.getTestSourceDirectory(),
null
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"outputDirectory",
- value.getOutputDirectory (),
+ value.getOutputDirectory(),
null
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"testOutputDirectory",
- value.getTestOutputDirectory (),
+ value.getTestOutputDirectory(),
null
);
- iterateExtension (
+ iterateExtension(
innerCount,
root,
- value.getExtensions (),
+ value.getExtensions(),
"extensions",
"extension"
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"defaultGoal",
- value.getDefaultGoal (),
+ value.getDefaultGoal(),
null
);
- iterateResource ( innerCount, root, value.getResources (), "resources", "resource" );
- iterateResource (
+ iterateResource( innerCount, root, value.getResources(), "resources", "resource" );
+ iterateResource(
innerCount,
root,
- value.getTestResources (),
+ value.getTestResources(),
"testResources",
"testResource"
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"directory",
- value.getDirectory (),
+ value.getDirectory(),
null
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"finalName",
- value.getFinalName (),
+ value.getFinalName(),
null
);
- findAndReplaceSimpleLists (
+ findAndReplaceSimpleLists(
innerCount,
root,
- value.getFilters (),
+ value.getFilters(),
"filters",
"filter"
);
- updatePluginManagement (
- value.getPluginManagement (),
+ updatePluginManagement(
+ value.getPluginManagement(),
"pluginManagement",
innerCount,
root
);
- iteratePlugin ( innerCount, root, value.getPlugins (), "plugins", "plugin" );
+ iteratePlugin( innerCount, root, value.getPlugins(), "plugins", "plugin" );
} // end if
} // -- void updateBuild(Build, String, Counter, Element)
/**
* Method updateBuildBase.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateBuildBase (
+ protected void updateBuildBase(
BuildBase value,
String xmlTag,
Counter counter,
@@ -1623,65 +1635,65 @@
)
{
boolean shouldExist = value != null;
- Element root = updateElement ( counter, element, xmlTag, shouldExist );
+ Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement (
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement(
innerCount,
root,
"defaultGoal",
- value.getDefaultGoal (),
+ value.getDefaultGoal(),
null
);
- iterateResource ( innerCount, root, value.getResources (), "resources", "resource" );
- iterateResource (
+ iterateResource( innerCount, root, value.getResources(), "resources", "resource" );
+ iterateResource(
innerCount,
root,
- value.getTestResources (),
+ value.getTestResources(),
"testResources",
"testResource"
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"directory",
- value.getDirectory (),
+ value.getDirectory(),
null
);
- findAndReplaceSimpleElement (
+ findAndReplaceSimpleElement(
innerCount,
root,
"finalName",
- value.getFinalName (),
+ value.getFinalName(),
null
);
- findAndReplaceSimpleLists (
+ findAndReplaceSimpleLists(
innerCount,
root,
- value.getFilters (),
+ value.getFilters(),
"filters",
"filter"
);
- updatePluginManagement (
- value.getPluginManagement (),
+ updatePluginManagement(
+ value.getPluginManagement(),
"pluginManagement",
innerCount,
root
);
- iteratePlugin ( innerCount, root, value.getPlugins (), "plugins", "plugin" );
+ iteratePlugin( innerCount, root, value.getPlugins(), "plugins", "plugin" );
}
} // -- void updateBuildBase(BuildBase, String, Counter, Element)
/**
* Method updateCiManagement.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateCiManagement (
+ protected void updateCiManagement(
CiManagement value,
String xmlTag,
Counter counter,
@@ -1689,25 +1701,25 @@
)
{
boolean shouldExist = value != null;
- Element root = updateElement ( counter, element, xmlTag, shouldExist );
+ Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement ( innerCount, root, "system", value.getSystem (), null );
- findAndReplaceSimpleElement ( innerCount, root, "url", value.getUrl (), null );
- iterateNotifier ( innerCount, root, value.getNotifiers (), "notifiers", "notifier" );
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement( innerCount, root, "system", value.getSystem(), null );
+ findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null );
+ iterateNotifier( innerCount, root, value.getNotifiers(), "notifiers", "notifier" );
}
} // -- void updateCiManagement(CiManagement, String, Counter, Element)
/**
* Method updateConfigurationContainer.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateConfigurationContainer (
+ protected void updateConfigurationContainer(
ConfigurationContainer value,
String xmlTag,
Counter counter,
@@ -1715,22 +1727,22 @@
)
{
boolean shouldExist = value != null;
- Element root = updateElement ( counter, element, xmlTag, shouldExist );
+ Element root = updateElement( counter, element, xmlTag, shouldExist );
if ( shouldExist )
{
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement (
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement(
innerCount,
root,
"inherited",
- value.getInherited (),
+ value.getInherited(),
null
);
- findAndReplaceXpp3DOM (
+ findAndReplaceXpp3DOM(
innerCount,
root,
"configuration",
- (Xpp3Dom) value.getConfiguration ()
+ (Xpp3Dom) value.getConfiguration()
);
}
} // -- void updateConfigurationContainer(ConfigurationContainer, String, Counter, Element)
@@ -1738,12 +1750,12 @@
/**
* Method updateContributor.
*
- * @param value
- * @param element
- * @param counter
- * @param xmlTag
+ * @param value
+ * @param element
+ * @param counter
+ * @param xmlTag
*/
- protected void updateContributor (
+ protected void updateContributor(
Contributor value,
String xmlTag,
Counter counter,
@@ -1751,38 +1763,38 @@
)
{
Element root = element;
- Counter innerCount = new Counter ( counter.getDepth () + 1 );
- findAndReplaceSimpleElement ( innerCount, root, "name", value.getName (), null );
- findAndReplaceSimpleElement ( innerCount, root, "email", value.getEmail (), null );
- findAndReplaceSimpleElement ( innerCount, root, "url", value.getUrl (), null );
- findAndReplaceSimpleElement (
+ Counter innerCount = new Counter( counter.getDepth() + 1 );
+ findAndReplaceSimpleElement( innerCount, root, "name", value.getName(), null );
+ findAndReplaceSimpleElement( innerCount, root, "email", value.getEmail(), null );
+ findAndReplaceSimpleElement( innerCount, root, "url", value.getUrl(), null );
+ findAndReplaceSimpleElement(
innerCount,
root,
"organization",
- value.getOrganization (),
+ value.getOrganization(),
[... 1928 lines stripped ...]