Class Parameter

java.lang.Object
org.apache.maven.api.plugin.descriptor.Parameter
All Implemented Interfaces:
Serializable

@Experimental @Generated @ThreadSafe @Immutable public class Parameter extends Object implements Serializable
A parameter description.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder class used to create Parameter instances.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final String
    Specifies an alias which can be used to configure this parameter from the POM.
    (package private) final String
    The default value, as an expression that will be evaluated at injection or run-time.
    (package private) final String
    Description with the reason of parameter deprecation.
    (package private) final String
    The description of this parameter's use inside the Mojo.
    (package private) final boolean
    Specifies that this parameter can be configured directly by the user (as in the case of POM-specified configuration).
    (package private) final String
    Parameter expression, to let user override default value with a user property, system property or project property.
    (package private) final String
    The name of the parameter, to be used while configuring this parameter from the Mojo's declared defaults or from the POM.
    (package private) final boolean
    Whether this parameter is required for the Mojo to function.
    (package private) final String
    Specify the version when the parameter was added to the API.
    (package private) final String
    The Java type for this parameter.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor for this class, to be called from its subclasses and Parameter.Builder.
  • Method Summary

    Modifier and Type
    Method
    Description
    Specifies an alias which can be used to configure this parameter from the POM.
    The default value, as an expression that will be evaluated at injection or run-time.
    Description with the reason of parameter deprecation.
    The description of this parameter's use inside the Mojo.
    Parameter expression, to let user override default value with a user property, system property or project property.
    The name of the parameter, to be used while configuring this parameter from the Mojo's declared defaults or from the POM.
    Specify the version when the parameter was added to the API.
    The Java type for this parameter.
    boolean
    Specifies that this parameter can be configured directly by the user (as in the case of POM-specified configuration).
    boolean
    Whether this parameter is required for the Mojo to function.
    Creates a new Parameter builder instance.
    newBuilder(boolean withDefaults)
    Creates a new Parameter builder instance using default values or not.
    Creates a new Parameter builder instance using the specified object as a basis.
    newBuilder(Parameter from, boolean forceCopy)
    Creates a new Parameter builder instance using the specified object as a basis.
    static Parameter
    Creates a new Parameter instance.
    static Parameter
    newInstance(boolean withDefaults)
    Creates a new Parameter instance using default values or not.
    Creates a new builder with this object as the basis.
    Creates a new Parameter instance using the specified alias.
    withDefaultValue(String defaultValue)
    Creates a new Parameter instance using the specified defaultValue.
    withDeprecated(String deprecated)
    Creates a new Parameter instance using the specified deprecated.
    withDescription(String description)
    Creates a new Parameter instance using the specified description.
    withEditable(boolean editable)
    Creates a new Parameter instance using the specified editable.
    withExpression(String expression)
    Creates a new Parameter instance using the specified expression.
    Creates a new Parameter instance using the specified name.
    withRequired(boolean required)
    Creates a new Parameter instance using the specified required.
    Creates a new Parameter instance using the specified since.
    Creates a new Parameter instance using the specified type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      final String name
      The name of the parameter, to be used while configuring this parameter from the Mojo's declared defaults or from the POM.
    • alias

      final String alias
      Specifies an alias which can be used to configure this parameter from the POM. This is primarily useful to improve user-friendliness, where Mojo field names are not intuitive to the user or are otherwise not conducive to configuration via the POM.
    • type

      final String type
      The Java type for this parameter. This is used to validate the result of any expressions used to calculate the value which should be injected into the Mojo for this parameter.
    • required

      final boolean required
      Whether this parameter is required for the Mojo to function. This is used to validate the configuration for a Mojo before it is injected, and before the Mojo is executed from some half-state.
    • editable

      final boolean editable
      Specifies that this parameter can be configured directly by the user (as in the case of POM-specified configuration). This is useful when you want to force the user to use common POM elements rather than plugin configurations, as in the case where you want to use the artifact's final name as a parameter. In this case, you want the user to modify <build><finalName/></build> rather than specifying a value for finalName directly in the plugin configuration section. It is also useful to ensure that - for example - a List-typed parameter which expects items of type Artifact doesn't get a List full of Strings.
    • description

      final String description
      The description of this parameter's use inside the Mojo.
    • since

      final String since
      Specify the version when the parameter was added to the API. Similar to Javadoc since.
    • deprecated

      final String deprecated
      Description with the reason of parameter deprecation. Similar to Javadoc @deprecated. This will trigger a warning when a user tries to configure a parameter marked as deprecated.
    • expression

      final String expression
      Parameter expression, to let user override default value with a user property, system property or project property.
    • defaultValue

      final String defaultValue
      The default value, as an expression that will be evaluated at injection or run-time.
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      The name of the parameter, to be used while configuring this parameter from the Mojo's declared defaults or from the POM.
      Returns:
      a String
    • getAlias

      public String getAlias()
      Specifies an alias which can be used to configure this parameter from the POM. This is primarily useful to improve user-friendliness, where Mojo field names are not intuitive to the user or are otherwise not conducive to configuration via the POM.
      Returns:
      a String
    • getType

      public String getType()
      The Java type for this parameter. This is used to validate the result of any expressions used to calculate the value which should be injected into the Mojo for this parameter.
      Returns:
      a String
    • isRequired

      public boolean isRequired()
      Whether this parameter is required for the Mojo to function. This is used to validate the configuration for a Mojo before it is injected, and before the Mojo is executed from some half-state.
      Returns:
      a boolean
    • isEditable

      public boolean isEditable()
      Specifies that this parameter can be configured directly by the user (as in the case of POM-specified configuration). This is useful when you want to force the user to use common POM elements rather than plugin configurations, as in the case where you want to use the artifact's final name as a parameter. In this case, you want the user to modify <build><finalName/></build> rather than specifying a value for finalName directly in the plugin configuration section. It is also useful to ensure that - for example - a List-typed parameter which expects items of type Artifact doesn't get a List full of Strings.
      Returns:
      a boolean
    • getDescription

      public String getDescription()
      The description of this parameter's use inside the Mojo.
      Returns:
      a String
    • getSince

      public String getSince()
      Specify the version when the parameter was added to the API. Similar to Javadoc since.
      Returns:
      a String
    • getDeprecated

      public String getDeprecated()
      Description with the reason of parameter deprecation. Similar to Javadoc @deprecated. This will trigger a warning when a user tries to configure a parameter marked as deprecated.
      Returns:
      a String
    • getExpression

      public String getExpression()
      Parameter expression, to let user override default value with a user property, system property or project property.
      Returns:
      a String
    • getDefaultValue

      public String getDefaultValue()
      The default value, as an expression that will be evaluated at injection or run-time.
      Returns:
      a String
    • with

      @Nonnull public Parameter.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withName

      @Nonnull public Parameter withName(String name)
      Creates a new Parameter instance using the specified name.
      Parameters:
      name - the new String to use
      Returns:
      a Parameter with the specified name
    • withAlias

      @Nonnull public Parameter withAlias(String alias)
      Creates a new Parameter instance using the specified alias.
      Parameters:
      alias - the new String to use
      Returns:
      a Parameter with the specified alias
    • withType

      @Nonnull public Parameter withType(String type)
      Creates a new Parameter instance using the specified type.
      Parameters:
      type - the new String to use
      Returns:
      a Parameter with the specified type
    • withRequired

      @Nonnull public Parameter withRequired(boolean required)
      Creates a new Parameter instance using the specified required.
      Parameters:
      required - the new boolean to use
      Returns:
      a Parameter with the specified required
    • withEditable

      @Nonnull public Parameter withEditable(boolean editable)
      Creates a new Parameter instance using the specified editable.
      Parameters:
      editable - the new boolean to use
      Returns:
      a Parameter with the specified editable
    • withDescription

      @Nonnull public Parameter withDescription(String description)
      Creates a new Parameter instance using the specified description.
      Parameters:
      description - the new String to use
      Returns:
      a Parameter with the specified description
    • withSince

      @Nonnull public Parameter withSince(String since)
      Creates a new Parameter instance using the specified since.
      Parameters:
      since - the new String to use
      Returns:
      a Parameter with the specified since
    • withDeprecated

      @Nonnull public Parameter withDeprecated(String deprecated)
      Creates a new Parameter instance using the specified deprecated.
      Parameters:
      deprecated - the new String to use
      Returns:
      a Parameter with the specified deprecated
    • withExpression

      @Nonnull public Parameter withExpression(String expression)
      Creates a new Parameter instance using the specified expression.
      Parameters:
      expression - the new String to use
      Returns:
      a Parameter with the specified expression
    • withDefaultValue

      @Nonnull public Parameter withDefaultValue(String defaultValue)
      Creates a new Parameter instance using the specified defaultValue.
      Parameters:
      defaultValue - the new String to use
      Returns:
      a Parameter with the specified defaultValue
    • newInstance

      @Nonnull public static Parameter newInstance()
      Creates a new Parameter instance. Equivalent to newInstance(true).
      Returns:
      a new Parameter
      See Also:
    • newInstance

      @Nonnull public static Parameter newInstance(boolean withDefaults)
      Creates a new Parameter instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Parameter
    • newBuilder

      @Nonnull public static Parameter.Builder newBuilder()
      Creates a new Parameter builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static Parameter.Builder newBuilder(boolean withDefaults)
      Creates a new Parameter builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Parameter.Builder newBuilder(Parameter from)
      Creates a new Parameter builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Parameter instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Parameter.Builder newBuilder(Parameter from, boolean forceCopy)
      Creates a new Parameter builder instance using the specified object as a basis.
      Parameters:
      from - the Parameter instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder