org.semver.enforcer
Class CheckVersionRule

java.lang.Object
  extended by org.semver.enforcer.CheckVersionRule
All Implemented Interfaces:
org.apache.maven.enforcer.rule.api.EnforcerRule

public class CheckVersionRule
extends java.lang.Object
implements org.apache.maven.enforcer.rule.api.EnforcerRule

Checks Version for current Artifact compared to a previous Artifact.
Fails if Version semantic is not respected.


Field Summary
protected  java.lang.String[] excludes
          Class names to be excluded.
protected  java.lang.String[] includes
          Class names to be included.
protected  java.lang.String previousVersion
          Version number of artifact to be checked.
 
Constructor Summary
CheckVersionRule()
           
 
Method Summary
 void execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper)
           
protected  java.util.Set<java.lang.String> extractFilters(java.lang.String[] filtersAsStringArray)
           
 java.lang.String getCacheId()
           
 boolean isCacheable()
           
 boolean isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule cachedRule)
           
protected  void validateArtifact(org.apache.maven.artifact.Artifact artifact)
          Validates that specified Artifact is a JAR file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

previousVersion

protected java.lang.String previousVersion
Version number of artifact to be checked.


includes

protected java.lang.String[] includes
Class names to be included.


excludes

protected java.lang.String[] excludes
Class names to be excluded.

Constructor Detail

CheckVersionRule

public CheckVersionRule()
Method Detail

extractFilters

protected final java.util.Set<java.lang.String> extractFilters(java.lang.String[] filtersAsStringArray)

execute

public void execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper)
             throws org.apache.maven.enforcer.rule.api.EnforcerRuleException
Specified by:
execute in interface org.apache.maven.enforcer.rule.api.EnforcerRule
Throws:
org.apache.maven.enforcer.rule.api.EnforcerRuleException

validateArtifact

protected final void validateArtifact(org.apache.maven.artifact.Artifact artifact)
Validates that specified Artifact is a JAR file.

Parameters:
artifact -

isCacheable

public boolean isCacheable()
Specified by:
isCacheable in interface org.apache.maven.enforcer.rule.api.EnforcerRule

isResultValid

public boolean isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule cachedRule)
Specified by:
isResultValid in interface org.apache.maven.enforcer.rule.api.EnforcerRule

getCacheId

public java.lang.String getCacheId()
Specified by:
getCacheId in interface org.apache.maven.enforcer.rule.api.EnforcerRule


Copyright © 2010. All Rights Reserved.