You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2008/07/25 10:28:23 UTC

svn commit: r679701 [1/3] - in /maven/shared/trunk/maven-shared-model: ./ src/main/java/org/apache/maven/shared/model/ src/main/java/org/apache/maven/shared/model/impl/ src/test/java/org/apache/maven/shared/model/ src/test/java/org/apache/maven/shared/...

Author: bentmann
Date: Fri Jul 25 01:28:22 2008
New Revision: 679701

URL: http://svn.apache.org/viewvc?rev=679701&view=rev
Log:
o Set svn:eol-style=native

Modified:
    maven/shared/trunk/maven-shared-model/README.txt   (props changed)
    maven/shared/trunk/maven-shared-model/pom.xml   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DataSourceException.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DomainModel.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InputStreamDomainModel.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InterpolatorProperty.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainer.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerAction.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerFactory.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelDataSource.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelMarshaller.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelProperty.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelTransformer.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelTransformerContext.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/impl/DefaultModelDataSource.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/test/java/org/apache/maven/shared/model/ModelMarshallerTest.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/test/java/org/apache/maven/shared/model/ModelPropertyTest.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/test/java/org/apache/maven/shared/model/ModelTransformerContextTest.java   (contents, props changed)
    maven/shared/trunk/maven-shared-model/src/test/java/org/apache/maven/shared/model/impl/DefaultModelDataSourceTest.java   (contents, props changed)

Propchange: maven/shared/trunk/maven-shared-model/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/pom.xml?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/pom.xml (original)
+++ maven/shared/trunk/maven-shared-model/pom.xml Fri Jul 25 01:28:22 2008
@@ -1,59 +1,59 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.maven.shared</groupId>
-  <artifactId>maven-shared-model</artifactId>
-  <version>1.0-SNAPSHOT</version>
-  <name>maven-shared-model</name>
-  <dependencies>
-    <dependency>
-      <groupId>org.codehaus.woodstox</groupId>
-      <artifactId>wstx-asl</artifactId>
-      <version>3.2.6</version>
-    </dependency>
-    <dependency>
-      <groupId>javax.xml.stream</groupId>
-      <artifactId>stax-api</artifactId>
-      <version>1.0-2</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.4</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.shared</groupId>
+  <artifactId>maven-shared-model</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>maven-shared-model</name>
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.woodstox</groupId>
+      <artifactId>wstx-asl</artifactId>
+      <version>3.2.6</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.xml.stream</groupId>
+      <artifactId>stax-api</artifactId>
+      <version>1.0-2</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.4</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>
\ No newline at end of file

