Package pl.project13.maven.git
Class ReplacementProperty
java.lang.Object
pl.project13.maven.git.ReplacementProperty
This class represents a specific property replacement the user wants to perform. For a use-case
refer to https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/317.
- Since:
- 2.2.3
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor.ReplacementProperty(String property, String propertyOutputSuffix, String token, String value, boolean regex, boolean forceValueEvaluation, List<TransformationRule> transformationRules) Constructs a specific property replacement the user wants to perform. -
Method Summary
Modifier and TypeMethodDescriptionThe source (input) property on which the replacements should be performed.The property output suffix where the replacement result should be stored in.getToken()The replacement token acts asneedlethat will be searched in the input property.The list of transformation-rules that should be applied during replacement.getValue()The value that acts as the text to be written over any found tokens.booleanIndicator if the plugin forces to evaluate the given value on every project.booleanisRegex()Indicator if the replacement will be performed with regular expressions.voidsetForceValueEvaluation(boolean forceValueEvaluation) Sets Indicator if the plugin forces to evaluate the given value on every project.voidsetProperty(String property) Set the source (input) property on which the replacements should be performed (e.g.voidsetPropertyOutputSuffix(String propertyOutputSuffix) Set the property output suffix where the replacement result should be stored in (e.g.voidsetRegex(boolean regex) Sets Indicator if the replacement will be performed with regular expressions (true) or, if a replacement with java's string.replace-function is performed (false).voidSet the replacement token.voidsetTransformationRules(List<TransformationRule> transformationRules) Sets the list of transformation-rules that should be applied during replacement.voidSets the value that acts as the text to be written over any found tokens ("replacement").
-
Constructor Details
-
ReplacementProperty
public ReplacementProperty()Empty constructor. -
ReplacementProperty
public ReplacementProperty(String property, String propertyOutputSuffix, String token, String value, boolean regex, boolean forceValueEvaluation, List<TransformationRule> transformationRules) Constructs a specific property replacement the user wants to perform.- Parameters:
property- The source (input) property on which the replacements should be performed (e.g.git.branch)propertyOutputSuffix- The property output suffix where the replacement result should be stored in (e.g.git.branch-no-slashes)token- The replacement token acts asneedlethat will be searched in the input property (e.g.^([^\/]*)\/([^\/]*)$)value- The value acts as the text to be written over any found tokens ("replacement").regex- Iftruethe replacement will be performed with regular expressions or, iffalseperforms a replacement with java's string.replace-function.forceValueEvaluation- Iftrueforces the plugin to evaluate the given value on *every* project. This might come handy if *every* project needs a unique value and a user wants to project specific variables likeproject.artifactId.transformationRules- The list of transformation-rules that should be applied during replacement.
-
-
Method Details
-
getProperty
The source (input) property on which the replacements should be performed.- Returns:
- The source (input) property on which the replacements should be performed (e.g.
git.branch)
-
setProperty
Set the source (input) property on which the replacements should be performed (e.g.git.branch)- Parameters:
property- The source (input) property
-
getPropertyOutputSuffix
The property output suffix where the replacement result should be stored in.- Returns:
- The property output suffix where the replacement result should be stored in (e.g.
git.branch-no-slashes)
-
setPropertyOutputSuffix
Set the property output suffix where the replacement result should be stored in (e.g.git.branch-no-slashes)- Parameters:
propertyOutputSuffix- The property output suffix
-
getToken
The replacement token acts asneedlethat will be searched in the input property.- Returns:
- The replacement token acts as
needlethat will be searched in the input property (e.g.^([^\/]*)\/([^\/]*)$)
-
setToken
Set the replacement token.- Parameters:
token- The replacement token
-
getValue
The value that acts as the text to be written over any found tokens.- Returns:
- The value that acts as the text to be written over any found tokens ("replacement").
-
setValue
Sets the value that acts as the text to be written over any found tokens ("replacement").- Parameters:
value- The replacment value
-
isRegex
public boolean isRegex()Indicator if the replacement will be performed with regular expressions.- Returns:
- Indicator if the replacement will be performed with regular expressions (
true) or, if a replacement with java's string.replace-function is performed (false).
-
setRegex
public void setRegex(boolean regex) Sets Indicator if the replacement will be performed with regular expressions (true) or, if a replacement with java's string.replace-function is performed (false).- Parameters:
regex- Indicator
-
isForceValueEvaluation
public boolean isForceValueEvaluation()Indicator if the plugin forces to evaluate the given value on every project.- Returns:
- Indicator if the plugin forces to evaluate the given value on every project.
-
setForceValueEvaluation
public void setForceValueEvaluation(boolean forceValueEvaluation) Sets Indicator if the plugin forces to evaluate the given value on every project.- Parameters:
forceValueEvaluation- Indicator if the plugin forces to evaluate the given value on every project (true).
-
getTransformationRules
The list of transformation-rules that should be applied during replacement.- Returns:
- The list of transformation-rules that should be applied during replacement.
-
setTransformationRules
Sets the list of transformation-rules that should be applied during replacement.- Parameters:
transformationRules- The list of transformation-rules
-