Class RequireEncoding
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.codehaus.mojo.extraenforcer.encoding.RequireEncoding
- All Implemented Interfaces:
org.apache.maven.enforcer.rule.api.EnforcerRuleBase
@Named("requireEncoding")
public class RequireEncoding
extends org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
Checks file encodings to see if they match the project.build.sourceEncoding If file encoding can not be determined it
is skipped.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanShould the rule accept US-ASCII as an subset of UTF-8 and ISO-8859-1/-15.private booleanShould the rule accept ISO-8859-1 as a subset of ISO-8859-15.private StringValidate files match this encoding.private StringComma (or pipe) separated list of globs do exclude.private booleanShould the rule fail after the first error or should the errors be aggregated.private StringComma (or pipe) separated list of globs do include.private static final Stringprivate final org.apache.maven.project.MavenProjectprivate booleanEnables SCM files exclusions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()protected StringgetEncoding(File file) org.apache.maven.enforcer.rule.api.EnforcerLoggergetLog()booleanvoidsetEncoding(String encoding) voidsetExcludes(String excludes) voidsetIncludes(String includes) voidsetLog(org.apache.maven.enforcer.rule.api.EnforcerLogger arg0) voidsetUseDefaultExcludes(boolean useDefaultExcludes) Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
getCacheId, getLevel
-
Field Details
-
ISO_8859_15
- See Also:
-
encoding
Validate files match this encoding. If not specified then default to ${project.build.sourceEncoding}. -
includes
Comma (or pipe) separated list of globs do include. -
excludes
Comma (or pipe) separated list of globs do exclude. -
useDefaultExcludes
private boolean useDefaultExcludesEnables SCM files exclusions. Enabled by default. -
failFast
private boolean failFastShould the rule fail after the first error or should the errors be aggregated. -
acceptAsciiSubset
private boolean acceptAsciiSubsetShould the rule accept US-ASCII as an subset of UTF-8 and ISO-8859-1/-15. -
acceptIso8859Subset
private boolean acceptIso8859SubsetShould the rule accept ISO-8859-1 as a subset of ISO-8859-15. -
project
private final org.apache.maven.project.MavenProject project
-
-
Constructor Details
-
RequireEncoding
@Inject public RequireEncoding(org.apache.maven.project.MavenProject project)
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.enforcer.rule.api.EnforcerRuleException- Specified by:
executein classorg.apache.maven.enforcer.rule.api.AbstractEnforcerRule- Throws:
org.apache.maven.enforcer.rule.api.EnforcerRuleException
-
getEncoding
- Throws:
IOException
-
getEncoding
-
setEncoding
-
getIncludes
-
setIncludes
-
getExcludes
-
setExcludes
-
isUseDefaultExcludes
public boolean isUseDefaultExcludes() -
setUseDefaultExcludes
public void setUseDefaultExcludes(boolean useDefaultExcludes) -
setLog
public void setLog(org.apache.maven.enforcer.rule.api.EnforcerLogger arg0) - Specified by:
setLogin interfaceorg.apache.maven.enforcer.rule.api.EnforcerRuleBase
-
getLog
public org.apache.maven.enforcer.rule.api.EnforcerLogger getLog()
-