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:41:34 UTC
svn commit: r541186 - in
/maven/components/branches/maven-2.0.x/maven-settings/src/main:
java/org/apache/maven/settings/ mdo/
Author: vsiveton
Date: Wed May 23 22:41:34 2007
New Revision: 541186
URL: http://svn.apache.org/viewvc?view=rev&rev=541186
Log:
MNG-2461: Write JavaDoc documentation
o added some Javadoc in settings model and java files
o no code change
Modified:
maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java
maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java
maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java
maven/components/branches/maven-2.0.x/maven-settings/src/main/mdo/settings.mdo
Modified: maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java?view=diff&rev=541186&r1=541185&r2=541186
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java (original)
+++ maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/MavenSettingsBuilder.java Wed May 23 22:41:34 2007
@@ -25,26 +25,62 @@
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>
+ *
+ * You could also use system properties to specify the path for user and global settings:
+ * <ul>
+ * <li>user settings is defined by <code>org.apache.maven.user-settings</code></li>
+ * <li>global settings is defined by <code>org.apache.maven.global-settings</code></li>
+ * </ul>
+ *
* @author jdcasey
* @version $Id$
*/
public interface MavenSettingsBuilder
{
String ROLE = MavenSettingsBuilder.class.getName();
-
+
String ALT_USER_SETTINGS_XML_LOCATION = "org.apache.maven.user-settings";
String ALT_GLOBAL_SETTINGS_XML_LOCATION = "org.apache.maven.global-settings";
String ALT_LOCAL_REPOSITORY_LOCATION = "maven.repo.local";
+ /**
+ * @return a <code>Settings</code> object from the user settings file.
+ * @throws IOException if any
+ * @throws XmlPullParserException if any
+ */
Settings buildSettings()
throws IOException, XmlPullParserException;
-
+
+ /**
+ * @param useCachedSettings if true, doesn't reload the user settings
+ * @return a <code>Settings</code> object from the user settings file.
+ * @throws IOException if any
+ * @throws XmlPullParserException if any
+ */
Settings buildSettings( boolean useCachedSettings )
throws IOException, XmlPullParserException;
+ /**
+ * @param userSettingsFile a given user settings file
+ * @return a <code>Settings</code> object from the user settings file.
+ * @throws IOException if any
+ * @throws XmlPullParserException if any
+ */
Settings buildSettings( File userSettingsFile )
throws IOException, XmlPullParserException;
+ /**
+ * @param userSettingsFile a given user settings file
+ * @param useCachedSettings if true, doesn't reload the user settings
+ * @return a <code>Settings</code> object from the user settings file.
+ * @throws IOException if any
+ * @throws XmlPullParserException if any
+ */
Settings buildSettings( File userSettingsFile, boolean useCachedSettings )
throws IOException, XmlPullParserException;
}
Modified: maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java?view=diff&rev=541186&r1=541185&r2=541186
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java (original)
+++ maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/RuntimeInfo.java Wed May 23 22:41:34 2007
@@ -23,74 +23,107 @@
import java.util.HashMap;
import java.util.Map;
+/**
+ * To handle runtime informations like local repository or profiles.
+ *
+ * @version $Id$
+ */
public class RuntimeInfo
{
-
private File file;
-
+
// 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 file
+ */
public void setFile( File file )
{
this.file = file;
}
-
+
+ /**
+ * @return
+ */
public File getFile()
{
return file;
}
-
+
+ /**
+ * @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;
@@ -100,16 +133,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;
@@ -119,15 +160,20 @@
return settings.getSourceLevel();
}
}
-
+
+ /**
+ * @param localRepoSourceLevel
+ */
public void setLocalRepositorySourceLevel( String localRepoSourceLevel )
{
this.localRepositorySourceLevel = localRepoSourceLevel;
}
-
+
+ /**
+ * @return
+ */
public String getLocalRepositorySourceLevel()
{
return localRepositorySourceLevel;
}
-
}
Modified: maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java?view=diff&rev=541186&r1=541185&r2=541186
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java (original)
+++ maven/components/branches/maven-2.0.x/maven-settings/src/main/java/org/apache/maven/settings/SettingsUtils.java Wed May 23 22:41:34 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 )
@@ -103,9 +114,13 @@
shallowMergeById( dominant.getServers(), recessive.getServers(), recessiveSourceLevel );
shallowMergeById( dominant.getProxies(), recessive.getProxies(), recessiveSourceLevel );
shallowMergeById( dominant.getProfiles(), recessive.getProfiles(), recessiveSourceLevel );
-
}
+ /**
+ * @param dominant
+ * @param recessive
+ * @param recessiveSourceLevel
+ */
private static void shallowMergeById( List dominant, List recessive, String recessiveSourceLevel )
{
Map dominantById = mapById( dominant );
@@ -123,6 +138,10 @@
}
}
+ /**
+ * @param identifiables
+ * @return a map
+ */
private static Map mapById( List identifiables )
{
Map byId = new HashMap();
@@ -137,6 +156,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();
@@ -219,6 +242,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();
@@ -240,6 +267,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();
@@ -248,5 +279,4 @@
policy.setChecksumPolicy( settingsPolicy.getChecksumPolicy() );
return policy;
}
-
}
Modified: maven/components/branches/maven-2.0.x/maven-settings/src/main/mdo/settings.mdo
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-settings/src/main/mdo/settings.mdo?view=diff&rev=541186&r1=541185&r2=541186
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-settings/src/main/mdo/settings.mdo (original)
+++ maven/components/branches/maven-2.0.x/maven-settings/src/main/mdo/settings.mdo Wed May 23 22:41:34 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><proxy></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><server></code> element contains informations required to a server settings.
+ ]]></description>
<fields>
<field>
<name>username</name>
@@ -826,19 +851,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>
@@ -881,10 +909,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>
@@ -921,7 +952,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>
@@ -945,7 +976,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>
@@ -953,7 +984,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>
@@ -973,7 +1004,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>
@@ -990,7 +1021,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>
@@ -998,7 +1029,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>
@@ -1020,7 +1051,7 @@
<type>String</type>
<description>
The name of the file that should be missing to activate a
- profile
+ profile.
</description>
</field>
<field>
@@ -1028,7 +1059,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>