Class ValidationProperty

java.lang.Object
pl.project13.maven.validation.ValidationProperty

public class ValidationProperty extends Object
Allows to configure a single validation action that shall be performed when running the ValidationMojo. A full configuration may like:

 <validationProperties>
   <validationProperty>
     <name>validating project version</name>
     <value>${project.version}</value>
     <shouldMatchTo><![CDATA[^.*(?<!-SNAPSHOT)$]]></shouldMatchTo>
   </validationProperty>
 </validationProperties>
 
  • Constructor Details

    • ValidationProperty

      public ValidationProperty()
  • Method Details

    • setName

      public void setName(String name)
      Sets a descriptive name that will be used to be able to identify the validation that does not match up (will be displayed in the error message).
      Parameters:
      name - The name that shall be used to identify the validation
    • setValue

      public void setValue(String value)
      Sets the value that needs to be validated.
      Parameters:
      value - The value that needs to be validated.
    • setShouldMatchTo

      public void setShouldMatchTo(String shouldMatchTo)
      Sets the expectation what the given value should match to.
      Parameters:
      shouldMatchTo - The expectation what the given value should match to.
    • getName

      public String getName()
      Returns:
      A descriptive name that will be used to be able to identify the validation that does not match up (will be displayed in the error message).
    • getValue

      public String getValue()
      Returns:
      The value that needs to be validated.
    • getShouldMatchTo

      public String getShouldMatchTo()
      Returns:
      The expectation what the given value should match to.