Propchange: maven/shared/trunk/maven-shared-model/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DataSourceException.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DataSourceException.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DataSourceException.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DataSourceException.java Fri Jul 25 01:28:22 2008
@@ -1,50 +1,50 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.IOException;
-
-/**
- * Exeception class whose instance is thrown if there is an illegal state within a data source.
- */
-public class DataSourceException
-    extends IOException
-{
-    static final long serialVersionUID = 8738495672439L;
-
-    /**
-     * Default constructor
-     */
-    public DataSourceException()
-    {
-        super();
-    }
-
-    /**
-     * Constructor
-     *
-     * @param message exception message
-     */
-    public DataSourceException( String message )
-    {
-        super( message );
-    }
-
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+
+/**
+ * Exeception class whose instance is thrown if there is an illegal state within a data source.
+ */
+public class DataSourceException
+    extends IOException
+{
+    static final long serialVersionUID = 8738495672439L;
+
+    /**
+     * Default constructor
+     */
+    public DataSourceException()
+    {
+        super();
+    }
+
+    /**
+     * Constructor
+     *
+     * @param message exception message
+     */
+    public DataSourceException( String message )
+    {
+        super( message );
+    }
+
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DataSourceException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DomainModel.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DomainModel.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DomainModel.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DomainModel.java Fri Jul 25 01:28:22 2008
@@ -1,43 +1,43 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Extensions or implementations of this interface can be used to provide wrappers around existing models or can be
- * used to expose model elements directly. Each respective ModelTransformer implementation should know how to cast to
- * the appropriate domain model type(s).
- */
-public interface DomainModel
-{
-
-    /**
-     * Returns event history of joins and deletes used in constructing this domain model.
-     *
-     * @return event history of joins and deletes used in constructing this domain model
-     */
-    String getEventHistory();
-
-    /**
-     * Sets event history of joins and deletes used in constructing this domain model
-     *
-     * @param history history of joins and deletes used in constructing this domain model
-     */
-    void setEventHistory( String history );
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Extensions or implementations of this interface can be used to provide wrappers around existing models or can be
+ * used to expose model elements directly. Each respective ModelTransformer implementation should know how to cast to
+ * the appropriate domain model type(s).
+ */
+public interface DomainModel
+{
+
+    /**
+     * Returns event history of joins and deletes used in constructing this domain model.
+     *
+     * @return event history of joins and deletes used in constructing this domain model
+     */
+    String getEventHistory();
+
+    /**
+     * Sets event history of joins and deletes used in constructing this domain model
+     *
+     * @param history history of joins and deletes used in constructing this domain model
+     */
+    void setEventHistory( String history );
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/DomainModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InputStreamDomainModel.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InputStreamDomainModel.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InputStreamDomainModel.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InputStreamDomainModel.java Fri Jul 25 01:28:22 2008
@@ -1,37 +1,37 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.InputStream;
-
-/**
- * Provides service for obtaining input stream of domain model.
- */
-public interface InputStreamDomainModel
-    extends DomainModel
-{
-
-    /**
-     * Returns input stream of domain model.
-     *
-     * @return input stream of domain model
-     */
-    InputStream getInputStream();
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.InputStream;
+
+/**
+ * Provides service for obtaining input stream of domain model.
+ */
+public interface InputStreamDomainModel
+    extends DomainModel
+{
+
+    /**
+     * Returns input stream of domain model.
+     *
+     * @return input stream of domain model
+     */
+    InputStream getInputStream();
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InputStreamDomainModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InterpolatorProperty.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InterpolatorProperty.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InterpolatorProperty.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InterpolatorProperty.java Fri Jul 25 01:28:22 2008
@@ -1,115 +1,115 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Provides interpolator property information.
- */
-public final class InterpolatorProperty
-{
-    /**
-     * The key (or name) of the property
-     */
-    private final String key;
-
-    /**
-     * The value of the property
-     */
-    private final String value;
-
-    /**
-     * Constructor
-     *
-     * @param key   the key (or name) of the property. May not be null
-     * @param value the value of the property. May not be null.
-     */
-    public InterpolatorProperty( String key, String value )
-    {
-        if ( key == null )
-        {
-            throw new IllegalArgumentException( "key: null" );
-        }
-
-        if ( value == null )
-        {
-            throw new IllegalArgumentException( "value: null" );
-        }
-        this.key = key;
-        this.value = value;
-    }
-
-    /**
-     * Returns key (or name) of property.
-     *
-     * @return key (or name) of property
-     */
-    public String getKey()
-    {
-        return key;
-    }
-
-    /**
-     * Returns value of property.
-     *
-     * @return value of property
-     */
-    public String getValue()
-    {
-        return value;
-    }
-
-    /**
-     * Returns true if key values match, otherwise returns false.
-     *
-     * @param o interpolator property to compare
-     * @return true if key values match, otherwise returns false
-     */
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-        if ( o == null || getClass() != o.getClass() )
-        {
-            return false;
-        }
-
-        InterpolatorProperty that = (InterpolatorProperty) o;
-
-        if ( !key.equals( that.key ) )
-        {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns hash code of interpolator property key.
-     *
-     * @return hash code of interpolator property key
-     */
-    public int hashCode()
-    {
-        return key.hashCode();
-    }
-
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Provides interpolator property information.
+ */
+public final class InterpolatorProperty
+{
+    /**
+     * The key (or name) of the property
+     */
+    private final String key;
+
+    /**
+     * The value of the property
+     */
+    private final String value;
+
+    /**
+     * Constructor
+     *
+     * @param key   the key (or name) of the property. May not be null
+     * @param value the value of the property. May not be null.
+     */
+    public InterpolatorProperty( String key, String value )
+    {
+        if ( key == null )
+        {
+            throw new IllegalArgumentException( "key: null" );
+        }
+
+        if ( value == null )
+        {
+            throw new IllegalArgumentException( "value: null" );
+        }
+        this.key = key;
+        this.value = value;
+    }
+
+    /**
+     * Returns key (or name) of property.
+     *
+     * @return key (or name) of property
+     */
+    public String getKey()
+    {
+        return key;
+    }
+
+    /**
+     * Returns value of property.
+     *
+     * @return value of property
+     */
+    public String getValue()
+    {
+        return value;
+    }
+
+    /**
+     * Returns true if key values match, otherwise returns false.
+     *
+     * @param o interpolator property to compare
+     * @return true if key values match, otherwise returns false
+     */
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+        if ( o == null || getClass() != o.getClass() )
+        {
+            return false;
+        }
+
+        InterpolatorProperty that = (InterpolatorProperty) o;
+
+        if ( !key.equals( that.key ) )
+        {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Returns hash code of interpolator property key.
+     *
+     * @return hash code of interpolator property key
+     */
+    public int hashCode()
+    {
+        return key.hashCode();
+    }
+
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/InterpolatorProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainer.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainer.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainer.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainer.java Fri Jul 25 01:28:22 2008
@@ -1,59 +1,59 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.List;
-
-/**
- * Provides services for determining actions to take: noop, delete, join. For example, say containers with the same ids
- * are joined, otherwise one must be deleted.
- * <pre>
- * ModelContainerA.id = "foo" and
- * ModelContainerB.id = "foobar"
- * </pre>
- * then ModelContainerA.containerAction(ModelContainerB) would return delete action for ModelContainerB.
- */
-public interface ModelContainer
-{
-
-    /**
-     * Returns the model properties contained within the model container. This list must be unmodifiable.
-     *
-     * @return the model properties contained within the model container
-     */
-    List<ModelProperty> getProperties();
-
-    /**
-     * Returns model container action (noop, delete, join) for the specified model container.
-     *
-     * @param modelContainer the model container to determine the action of
-     * @return model container action (noop, delete, join) for the specified model container
-     */
-    ModelContainerAction containerAction( ModelContainer modelContainer );
-
-    /**
-     * Creates new instance of model container.
-     *
-     * @param modelProperties
-     * @return new instance of model container
-     */
-    ModelContainer createNewInstance( List<ModelProperty> modelProperties );
-
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+/**
+ * Provides services for determining actions to take: noop, delete, join. For example, say containers with the same ids
+ * are joined, otherwise one must be deleted.
+ * <pre>
+ * ModelContainerA.id = "foo" and
+ * ModelContainerB.id = "foobar"
+ * </pre>
+ * then ModelContainerA.containerAction(ModelContainerB) would return delete action for ModelContainerB.
+ */
+public interface ModelContainer
+{
+
+    /**
+     * Returns the model properties contained within the model container. This list must be unmodifiable.
+     *
+     * @return the model properties contained within the model container
+     */
+    List<ModelProperty> getProperties();
+
+    /**
+     * Returns model container action (noop, delete, join) for the specified model container.
+     *
+     * @param modelContainer the model container to determine the action of
+     * @return model container action (noop, delete, join) for the specified model container
+     */
+    ModelContainerAction containerAction( ModelContainer modelContainer );
+
+    /**
+     * Creates new instance of model container.
+     *
+     * @param modelProperties
+     * @return new instance of model container
+     */
+    ModelContainer createNewInstance( List<ModelProperty> modelProperties );
+
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerAction.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerAction.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerAction.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerAction.java Fri Jul 25 01:28:22 2008
@@ -1,41 +1,41 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Model container actions
- */
-public enum ModelContainerAction
-{
-    /**
-     * Join two containers
-     */
-    JOIN,
-
-    /**
-     * Delete container
-     */
-    DELETE,
-
-    /**
-     * No operation
-     */
-    NOP
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Model container actions
+ */
+public enum ModelContainerAction
+{
+    /**
+     * Join two containers
+     */
+    JOIN,
+
+    /**
+     * Delete container
+     */
+    DELETE,
+
+    /**
+     * No operation
+     */
+    NOP
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerFactory.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerFactory.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerFactory.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerFactory.java Fri Jul 25 01:28:22 2008
@@ -1,48 +1,48 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Factory for returning model container instances. Unlike most factories, implementations of this class are meant to
- * create only one type of model container instance.
- */
-public interface ModelContainerFactory
-{
-
-    /**
-     * Returns collection of URIs asscociated with this factory.
-     *
-     * @return collection of URIs asscociated with this factory
-     */
-    Collection<String> getUris();
-
-    /**
-     * Creates a model container instance that contains the specified model properties. The implementing class instance may
-     * modify, add, delete or reorder the list of model properties before placing them into the returned model
-     * container.
-     *
-     * @param modelProperties the model properties to be contained within the model container
-     * @return the model container
-     */
-    ModelContainer create( List<ModelProperty> modelProperties );
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Factory for returning model container instances. Unlike most factories, implementations of this class are meant to
+ * create only one type of model container instance.
+ */
+public interface ModelContainerFactory
+{
+
+    /**
+     * Returns collection of URIs asscociated with this factory.
+     *
+     * @return collection of URIs asscociated with this factory
+     */
+    Collection<String> getUris();
+
+    /**
+     * Creates a model container instance that contains the specified model properties. The implementing class instance may
+     * modify, add, delete or reorder the list of model properties before placing them into the returned model
+     * container.
+     *
+     * @param modelProperties the model properties to be contained within the model container
+     * @return the model container
+     */
+    ModelContainer create( List<ModelProperty> modelProperties );
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelContainerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelDataSource.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelDataSource.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelDataSource.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelDataSource.java Fri Jul 25 01:28:22 2008
@@ -1,81 +1,81 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Provides services for joining, deleting and querying model containers.
- */
-public interface ModelDataSource
-{
-
-    /**
-     * Join model properties of the specified container a with the specified container b. Any elements of model container
-     * a must take precendence over model container b. All elements of model container A must exist in the data source;
-     * elements of model container b may or may not exist.
-     *
-     * @param a model container with precedence
-     * @param b model container without precedence
-     * @return joined model container
-     */
-    ModelContainer join( ModelContainer a, ModelContainer b )
-        throws DataSourceException;
-
-    /**
-     * Deletes properties of the specified model container from the data source.
-     *
-     * @param modelContainer the model container that holds the properties to be deleted
-     */
-    void delete( ModelContainer modelContainer );
-
-
-    /**
-     * Return copy of underlying model properties. No changes in this list will be reflected in the data source.
-     *
-     * @return copy of underlying model properties
-     */
-    List<ModelProperty> getModelProperties();
-
-    /**
-     * Returns model containers for the specified URI.
-     *
-     * @param uri
-     * @return
-     */
-    List<ModelContainer> queryFor( String uri )
-        throws DataSourceException;
-
-
-    /**
-     * Initializes the object with model properties.
-     *
-     * @param modelProperties the model properties that back the data source
-     */
-    void init( List<ModelProperty> modelProperties, Collection<ModelContainerFactory> modelContainerFactories );
-
-    /**
-     * Return history of all joins and deletes
-     *
-     * @return history of all joins and deletes
-     */
-    String getEventHistory();
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Provides services for joining, deleting and querying model containers.
+ */
+public interface ModelDataSource
+{
+
+    /**
+     * Join model properties of the specified container a with the specified container b. Any elements of model container
+     * a must take precendence over model container b. All elements of model container A must exist in the data source;
+     * elements of model container b may or may not exist.
+     *
+     * @param a model container with precedence
+     * @param b model container without precedence
+     * @return joined model container
+     */
+    ModelContainer join( ModelContainer a, ModelContainer b )
+        throws DataSourceException;
+
+    /**
+     * Deletes properties of the specified model container from the data source.
+     *
+     * @param modelContainer the model container that holds the properties to be deleted
+     */
+    void delete( ModelContainer modelContainer );
+
+
+    /**
+     * Return copy of underlying model properties. No changes in this list will be reflected in the data source.
+     *
+     * @return copy of underlying model properties
+     */
+    List<ModelProperty> getModelProperties();
+
+    /**
+     * Returns model containers for the specified URI.
+     *
+     * @param uri
+     * @return
+     */
+    List<ModelContainer> queryFor( String uri )
+        throws DataSourceException;
+
+
+    /**
+     * Initializes the object with model properties.
+     *
+     * @param modelProperties the model properties that back the data source
+     */
+    void init( List<ModelProperty> modelProperties, Collection<ModelContainerFactory> modelContainerFactories );
+
+    /**
+     * Return history of all joins and deletes
+     *
+     * @return history of all joins and deletes
+     */
+    String getEventHistory();
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelDataSource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelMarshaller.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelMarshaller.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelMarshaller.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelMarshaller.java Fri Jul 25 01:28:22 2008
@@ -1,368 +1,368 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Provides methods for marshalling and unmarshalling XML that does not contain attributes.
- */
-public final class ModelMarshaller
-{
-
-    /**
-     * Private Constructor
-     */
-    private ModelMarshaller()
-    {
-    }
-
-    /**
-     * Returns list of model properties transformed from the specified input stream.
-     *
-     * @param inputStream input stream containing the xml document. May not be null.
-     * @param baseUri     the base uri of every model property. May not be null or empty.
-     * @param collections set of uris that are to be treated as a collection (multiple entries). May be null.
-     * @return list of model properties transformed from the specified input stream.
-     * @throws IOException if there was a problem doing the transform
-     */
-    public static List<ModelProperty> marshallXmlToModelProperties( InputStream inputStream, String baseUri,
-                                                                    Set<String> collections )
-        throws IOException
-    {
-        if ( inputStream == null )
-        {
-            throw new IllegalArgumentException( "inputStream: null" );
-        }
-
-        if ( baseUri == null || baseUri.trim().length() == 0 )
-        {
-            throw new IllegalArgumentException( "baseUri: null" );
-        }
-
-        if ( collections == null )
-        {
-            collections = Collections.EMPTY_SET;
-        }
-
-        List<ModelProperty> modelProperties = new ArrayList<ModelProperty>();
-        XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
-        Uri uri = new Uri( baseUri );
-        String tagName = baseUri;
-        String tagValue = null;
-
-        int depth = 0;
-        XMLStreamReader xmlStreamReader = null;
-        try
-        {
-            xmlStreamReader = xmlInputFactory.createXMLStreamReader( inputStream );
-            Map<String, String> attributes = new HashMap<String, String>();
-            for ( ; ; xmlStreamReader.next() )
-            {
-                int type = xmlStreamReader.getEventType();
-                switch ( type )
-                {
-
-                    case XMLStreamConstants.CHARACTERS:
-                    {
-                        String tmp = xmlStreamReader.getText();
-                        if ( tmp != null && tmp.trim().length() != 0 )
-                        {
-                            tagValue = tmp;
-                        }
-                        break;
-                    }
-
-                    case XMLStreamConstants.START_ELEMENT:
-                    {
-                        depth++;
-                        if ( !tagName.equals( baseUri ) )
-                        {
-                            modelProperties.add( new ModelProperty( tagName, tagValue ) );
-                            if ( !attributes.isEmpty() )
-                            {
-                                for ( Map.Entry<String, String> e : attributes.entrySet() )
-                                {
-                                    modelProperties.add( new ModelProperty( e.getKey(), e.getValue() ) );
-                                }
-                                attributes.clear();
-                            }
-                        }
-
-                        tagName = uri.getUriFor( xmlStreamReader.getName().getLocalPart(), depth );
-                        if ( collections.contains( tagName + "#collection" ) )
-                        {
-                            tagName = tagName + "#collection";
-                            uri.addTag( xmlStreamReader.getName().getLocalPart() + "#collection" );
-                        }
-                        else
-                        {
-                            uri.addTag( xmlStreamReader.getName().getLocalPart() );
-                        }
-                        tagValue = null;
-
-                    }
-                    case XMLStreamConstants.ATTRIBUTE:
-                    {
-                        for ( int i = 0; i < xmlStreamReader.getAttributeCount(); i++ )
-                        {
-
-                            attributes.put(
-                                tagName + "#property/" + xmlStreamReader.getAttributeName( i ).getLocalPart(),
-                                xmlStreamReader.getAttributeValue( i ) );
-                        }
-                        break;
-                    }
-                    case XMLStreamConstants.END_ELEMENT:
-                    {
-                        depth--;
-                        if ( tagValue == null )
-                        {
-                            tagValue = "";
-                        }
-                        break;
-                    }
-                    case XMLStreamConstants.END_DOCUMENT:
-                    {
-                        modelProperties.add( new ModelProperty( tagName, tagValue ) );
-                        if ( !attributes.isEmpty() )
-                        {
-                            for ( Map.Entry<String, String> e : attributes.entrySet() )
-                            {
-                                modelProperties.add( new ModelProperty( e.getKey(), e.getValue() ) );
-                            }
-                            attributes.clear();
-                        }
-                        return modelProperties;
-                    }
-                }
-            }
-        }
-        catch ( XMLStreamException e )
-        {
-            throw new IOException( ":" + e.toString() );
-        }
-        finally
-        {
-            if ( xmlStreamReader != null )
-            {
-                try
-                {
-                    xmlStreamReader.close();
-                }
-                catch ( XMLStreamException e )
-                {
-                    e.printStackTrace();
-                }
-            }
-            try
-            {
-                inputStream.close();
-            }
-            catch ( IOException e )
-            {
-
-            }
-        }
-    }
-
-    /**
-     * Returns XML string unmarshalled from the specified list of model properties
-     *
-     * @param modelProperties the model properties to unmarshal. May not be null or empty
-     * @param baseUri         the base uri of every model property. May not be null or empty.
-     * @return XML string unmarshalled from the specified list of model properties
-     * @throws IOException if there was a problem with unmarshalling
-     */
-    public static String unmarshalModelPropertiesToXml( List<ModelProperty> modelProperties, String baseUri )
-        throws IOException
-    {
-        if ( modelProperties == null || modelProperties.isEmpty() )
-        {
-            throw new IllegalArgumentException( "modelProperties: null or empty" );
-        }
-
-        if ( baseUri == null || baseUri.trim().length() == 0 )
-        {
-            throw new IllegalArgumentException( "baseUri: null or empty" );
-        }
-
-        final int basePosition = baseUri.length();
-
-        StringBuffer sb = new StringBuffer();
-        List<String> lastUriTags = new ArrayList<String>();
-        int n = 1;
-        for ( ModelProperty mp : modelProperties )
-        {
-            String uri = mp.getUri();
-            if ( uri.contains( "#property" ) )
-            {
-                continue;
-            }
-            //String val = (mp.getValue() != null) ? "\"" + mp.getValue() + "\"" : null;
-            //   System.out.println("new ModelProperty(\"" + mp.getUri() +"\" , " + val +"),");
-            if ( !uri.startsWith( baseUri ) )
-            {
-                throw new IllegalArgumentException(
-                    "Passed in model property that does not match baseUri: Property URI = " + uri + ", Base URI = " +
-                        baseUri );
-            }
-            List<String> tagNames = getTagNamesFromUri( basePosition, uri );
-            if ( lastUriTags.size() > tagNames.size() )
-            {
-                for ( int i = lastUriTags.size() - 1; i >= tagNames.size(); i-- )
-                {
-                    sb.append( toEndTag( lastUriTags.get( i - 1 ) ) );
-                }
-            }
-            String tag = tagNames.get( tagNames.size() - 1 );
-
-            ModelProperty attribute = null;
-            int peekIndex = modelProperties.indexOf( mp ) + 1;
-            if ( peekIndex <= modelProperties.size() - 1 )
-            {
-                ModelProperty peekProperty = modelProperties.get( peekIndex );
-                if ( peekProperty.getUri().contains( "#property" ) )
-                {
-                    attribute = peekProperty;
-                }
-            }
-
-            sb.append( toStartTag( tag, attribute ) );
-            if ( mp.getResolvedValue() != null )
-            {
-                sb.append( mp.getResolvedValue() );
-                sb.append( toEndTag( tag ) );
-                n = 2;
-            }
-            else
-            {
-                n = 1;
-            }
-            lastUriTags = tagNames;
-        }
-        for ( int i = lastUriTags.size() - n; i >= 1; i-- )
-        {
-            sb.append( toEndTag( lastUriTags.get( i ) ) );
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Returns list of tag names parsed from the specified uri. All #collection parts of the tag are removed from the
-     * tag names.
-     *
-     * @param basePosition the base position in the specified URI to start the parse
-     * @param uri          the uri to parse for tag names
-     * @return list of tag names parsed from the specified uri
-     */
-    private static List<String> getTagNamesFromUri( int basePosition, String uri )
-    {
-        return Arrays.asList( uri.substring( basePosition ).replaceAll( "#collection", "" ).split( "/" ) );
-    }
-
-    /**
-     * Returns the XML formatted start tag for the specified value and the specified attribute.
-     *
-     * @param value     the value to use for the start tag
-     * @param attribute the attribute to use in constructing of start tag
-     * @return the XML formatted start tag for the specified value and the specified attribute
-     */
-    private static String toStartTag( String value, ModelProperty attribute )
-    {
-        StringBuffer sb = new StringBuffer(); //TODO: Support more than one attribute
-        sb.append( "\r\n<" ).append( value );
-        if ( attribute != null )
-        {
-            sb.append( " " ).append(
-                attribute.getUri().substring( attribute.getUri().indexOf( "#property/" ) + 10 ) ).append( "=\"" )
-                .append( attribute.getValue() ).append( "\" " );
-        }
-        sb.append( ">" );
-        return sb.toString();
-    }
-
-    /**
-     * Returns XML formatted end tag for the specified value.
-     *
-     * @param value the value to use for the end tag
-     * @return xml formatted end tag for the specified value
-     */
-    private static String toEndTag( String value )
-    {
-        if ( value.trim().length() == 0 )
-        {
-            return "";
-        }
-        StringBuffer sb = new StringBuffer();
-        sb.append( "</" ).append( value ).append( ">" );
-        return sb.toString();
-    }
-
-    /**
-     * Class for storing information about URIs.
-     */
-    private static class Uri
-    {
-
-        List<String> uris;
-
-        Uri( String baseUri )
-        {
-            uris = new LinkedList<String>();
-            uris.add( baseUri );
-        }
-
-        String getUriFor( String tag, int depth )
-        {
-            setUrisToDepth( depth );
-            StringBuffer sb = new StringBuffer();
-            for ( String tagName : uris )
-            {
-                sb.append( tagName ).append( "/" );
-            }
-            sb.append( tag );
-            return sb.toString();
-        }
-
-        void addTag( String tag )
-        {
-            uris.add( tag );
-        }
-
-        void setUrisToDepth( int depth )
-        {
-            uris = new LinkedList<String>( uris.subList( 0, depth ) );
-        }
-    }
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Provides methods for marshalling and unmarshalling XML that does not contain attributes.
+ */
+public final class ModelMarshaller
+{
+
+    /**
+     * Private Constructor
+     */
+    private ModelMarshaller()
+    {
+    }
+
+    /**
+     * Returns list of model properties transformed from the specified input stream.
+     *
+     * @param inputStream input stream containing the xml document. May not be null.
+     * @param baseUri     the base uri of every model property. May not be null or empty.
+     * @param collections set of uris that are to be treated as a collection (multiple entries). May be null.
+     * @return list of model properties transformed from the specified input stream.
+     * @throws IOException if there was a problem doing the transform
+     */
+    public static List<ModelProperty> marshallXmlToModelProperties( InputStream inputStream, String baseUri,
+                                                                    Set<String> collections )
+        throws IOException
+    {
+        if ( inputStream == null )
+        {
+            throw new IllegalArgumentException( "inputStream: null" );
+        }
+
+        if ( baseUri == null || baseUri.trim().length() == 0 )
+        {
+            throw new IllegalArgumentException( "baseUri: null" );
+        }
+
+        if ( collections == null )
+        {
+            collections = Collections.EMPTY_SET;
+        }
+
+        List<ModelProperty> modelProperties = new ArrayList<ModelProperty>();
+        XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
+        Uri uri = new Uri( baseUri );
+        String tagName = baseUri;
+        String tagValue = null;
+
+        int depth = 0;
+        XMLStreamReader xmlStreamReader = null;
+        try
+        {
+            xmlStreamReader = xmlInputFactory.createXMLStreamReader( inputStream );
+            Map<String, String> attributes = new HashMap<String, String>();
+            for ( ; ; xmlStreamReader.next() )
+            {
+                int type = xmlStreamReader.getEventType();
+                switch ( type )
+                {
+
+                    case XMLStreamConstants.CHARACTERS:
+                    {
+                        String tmp = xmlStreamReader.getText();
+                        if ( tmp != null && tmp.trim().length() != 0 )
+                        {
+                            tagValue = tmp;
+                        }
+                        break;
+                    }
+
+                    case XMLStreamConstants.START_ELEMENT:
+                    {
+                        depth++;
+                        if ( !tagName.equals( baseUri ) )
+                        {
+                            modelProperties.add( new ModelProperty( tagName, tagValue ) );
+                            if ( !attributes.isEmpty() )
+                            {
+                                for ( Map.Entry<String, String> e : attributes.entrySet() )
+                                {
+                                    modelProperties.add( new ModelProperty( e.getKey(), e.getValue() ) );
+                                }
+                                attributes.clear();
+                            }
+                        }
+
+                        tagName = uri.getUriFor( xmlStreamReader.getName().getLocalPart(), depth );
+                        if ( collections.contains( tagName + "#collection" ) )
+                        {
+                            tagName = tagName + "#collection";
+                            uri.addTag( xmlStreamReader.getName().getLocalPart() + "#collection" );
+                        }
+                        else
+                        {
+                            uri.addTag( xmlStreamReader.getName().getLocalPart() );
+                        }
+                        tagValue = null;
+
+                    }
+                    case XMLStreamConstants.ATTRIBUTE:
+                    {
+                        for ( int i = 0; i < xmlStreamReader.getAttributeCount(); i++ )
+                        {
+
+                            attributes.put(
+                                tagName + "#property/" + xmlStreamReader.getAttributeName( i ).getLocalPart(),
+                                xmlStreamReader.getAttributeValue( i ) );
+                        }
+                        break;
+                    }
+                    case XMLStreamConstants.END_ELEMENT:
+                    {
+                        depth--;
+                        if ( tagValue == null )
+                        {
+                            tagValue = "";
+                        }
+                        break;
+                    }
+                    case XMLStreamConstants.END_DOCUMENT:
+                    {
+                        modelProperties.add( new ModelProperty( tagName, tagValue ) );
+                        if ( !attributes.isEmpty() )
+                        {
+                            for ( Map.Entry<String, String> e : attributes.entrySet() )
+                            {
+                                modelProperties.add( new ModelProperty( e.getKey(), e.getValue() ) );
+                            }
+                            attributes.clear();
+                        }
+                        return modelProperties;
+                    }
+                }
+            }
+        }
+        catch ( XMLStreamException e )
+        {
+            throw new IOException( ":" + e.toString() );
+        }
+        finally
+        {
+            if ( xmlStreamReader != null )
+            {
+                try
+                {
+                    xmlStreamReader.close();
+                }
+                catch ( XMLStreamException e )
+                {
+                    e.printStackTrace();
+                }
+            }
+            try
+            {
+                inputStream.close();
+            }
+            catch ( IOException e )
+            {
+
+            }
+        }
+    }
+
+    /**
+     * Returns XML string unmarshalled from the specified list of model properties
+     *
+     * @param modelProperties the model properties to unmarshal. May not be null or empty
+     * @param baseUri         the base uri of every model property. May not be null or empty.
+     * @return XML string unmarshalled from the specified list of model properties
+     * @throws IOException if there was a problem with unmarshalling
+     */
+    public static String unmarshalModelPropertiesToXml( List<ModelProperty> modelProperties, String baseUri )
+        throws IOException
+    {
+        if ( modelProperties == null || modelProperties.isEmpty() )
+        {
+            throw new IllegalArgumentException( "modelProperties: null or empty" );
+        }
+
+        if ( baseUri == null || baseUri.trim().length() == 0 )
+        {
+            throw new IllegalArgumentException( "baseUri: null or empty" );
+        }
+
+        final int basePosition = baseUri.length();
+
+        StringBuffer sb = new StringBuffer();
+        List<String> lastUriTags = new ArrayList<String>();
+        int n = 1;
+        for ( ModelProperty mp : modelProperties )
+        {
+            String uri = mp.getUri();
+            if ( uri.contains( "#property" ) )
+            {
+                continue;
+            }
+            //String val = (mp.getValue() != null) ? "\"" + mp.getValue() + "\"" : null;
+            //   System.out.println("new ModelProperty(\"" + mp.getUri() +"\" , " + val +"),");
+            if ( !uri.startsWith( baseUri ) )
+            {
+                throw new IllegalArgumentException(
+                    "Passed in model property that does not match baseUri: Property URI = " + uri + ", Base URI = " +
+                        baseUri );
+            }
+            List<String> tagNames = getTagNamesFromUri( basePosition, uri );
+            if ( lastUriTags.size() > tagNames.size() )
+            {
+                for ( int i = lastUriTags.size() - 1; i >= tagNames.size(); i-- )
+                {
+                    sb.append( toEndTag( lastUriTags.get( i - 1 ) ) );
+                }
+            }
+            String tag = tagNames.get( tagNames.size() - 1 );
+
+            ModelProperty attribute = null;
+            int peekIndex = modelProperties.indexOf( mp ) + 1;
+            if ( peekIndex <= modelProperties.size() - 1 )
+            {
+                ModelProperty peekProperty = modelProperties.get( peekIndex );
+                if ( peekProperty.getUri().contains( "#property" ) )
+                {
+                    attribute = peekProperty;
+                }
+            }
+
+            sb.append( toStartTag( tag, attribute ) );
+            if ( mp.getResolvedValue() != null )
+            {
+                sb.append( mp.getResolvedValue() );
+                sb.append( toEndTag( tag ) );
+                n = 2;
+            }
+            else
+            {
+                n = 1;
+            }
+            lastUriTags = tagNames;
+        }
+        for ( int i = lastUriTags.size() - n; i >= 1; i-- )
+        {
+            sb.append( toEndTag( lastUriTags.get( i ) ) );
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Returns list of tag names parsed from the specified uri. All #collection parts of the tag are removed from the
+     * tag names.
+     *
+     * @param basePosition the base position in the specified URI to start the parse
+     * @param uri          the uri to parse for tag names
+     * @return list of tag names parsed from the specified uri
+     */
+    private static List<String> getTagNamesFromUri( int basePosition, String uri )
+    {
+        return Arrays.asList( uri.substring( basePosition ).replaceAll( "#collection", "" ).split( "/" ) );
+    }
+
+    /**
+     * Returns the XML formatted start tag for the specified value and the specified attribute.
+     *
+     * @param value     the value to use for the start tag
+     * @param attribute the attribute to use in constructing of start tag
+     * @return the XML formatted start tag for the specified value and the specified attribute
+     */
+    private static String toStartTag( String value, ModelProperty attribute )
+    {
+        StringBuffer sb = new StringBuffer(); //TODO: Support more than one attribute
+        sb.append( "\r\n<" ).append( value );
+        if ( attribute != null )
+        {
+            sb.append( " " ).append(
+                attribute.getUri().substring( attribute.getUri().indexOf( "#property/" ) + 10 ) ).append( "=\"" )
+                .append( attribute.getValue() ).append( "\" " );
+        }
+        sb.append( ">" );
+        return sb.toString();
+    }
+
+    /**
+     * Returns XML formatted end tag for the specified value.
+     *
+     * @param value the value to use for the end tag
+     * @return xml formatted end tag for the specified value
+     */
+    private static String toEndTag( String value )
+    {
+        if ( value.trim().length() == 0 )
+        {
+            return "";
+        }
+        StringBuffer sb = new StringBuffer();
+        sb.append( "</" ).append( value ).append( ">" );
+        return sb.toString();
+    }
+
+    /**
+     * Class for storing information about URIs.
+     */
+    private static class Uri
+    {
+
+        List<String> uris;
+
+        Uri( String baseUri )
+        {
+            uris = new LinkedList<String>();
+            uris.add( baseUri );
+        }
+
+        String getUriFor( String tag, int depth )
+        {
+            setUrisToDepth( depth );
+            StringBuffer sb = new StringBuffer();
+            for ( String tagName : uris )
+            {
+                sb.append( tagName ).append( "/" );
+            }
+            sb.append( tag );
+            return sb.toString();
+        }
+
+        void addTag( String tag )
+        {
+            uris.add( tag );
+        }
+
+        void setUrisToDepth( int depth )
+        {
+            uris = new LinkedList<String>( uris.subList( 0, depth ) );
+        }
+    }
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelMarshaller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelProperty.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelProperty.java?rev=679701&r1=679700&r2=679701&view=diff
==============================================================================
--- maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelProperty.java (original)
+++ maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelProperty.java Fri Jul 25 01:28:22 2008
@@ -1,224 +1,224 @@
-package org.apache.maven.shared.model;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Maps a URI to a string value, which may be null. This class is immutable.
- */
-public final class ModelProperty
-{
-
-    /**
-     * A pattern used for finding pom, project and env properties
-     */
-    private static final Pattern EXPRESSION_PATTERN = Pattern.compile( "\\$\\{(pom\\.|project\\.|env\\.)?([^}]+)\\}" );
-
-    /**
-     * URI of the resource
-     */
-    private final String uri;
-
-    /**
-     * Value associated with the uri
-     */
-    private final String value;
-
-    /**
-     * The count of '/' within this model property's uri, which is the depth of its XML nodes.
-     */
-    private final int depth;
-
-    /**
-     * Value of this model property after interpolation
-     */
-    private String resolvedValue;
-
-    /**
-     * List of unresolved expressions within this model property's value
-     */
-    private final List<String> unresolvedExpressions;
-
-    /**
-     * Constructor
-     *
-     * @param uri   URI of the resource. May not be null
-     * @param value Value associated with specified uri. Value may be null if uri does not map to primitive type.
-     */
-    public ModelProperty( String uri, String value )
-    {
-        if ( uri == null )
-        {
-            throw new IllegalArgumentException( "uri" );
-        }
-        this.uri = uri;
-        this.value = value;
-        resolvedValue = value;
-
-        unresolvedExpressions = new ArrayList<String>();
-        if ( value != null )
-        {
-            Matcher matcher = EXPRESSION_PATTERN.matcher( value );
-            while ( matcher.find() )
-            {
-                unresolvedExpressions.add( matcher.group( 0 ) );
-            }
-        }
-        depth = uri.split( "/" ).length;
-    }
-
-    /**
-     * Returns URI key
-     *
-     * @return URI key
-     */
-    public String getUri()
-    {
-        return uri;
-    }
-
-    /**
-     * Returns value for the URI key. Value may be null.
-     *
-     * @return value for the URI key. Value may be null
-     */
-    public String getValue()
-    {
-        return value;
-    }
-
-    /**
-     * Value of this model property after interpolation.
-     *
-     * @return value of this model property after interpolation
-     */
-    public String getResolvedValue()
-    {
-        return resolvedValue;
-    }
-
-    /**
-     * Returns true if model property is completely interpolated, otherwise returns false.
-     *
-     * @return true if model property is completely interpolated, otherwise returns false
-     */
-    public boolean isResolved()
-    {
-        return unresolvedExpressions.isEmpty();
-    }
-
-    /**
-     * Returns copy of the uninterpolated model property
-     *
-     * @return copy of the uninterpolated model property
-     */
-    public ModelProperty createCopyOfOriginal()
-    {
-        return new ModelProperty( uri, value );
-    }
-
-    /**
-     * Returns the count of '/' within this model property's uri, which is the depth of its XML nodes.
-     *
-     * @return the count of '/' within this model property's uri, which is the depth of its XML nodes
-     */
-    public int getDepth()
-    {
-        return depth;
-    }
-
-    /**
-     * Returns true if this model property is a direct parent of the specified model property, otherwise returns false.
-     *
-     * @param modelProperty the model property
-     * @return true if this model property is a direct parent of the specified model property, otherwise returns false
-     */
-    public boolean isParentOf( ModelProperty modelProperty )
-    {
-        if ( Math.abs( depth - modelProperty.getDepth() ) > 1 )
-        {
-            return false;
-        }
-        if ( uri.equals( modelProperty.getUri() ) || uri.startsWith( modelProperty.getUri() ) )
-        {
-            return false;
-        }
-        return ( modelProperty.getUri().startsWith( uri ) );
-    }
-
-    /**
-     * Returns this model property as an interpolator property, allowing the interpolation of model elements within
-     * other model elements.
-     *
-     * @param baseUri the base uri of the model property
-     * @return this model property as an interpolator property, allowing the interpolation of model elements within
-     *         other model elements
-     */
-    public InterpolatorProperty asInterpolatorProperty( String baseUri )
-    {
-        if ( uri.contains( "#collection" ) || value == null )
-        {
-            return null;
-        }
-        String key = "${" + uri.replace( baseUri + "/", "" ).replace( "/", "." ) + "}";
-        return new InterpolatorProperty( key, value );
-    }
-
-    /**
-     * Resolves any unresolved model property expressions using the specified interpolator property
-     *
-     * @param property the interpolator property used to resolve
-     */
-    public void resolveWith( InterpolatorProperty property )
-    {
-        if ( property == null )
-        {
-            throw new IllegalArgumentException( "property: null" );
-        }
-        if ( isResolved() )
-        {
-            return;
-        }
-        for ( String expression : unresolvedExpressions )
-        {
-            if ( property.getKey().equals( expression ) )
-            {
-                resolvedValue = resolvedValue.replace( property.getKey(), property.getValue() );
-                unresolvedExpressions.clear();
-                Matcher matcher = EXPRESSION_PATTERN.matcher( resolvedValue );
-                while ( matcher.find() )
-                {
-                    unresolvedExpressions.add( matcher.group( 0 ) );
-                }
-                break;
-            }
-        }
-    }
-
-    public String toString()
-    {
-        return "Uri = " + uri + ", Value = " + value + ", Resolved Value = " + resolvedValue + ", Hash = " +
-            this.hashCode();
-    }
-}
+package org.apache.maven.shared.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Maps a URI to a string value, which may be null. This class is immutable.
+ */
+public final class ModelProperty
+{
+
+    /**
+     * A pattern used for finding pom, project and env properties
+     */
+    private static final Pattern EXPRESSION_PATTERN = Pattern.compile( "\\$\\{(pom\\.|project\\.|env\\.)?([^}]+)\\}" );
+
+    /**
+     * URI of the resource
+     */
+    private final String uri;
+
+    /**
+     * Value associated with the uri
+     */
+    private final String value;
+
+    /**
+     * The count of '/' within this model property's uri, which is the depth of its XML nodes.
+     */
+    private final int depth;
+
+    /**
+     * Value of this model property after interpolation
+     */
+    private String resolvedValue;
+
+    /**
+     * List of unresolved expressions within this model property's value
+     */
+    private final List<String> unresolvedExpressions;
+
+    /**
+     * Constructor
+     *
+     * @param uri   URI of the resource. May not be null
+     * @param value Value associated with specified uri. Value may be null if uri does not map to primitive type.
+     */
+    public ModelProperty( String uri, String value )
+    {
+        if ( uri == null )
+        {
+            throw new IllegalArgumentException( "uri" );
+        }
+        this.uri = uri;
+        this.value = value;
+        resolvedValue = value;
+
+        unresolvedExpressions = new ArrayList<String>();
+        if ( value != null )
+        {
+            Matcher matcher = EXPRESSION_PATTERN.matcher( value );
+            while ( matcher.find() )
+            {
+                unresolvedExpressions.add( matcher.group( 0 ) );
+            }
+        }
+        depth = uri.split( "/" ).length;
+    }
+
+    /**
+     * Returns URI key
+     *
+     * @return URI key
+     */
+    public String getUri()
+    {
+        return uri;
+    }
+
+    /**
+     * Returns value for the URI key. Value may be null.
+     *
+     * @return value for the URI key. Value may be null
+     */
+    public String getValue()
+    {
+        return value;
+    }
+
+    /**
+     * Value of this model property after interpolation.
+     *
+     * @return value of this model property after interpolation
+     */
+    public String getResolvedValue()
+    {
+        return resolvedValue;
+    }
+
+    /**
+     * Returns true if model property is completely interpolated, otherwise returns false.
+     *
+     * @return true if model property is completely interpolated, otherwise returns false
+     */
+    public boolean isResolved()
+    {
+        return unresolvedExpressions.isEmpty();
+    }
+
+    /**
+     * Returns copy of the uninterpolated model property
+     *
+     * @return copy of the uninterpolated model property
+     */
+    public ModelProperty createCopyOfOriginal()
+    {
+        return new ModelProperty( uri, value );
+    }
+
+    /**
+     * Returns the count of '/' within this model property's uri, which is the depth of its XML nodes.
+     *
+     * @return the count of '/' within this model property's uri, which is the depth of its XML nodes
+     */
+    public int getDepth()
+    {
+        return depth;
+    }
+
+    /**
+     * Returns true if this model property is a direct parent of the specified model property, otherwise returns false.
+     *
+     * @param modelProperty the model property
+     * @return true if this model property is a direct parent of the specified model property, otherwise returns false
+     */
+    public boolean isParentOf( ModelProperty modelProperty )
+    {
+        if ( Math.abs( depth - modelProperty.getDepth() ) > 1 )
+        {
+            return false;
+        }
+        if ( uri.equals( modelProperty.getUri() ) || uri.startsWith( modelProperty.getUri() ) )
+        {
+            return false;
+        }
+        return ( modelProperty.getUri().startsWith( uri ) );
+    }
+
+    /**
+     * Returns this model property as an interpolator property, allowing the interpolation of model elements within
+     * other model elements.
+     *
+     * @param baseUri the base uri of the model property
+     * @return this model property as an interpolator property, allowing the interpolation of model elements within
+     *         other model elements
+     */
+    public InterpolatorProperty asInterpolatorProperty( String baseUri )
+    {
+        if ( uri.contains( "#collection" ) || value == null )
+        {
+            return null;
+        }
+        String key = "${" + uri.replace( baseUri + "/", "" ).replace( "/", "." ) + "}";
+        return new InterpolatorProperty( key, value );
+    }
+
+    /**
+     * Resolves any unresolved model property expressions using the specified interpolator property
+     *
+     * @param property the interpolator property used to resolve
+     */
+    public void resolveWith( InterpolatorProperty property )
+    {
+        if ( property == null )
+        {
+            throw new IllegalArgumentException( "property: null" );
+        }
+        if ( isResolved() )
+        {
+            return;
+        }
+        for ( String expression : unresolvedExpressions )
+        {
+            if ( property.getKey().equals( expression ) )
+            {
+                resolvedValue = resolvedValue.replace( property.getKey(), property.getValue() );
+                unresolvedExpressions.clear();
+                Matcher matcher = EXPRESSION_PATTERN.matcher( resolvedValue );
+                while ( matcher.find() )
+                {
+                    unresolvedExpressions.add( matcher.group( 0 ) );
+                }
+                break;
+            }
+        }
+    }
+
+    public String toString()
+    {
+        return "Uri = " + uri + ", Value = " + value + ", Resolved Value = " + resolvedValue + ", Hash = " +
+            this.hashCode();
+    }
+}

Propchange: maven/shared/trunk/maven-shared-model/src/main/java/org/apache/maven/shared/model/ModelProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native