You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/05/24 07:44:45 UTC

svn commit: r541187 - in /maven/components/trunk/maven-settings/src/main: java/org/apache/maven/settings/MavenSettingsBuilder.java java/org/apache/maven/settings/RuntimeInfo.java java/org/apache/maven/settings/SettingsUtils.java mdo/settings.mdo

Author: vsiveton
Date: Wed May 23 22:44:44 2007
New Revision: 541187

URL: http://svn.apache.org/viewvc?view=rev&rev=541187
Log:
merged 541186 from branch (MNG-2461: Write JavaDoc documentation)

Modified:
    maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java
    maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java
    maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java
    maven/components/trunk/maven-settings/src/main/mdo/settings.mdo

Modified: maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java?view=diff&rev=541187&r1=541186&r2=541187
==============================================================================
--- maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java (original)
+++ maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java Wed May 23 22:44:44 2007
@@ -25,6 +25,12 @@
 import java.io.IOException;
 
 /**
+ * Builder for the user or global settings. By default, the settings files are located:
+ * <ul>
+ * <li>user settings: ${user.home}/settings.xml</li>
+ * <li>global settings: ${maven.home}/conf/settings.xml</li>
+ * </ul>
+ *
  * @author jdcasey
  * @version $Id$
  */
@@ -33,6 +39,12 @@
     String ROLE = MavenSettingsBuilder.class.getName();
 
     /**
+     *
+     * @param userSettingsFile
+     * @param globalSettingsFile
+     * @return a <code>Settings</code> object from the user and global settings file.
+     * @throws IOException if any
+     * @throws XmlPullParserException if any
      * @since 2.1
      */
     Settings buildSettings( File userSettingsFile, File globalSettingsFile )

Modified: maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java?view=diff&rev=541187&r1=541186&r2=541187
==============================================================================
--- maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java (original)
+++ maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java Wed May 23 22:44:44 2007
@@ -24,74 +24,107 @@
 import java.util.List;
 import java.util.Map;
 
+/**
+ * To handle runtime informations like local repository or profiles.
+ *
+ * @version $Id$
+ */
 public class RuntimeInfo
 {
-
     private List locations = new ArrayList();
-    
+
     // using Boolean for 3VL (null for not-set, otherwise override with value)
     private Boolean pluginUpdateForced;
-    
+
     // using Boolean for 3VL (null, true-to-all, false-to-all)
     private Boolean applyToAllPluginUpdates;
-    
+
 //    private boolean pluginRegistryActive = true;
-    
+
     // using Boolean for 3VL (null for not-set, otherwise override with value)
 //    private Boolean checkLatest;
-    
+
     private Map activeProfileToSourceLevel = new HashMap();
-    
+
     private String localRepositorySourceLevel = TrackableBase.USER_LEVEL;
-    
+
     private Map pluginGroupIdSourceLevels = new HashMap();
-    
+
     private final Settings settings;
 
+    /**
+     * @param settings
+     */
     public RuntimeInfo( Settings settings )
     {
         this.settings = settings;
     }
-    
+
+    /**
+     * @param path
+     */
     public void addLocation( String path )
     {
         this.locations.add( path );
     }
-    
+
+    /**
+     * @return
+     */
     public List getLocations()
     {
         return locations;
     }
-    
+
+    /**
+     * @param pluginUpdateForced
+     */
     public void setPluginUpdateOverride( Boolean pluginUpdateForced )
     {
         this.pluginUpdateForced = pluginUpdateForced;
     }
-    
+
+    /**
+     * @return
+     */
     public Boolean getPluginUpdateOverride()
     {
         return pluginUpdateForced;
     }
 
+    /**
+     * @return
+     */
     public Boolean getApplyToAllPluginUpdates()
     {
         return applyToAllPluginUpdates;
     }
 
+    /**
+     * @param applyToAll
+     */
     public void setApplyToAllPluginUpdates( Boolean applyToAll )
     {
         this.applyToAllPluginUpdates = applyToAll;
     }
-    
+
+    /**
+     * @param activeProfile
+     * @param sourceLevel
+     */
     public void setActiveProfileSourceLevel( String activeProfile, String sourceLevel )
     {
         activeProfileToSourceLevel.put( activeProfile, sourceLevel );
     }
-    
+
+    /**
+     * @param activeProfile
+     * @return
+     */
     public String getSourceLevelForActiveProfile( String activeProfile )
     {
         String sourceLevel = (String) activeProfileToSourceLevel.get( activeProfile );
-        
+
         if ( sourceLevel != null )
         {
             return sourceLevel;
@@ -101,16 +134,24 @@
             return settings.getSourceLevel();
         }
     }
-    
+
+    /**
+     * @param pluginGroupId
+     * @param sourceLevel
+     */
     public void setPluginGroupIdSourceLevel( String pluginGroupId, String sourceLevel )
     {
         pluginGroupIdSourceLevels.put( pluginGroupId, sourceLevel );
     }
-    
+
+    /**
+     * @param pluginGroupId
+     * @return
+     */
     public String getSourceLevelForPluginGroupId( String pluginGroupId )
     {
         String sourceLevel = (String) pluginGroupIdSourceLevels.get( pluginGroupId );
-        
+
         if ( sourceLevel != null )
         {
             return sourceLevel;
@@ -120,15 +161,20 @@
             return settings.getSourceLevel();
         }
     }
-    
+
+    /**
+     * @param localRepoSourceLevel
+     */
     public void setLocalRepositorySourceLevel( String localRepoSourceLevel )
     {
         this.localRepositorySourceLevel = localRepoSourceLevel;
     }
-    
+
+    /**
+     * @return
+     */
     public String getLocalRepositorySourceLevel()
     {
         return localRepositorySourceLevel;
     }
-
 }

