public final class PropertyUsageRule extends Object implements org.apache.maven.enforcer.rule.api.EnforcerRule
| Constructor and Description |
|---|
PropertyUsageRule() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper) |
String |
getCacheId()
If your rule is cacheable, you must return a unique id
when parameters or conditions change that would cause
the result to be different.
|
Collection<String> |
getDefinitions() |
Map<String,Set<PropertyDefinition>> |
getPropertiesDefined() |
Map<String,Integer> |
getPropertiesDefinedMoreThanOnce() |
Set<com.github.mikkoi.maven.plugins.enforcer.rule.propertyusage.UsageFiles.UsageLocation> |
getPropertiesNotDefined() |
Set<String> |
getPropertiesNotUsed()
Getters for results, used for testing.
|
String |
getReplaceInTemplateWithPropertyName() |
Collection<String> |
getTemplates() |
Collection<String> |
getUsages() |
boolean |
isCacheable()
This tells the system if the results are cacheable at
all.
|
boolean |
isDefinedPropertiesAreUsed() |
boolean |
isDefinitionsOnlyOnce() |
boolean |
isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule arg0)
If the rule is cacheable and the same id is found in the cache,
the stored results are passed to this method to allow double
checking of the results.
|
boolean |
isUsedPropertiesAreDefined() |
void |
setDefinedPropertiesAreUsed(boolean definedPropertiesAreUsed) |
void |
setDefinitions(Collection<String> definitions)
Setters for the parameters
(these are not used by Maven Enforcer, used for testing).
|
void |
setDefinitionsOnlyOnce(boolean definitionsOnlyOnce) |
void |
setReplaceInTemplateWithPropertyName(String replaceInTemplateWithPropertyName) |
void |
setTemplates(Collection<String> templates) |
void |
setUsages(Collection<String> usages) |
void |
setUsedPropertiesAreDefined(boolean usedPropertiesAreDefined) |
public void execute(@Nonnull org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper) throws org.apache.maven.enforcer.rule.api.EnforcerRuleException
execute in interface org.apache.maven.enforcer.rule.api.EnforcerRulehelper - EnforcerRuleHelperorg.apache.maven.enforcer.rule.api.EnforcerRuleException - Throws when error@Nullable public String getCacheId()
The easiest way to do this is to return a hash computed from the values of your parameters.
If your rule is not cacheable, then the result here is not important, you may return anything.
getCacheId in interface org.apache.maven.enforcer.rule.api.EnforcerRulepublic boolean isCacheable()
isCacheable in interface org.apache.maven.enforcer.rule.api.EnforcerRulepublic boolean isResultValid(@Nullable org.apache.maven.enforcer.rule.api.EnforcerRule arg0)
isResultValid in interface org.apache.maven.enforcer.rule.api.EnforcerRulearg0 - EnforcerRule@Nonnull public Set<String> getPropertiesNotUsed()
@Nonnull public Set<com.github.mikkoi.maven.plugins.enforcer.rule.propertyusage.UsageFiles.UsageLocation> getPropertiesNotDefined()
@Nonnull public Map<String,Integer> getPropertiesDefinedMoreThanOnce()
@Nonnull public Map<String,Set<PropertyDefinition>> getPropertiesDefined()
public boolean isDefinedPropertiesAreUsed()
public void setDefinedPropertiesAreUsed(boolean definedPropertiesAreUsed)
public boolean isUsedPropertiesAreDefined()
public void setUsedPropertiesAreDefined(boolean usedPropertiesAreDefined)
public boolean isDefinitionsOnlyOnce()
public void setDefinitionsOnlyOnce(boolean definitionsOnlyOnce)
public void setReplaceInTemplateWithPropertyName(@Nonnull String replaceInTemplateWithPropertyName)
@Nonnull public Collection<String> getDefinitions()
public void setDefinitions(@Nonnull Collection<String> definitions)
@Nonnull public Collection<String> getTemplates()
public void setTemplates(@Nonnull Collection<String> templates)
@Nonnull public Collection<String> getUsages()
public void setUsages(@Nonnull Collection<String> usages)
Copyright © 2016–2018 Private. All rights reserved.