~ubuntu-branches/debian/stretch/maven-enforcer/stretch

« back to all changes in this revision

Viewing changes to enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-12 22:30:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110912223016-e2pk04avoq8bur7t
Tags: 1.0-1
* Team upload
* New upstream release.
* Add more Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.apache.maven.plugins.enforcer;
 
2
 
1
3
/*
2
4
 * Licensed to the Apache Software Foundation (ASF) under one
3
5
 * or more contributor license agreements.  See the NOTICE file
16
18
 * specific language governing permissions and limitations
17
19
 * under the License.
18
20
 */
19
 
package org.apache.maven.plugins.enforcer;
20
21
 
21
22
import java.util.Iterator;
22
23
 
30
31
import org.apache.maven.plugin.logging.Log;
31
32
import org.codehaus.plexus.util.StringUtils;
32
33
 
33
 
// TODO: Auto-generated Javadoc
34
34
/**
35
35
 * Contains the common code to compare a version against a version range.
36
 
 * 
 
36
 *
37
37
 * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
38
 
 * @version $Id: AbstractVersionEnforcer.java 675992 2008-07-11 15:42:48Z hboutemy $
 
38
 * @version $Id: AbstractVersionEnforcer.java 805190 2009-08-17 22:30:49Z hboutemy $
39
39
 */
40
40
public abstract class AbstractVersionEnforcer
41
41
    extends AbstractStandardEnforcerRule
55
55
 
56
56
    /**
57
57
     * Compares the specified version to see if it is allowed by the defined version range.
58
 
     * 
 
58
     *
59
59
     * @param log the log
60
60
     * @param variableName name of variable to use in messages (Example: "Maven" or "Java" etc).
61
61
     * @param requiredVersionRange range of allowed versions.
114
114
     * Copied from Artifact.VersionRange. This is tweaked to handle singular ranges properly. Currently the default
115
115
     * containsVersion method assumes a singular version means allow everything. This method assumes that "2.0.4" ==
116
116
     * "[2.0.4,)"
117
 
     * 
 
117
     *
118
118
     * @param allowedRange range of allowed versions.
119
119
     * @param theVersion the version to be checked.
120
120
     * @return true if the version is contained by the range.
146
146
 
147
147
    /*
148
148
     * (non-Javadoc)
149
 
     * 
 
149
     *
150
150
     * @see org.apache.maven.enforcer.rule.api.EnforcerRule#getCacheId()
151
151
     */
152
152
    public String getCacheId()
165
165
 
166
166
    /*
167
167
     * (non-Javadoc)
168
 
     * 
 
168
     *
169
169
     * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isCacheable()
170
170
     */
171
171
    public boolean isCacheable()
176
176
 
177
177
    /*
178
178
     * (non-Javadoc)
179
 
     * 
 
179
     *
180
180
     * @see org.apache.maven.enforcer.rule.api.EnforcerRule#isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule)
181
181
     */
182
182
    public boolean isResultValid( EnforcerRule theCachedRule )
188
188
 
189
189
    /**
190
190
     * Gets the required version.
191
 
     * 
 
191
     *
192
192
     * @return the required version
193
193
     */
194
194
    public String getVersion()
198
198
 
199
199
    /**
200
200
     * Sets the required version.
201
 
     * 
 
201
     *
202
202
     * @param theVersion the required version to set
203
203
     */
204
204
    public void setVersion( String theVersion )