Modified: maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java?view=diff&rev=541187&r1=541186&r2=541187
==============================================================================
--- maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java (original)
+++ maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java Wed May 23 22:44:44 2007
@@ -28,6 +28,12 @@
 import java.util.List;
 import java.util.Map;
 
+/**
+ * Several convenience methods to handle settings
+ *
+ * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
+ * @version $Id$
+ */
 public final class SettingsUtils
 {
     private SettingsUtils()
@@ -35,6 +41,11 @@
         // don't allow construction.
     }
 
+    /**
+     * @param dominant
+     * @param recessive
+     * @param recessiveSourceLevel
+     */
     public static void merge( Settings dominant, Settings recessive, String recessiveSourceLevel )
     {
         if ( dominant == null || recessive == null )
@@ -70,14 +81,14 @@
                 }
             }
         }
-        
+
         if ( dominant.getRuntimeInfo() != null && recessive.getRuntimeInfo() != null )
         {
             List recessiveLocations = recessive.getRuntimeInfo().getLocations();
             for ( Iterator it = recessiveLocations.iterator(); it.hasNext(); )
             {
                 String path = (String) it.next();
-                
+
                 dominant.getRuntimeInfo().addLocation( path );
             }
         }
@@ -126,6 +137,11 @@
 
     }
 
+    /**
+     * @param dominant
+     * @param recessive
+     * @param recessiveSourceLevel
+     */
     private static void shallowMergeById( List dominant, List recessive, String recessiveSourceLevel )
     {
         Map dominantById = mapById( dominant );
@@ -143,6 +159,10 @@
         }
     }
 
+    /**
+     * @param identifiables
+     * @return a map
+     */
     private static Map mapById( List identifiables )
     {
         Map byId = new HashMap();
@@ -157,6 +177,10 @@
         return byId;
     }
 
+    /**
+     * @param settingsProfile
+     * @return a profile
+     */
     public static org.apache.maven.model.Profile convertFromSettingsProfile( Profile settingsProfile )
     {
         org.apache.maven.model.Profile profile = new org.apache.maven.model.Profile();
@@ -239,6 +263,10 @@
         return profile;
     }
 
+    /**
+     * @param settingsRepo
+     * @return a repository
+     */
     private static org.apache.maven.model.Repository convertFromSettingsRepository( Repository settingsRepo )
     {
         org.apache.maven.model.Repository repo = new org.apache.maven.model.Repository();
@@ -260,6 +288,10 @@
         return repo;
     }
 
+    /**
+     * @param settingsPolicy
+     * @return a RepositoryPolicy
+     */
     private static org.apache.maven.model.RepositoryPolicy convertRepositoryPolicy( RepositoryPolicy settingsPolicy )
     {
         org.apache.maven.model.RepositoryPolicy policy = new org.apache.maven.model.RepositoryPolicy();
@@ -268,5 +300,4 @@
         policy.setChecksumPolicy( settingsPolicy.getChecksumPolicy() );
         return policy;
     }
-
 }

Modified: maven/components/trunk/maven-settings/src/main/mdo/settings.mdo
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-settings/src/main/mdo/settings.mdo?view=diff&rev=541187&r1=541186&r2=541187
==============================================================================
--- maven/components/trunk/maven-settings/src/main/mdo/settings.mdo (original)
+++ maven/components/trunk/maven-settings/src/main/mdo/settings.mdo Wed May 23 22:44:44 2007
@@ -89,6 +89,10 @@
       <name>IdentifiableBase</name>
       <superClass>TrackableBase</superClass>
       <version>1.0.0</version>
