Class ReplacementProperty


  • public class ReplacementProperty
    extends java.lang.Object
    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

      Constructors 
      Constructor Description
      ReplacementProperty()
      Empty constructor
      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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getProperty()  
      java.lang.String getPropertyOutputSuffix()  
      java.lang.String getToken()  
      java.util.List<TransformationRule> getTransformationRules()  
      java.lang.String getValue()  
      boolean isForceValueEvaluation()  
      boolean isRegex()  
      void setForceValueEvaluation​(boolean forceValueEvaluation)
      Sets Indicator if the plugin forces to evaluate the given value on *every* project (true).
      void setProperty​(java.lang.String property)
      Set the source (input) property on which the replacements should be performed (e.g.
      void setPropertyOutputSuffix​(java.lang.String propertyOutputSuffix)
      Set the property output suffix where the replacement result should be stored in (e.g.
      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).
      void setToken​(java.lang.String token)
      Set the replacement token
      void setTransformationRules​(java.util.List<TransformationRule> transformationRules)
      Sets the list of transformation-rules that should be applied during replacement.
      void setValue​(java.lang.String value)
      Sets the value that acts as the text to be written over any found tokens ("replacement").
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 as needle that 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 - If true the replacement will be performed with regular expressions or, if false performs a replacement with java's string.replace-function.
        forceValueEvaluation - If true forces 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 like project.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 needle that 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