Package pl.project13.maven.git
Class ReplacementProperty
- java.lang.Object
-
- pl.project13.maven.git.ReplacementProperty
-
public class ReplacementProperty extends java.lang.ObjectThis 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
Constructors Constructor Description ReplacementProperty()Empty constructorReplacementProperty(java.lang.String property, java.lang.String propertyOutputSuffix, java.lang.String token, java.lang.String value, boolean regex, boolean forceValueEvaluation, java.util.List<TransformationRule> transformationRules)Constructs a specific property replacement the user wants to perform.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetProperty()java.lang.StringgetPropertyOutputSuffix()java.lang.StringgetToken()java.util.List<TransformationRule>getTransformationRules()java.lang.StringgetValue()booleanisForceValueEvaluation()booleanisRegex()voidsetForceValueEvaluation(boolean forceValueEvaluation)Sets Indicator if the plugin forces to evaluate the given value on *every* project (true).voidsetProperty(java.lang.String property)Set the source (input) property on which the replacements should be performed (e.g.voidsetPropertyOutputSuffix(java.lang.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).voidsetToken(java.lang.String token)Set the replacement tokenvoidsetTransformationRules(java.util.List<TransformationRule> transformationRules)Sets the list of transformation-rules that should be applied during replacement.voidsetValue(java.lang.String value)Sets the value that acts as the text to be written over any found tokens ("replacement").
-
-
-
Constructor Detail
-
ReplacementProperty
public ReplacementProperty()
Empty constructor
-
ReplacementProperty
public ReplacementProperty(java.lang.String property, java.lang.String propertyOutputSuffix, java.lang.String token, java.lang.String value, boolean regex, boolean forceValueEvaluation, java.util.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 Detail
-
getProperty
public java.lang.String getProperty()
- Returns:
- The source (input) property on which the replacements should be performed (e.g.
git.branch)
-
setProperty
public void setProperty(java.lang.String property)
Set the source (input) property on which the replacements should be performed (e.g.git.branch)- Parameters:
property- The source (input) property
-
getPropertyOutputSuffix
public java.lang.String getPropertyOutputSuffix()
- Returns:
- The property output suffix where the replacement result should be stored in (e.g.
git.branch-no-slashes)
-
setPropertyOutputSuffix
public void setPropertyOutputSuffix(java.lang.String propertyOutputSuffix)
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
public java.lang.String getToken()
- Returns:
- The replacement token acts as
needlethat will be searched in the input property (e.g.^([^\/]*)\/([^\/]*)$)
-
setToken
public void setToken(java.lang.String token)
Set the replacement token- Parameters:
token- The replacement token
-
getValue
public java.lang.String getValue()
- Returns:
- The value that acts as the text to be written over any found tokens ("replacement").
-
setValue
public void setValue(java.lang.String value)
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()
- 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()
- Returns:
- Indicator if the plugin forces to evaluate the given value on *every* project (
true).
-
setForceValueEvaluation
public void setForceValueEvaluation(boolean forceValueEvaluation)
Sets Indicator if the plugin forces to evaluate the given value on *every* project (true).- Parameters:
forceValueEvaluation- Indicator if the plugin forces to evaluate the given value on *every* project (true).
-
getTransformationRules
public java.util.List<TransformationRule> getTransformationRules()
- Returns:
- The list of transformation-rules that should be applied during replacement.
-
setTransformationRules
public void setTransformationRules(java.util.List<TransformationRule> transformationRules)
Sets the list of transformation-rules that should be applied during replacement.- Parameters:
transformationRules- The list of transformation-rules
-
-