+      <description>
+        <![CDATA[
+        Base class for <code>Mirror</code>, <code>Profile</code>, <code>Proxy</code> and <code>Server</code>.
+        ]]></description>
       <fields>
         <field>
           <name>id</name>
@@ -272,11 +276,17 @@
 
     private Proxy activeProxy;
 
+    /**
+     * Reset the <code>activeProxy</code> field to <code>null</code>
+     */
     public void flushActiveProxy()
     {
         this.activeProxy = null;
     }
 
+    /**
+     * @return the first active proxy
+     */
     public synchronized Proxy getActiveProxy()
     {
         if(activeProxy == null)
@@ -351,11 +361,18 @@
 
     private java.util.Map profileMap;
 
+    /**
+     * Reset the <code>profileMap</code> field to <code>null</code>
+     */
     public void flushProfileMap()
     {
         this.profileMap = null;
     }
 
+    /**
+     * @return a Map of profiles field with <code>Profile#getId()</code> as key
+     * @see org.apache.maven.settings.Profile#getId()
+     */
     public java.util.Map getProfilesAsMap()
     {
         if ( profileMap == null )
@@ -428,6 +445,10 @@
       <name>Proxy</name>
       <version>1.0.0</version>
       <superClass>IdentifiableBase</superClass>
+      <description>
+        <![CDATA[
+        The <code>&lt;proxy&gt;</code> element contains informations required to a proxy settings.
+        ]]></description>
       <fields>
         <field>
           <name>active</name>
@@ -510,6 +531,10 @@
       <name>Server</name>
       <version>1.0.0</version>
       <superClass>IdentifiableBase</superClass>
+      <description>
+        <![CDATA[
+        The <code>&lt;server&gt;</code> element contains informations required to a server settings.
+        ]]></description>
       <fields>
         <field>
           <name>username</name>
@@ -847,19 +872,22 @@
           <version>1.0.0</version>
           <code>
             <![CDATA[
-            public boolean equals( Object obj )
-            {
-                RepositoryBase other =  (RepositoryBase) obj;
+    /**
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj )
+    {
+        RepositoryBase other =  (RepositoryBase) obj;
 
-                boolean retValue = false;
+        boolean retValue = false;
 
-                if ( id != null )
-                {
-                    retValue = id.equals( other.id );
-                }
+        if ( id != null )
+        {
+            retValue = id.equals( other.id );
+        }
 
-                return retValue;
-            }
+        return retValue;
+    }
             ]]>
           </code>
         </codeSegment>
@@ -902,10 +930,13 @@
           <version>1.0.0</version>
           <code>
             <![CDATA[
-            public boolean equals( Object obj )
-            {
-                return super.equals( obj );
-            }
+    /**
+     * @see org.apache.maven.settings.RepositoryBase#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj )
+    {
+        return super.equals( obj );
+    }
             ]]>
           </code>
         </codeSegment>
@@ -942,7 +973,7 @@
           <version>1.0.0</version>
           <description>
             What to do when verification of an artifact checksum fails -
-            warn, fail, etc. Valid values are "fail" or "warn"
+            warn, fail, etc. Valid values are "fail" or "warn".
           </description>
           <type>String</type>
         </field>
@@ -966,7 +997,7 @@
           <type>String</type>
           <required>true</required>
           <description>
-            The name of the property to be used to activate a profile
+            The name of the property to be used to activate a profile.
           </description>
         </field>
         <field>
@@ -974,7 +1005,7 @@
           <version>1.0.0</version>
           <type>String</type>
           <description>
-            The value of the property to be used to activate a profile
+            The value of the property to be used to activate a profile.
           </description>
         </field>
       </fields>
@@ -994,7 +1025,7 @@
           <version>1.0.0</version>
           <type>String</type>
           <description>
-            The name of the OS to be used to activate a profile
+            The name of the OS to be used to activate a profile.
           </description>
         </field>
         <field>
@@ -1011,7 +1042,7 @@
           <version>1.0.0</version>
           <type>String</type>
           <description>
-            The architecture of the OS to be used to activate a profile
+            The architecture of the OS to be used to activate a profile.
           </description>
         </field>
         <field>
@@ -1019,7 +1050,7 @@
           <version>1.0.0</version>
           <type>String</type>
           <description>
-            The version of the OS to be used to activate a profile
+            The version of the OS to be used to activate a profile.
           </description>
         </field>
       </fields>
@@ -1041,7 +1072,7 @@
           <type>String</type>
           <description>
             The name of the file that should be missing to activate a
-            profile
+            profile.
           </description>
         </field>
         <field>
@@ -1049,7 +1080,7 @@
           <version>1.0.0</version>
           <type>String</type>
           <description>
-            The name of the file that should exist to activate a profile
+            The name of the file that should exist to activate a profile.
           </description>
         </field>
       </fields>