Package org.apache.maven.enforcer.rules
Class ExternalRules
- java.lang.Object
-
- org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
-
- org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleConfigProvider
-
- org.apache.maven.enforcer.rules.ExternalRules
-
- All Implemented Interfaces:
EnforcerRuleBase
@Named("externalRules") public final class ExternalRules extends AbstractEnforcerRuleConfigProviderAn enforcer rule that will provide rules configuration from an external resource.- Since:
- 3.2.0
-
-
Field Summary
Fields Modifier and Type Field Description private ExpressionEvaluatorevaluatorprivate java.lang.StringlocationThe external rules location.private static java.lang.StringLOCATION_PREFIX_CLASSPATHprivate org.apache.maven.plugin.MojoExecutionmojoExecution
-
Constructor Summary
Constructors Constructor Description ExternalRules(org.apache.maven.plugin.MojoExecution mojoExecution, ExpressionEvaluator evaluator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.codehaus.plexus.util.xml.Xpp3DomgetRulesConfig()Produce rule configuration.private java.io.InputStreamresolveDescriptor()voidsetLocation(java.lang.String location)java.lang.StringtoString()-
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLog
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.maven.enforcer.rule.api.EnforcerRuleBase
getLevel
-
-
-
-
Field Detail
-
LOCATION_PREFIX_CLASSPATH
private static final java.lang.String LOCATION_PREFIX_CLASSPATH
- See Also:
- Constant Field Values
-
location
private java.lang.String location
The external rules location. If it starts with "classpath:", the resource is read from the classpath. Otherwise, it is handled as a filesystem path, either absolute, or relative to${project.basedir}
-
mojoExecution
private final org.apache.maven.plugin.MojoExecution mojoExecution
-
evaluator
private final ExpressionEvaluator evaluator
-
-
Constructor Detail
-
ExternalRules
@Inject public ExternalRules(org.apache.maven.plugin.MojoExecution mojoExecution, ExpressionEvaluator evaluator)
-
-
Method Detail
-
setLocation
public void setLocation(java.lang.String location)
-
getRulesConfig
public org.codehaus.plexus.util.xml.Xpp3Dom getRulesConfig() throws EnforcerRuleErrorDescription copied from class:AbstractEnforcerRuleConfigProviderProduce rule configuration.Returned configuration must contain rules configuration as in example:
<rules> <ruleName/> <ruleName> <ruleConfig>config value</ruleConfig> </ruleName> </rules>- Specified by:
getRulesConfigin classAbstractEnforcerRuleConfigProvider- Returns:
- a rules configuration
- Throws:
EnforcerRuleError- the error during executing
-
resolveDescriptor
private java.io.InputStream resolveDescriptor() throws EnforcerRuleError- Throws:
EnforcerRuleError
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-