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 phase mapping definition.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Parameter instances.
- 
Method SummaryModifier and TypeMethodDescriptiongetAlias()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.getName()The name of the parameter, to be used while configuring this parameter from the Mojo's declared defaults or from the POM.getSince()Specify the version when the parameter was added to the API.getType()The Java type for this parameter.booleanSpecifies that this parameter can be configured directly by the user (as in the case of POM-specified configuration).booleanWhether this parameter is required for the Mojo to function.static Parameter.BuilderCreates a newParameterbuilder instance.static Parameter.BuildernewBuilder(boolean withDefaults) Creates a newParameterbuilder instance using default values or not.static Parameter.BuildernewBuilder(Parameter from) Creates a newParameterbuilder instance using the specified object as a basis.static Parameter.BuildernewBuilder(Parameter from, boolean forceCopy) Creates a newParameterbuilder instance using the specified object as a basis.static ParameterCreates a newParameterinstance.static ParameternewInstance(boolean withDefaults) Creates a newParameterinstance using default values or not.with()Creates a new builder with this object as the basis.Creates a newParameterinstance using the specified alias.withDefaultValue(String defaultValue) Creates a newParameterinstance using the specified defaultValue.withDeprecated(String deprecated) Creates a newParameterinstance using the specified deprecated.withDescription(String description) Creates a newParameterinstance using the specified description.withEditable(boolean editable) Creates a newParameterinstance using the specified editable.withExpression(String expression) Creates a newParameterinstance using the specified expression.Creates a newParameterinstance using the specified name.withRequired(boolean required) Creates a newParameterinstance using the specified required.Creates a newParameterinstance using the specified since.Creates a newParameterinstance using the specified type.
- 
Method Details- 
getNameThe name of the parameter, to be used while configuring this parameter from the Mojo's declared defaults or from the POM.- Returns:
- a String
 
- 
getAliasSpecifies 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
 
- 
getTypeThe 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
 
- 
isRequiredpublic 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
 
- 
isEditablepublic 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
 
- 
getDescriptionThe description of this parameter's use inside the Mojo.- Returns:
- a String
 
- 
getSinceSpecify the version when the parameter was added to the API. Similar to Javadoc since.- Returns:
- a String
 
- 
getDeprecatedDescription 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
 
- 
getExpressionParameter expression, to let user override default value with a user property, system property or project property.- Returns:
- a String
 
- 
getDefaultValueThe default value, as an expression that will be evaluated at injection or run-time.- Returns:
- a String
 
- 
withCreates a new builder with this object as the basis.- Returns:
- a Builder
 
- 
withNameCreates a newParameterinstance using the specified name.- Parameters:
- name- the new- Stringto use
- Returns:
- a Parameterwith the specified name
 
- 
withAliasCreates a newParameterinstance using the specified alias.- Parameters:
- alias- the new- Stringto use
- Returns:
- a Parameterwith the specified alias
 
- 
withTypeCreates a newParameterinstance using the specified type.- Parameters:
- type- the new- Stringto use
- Returns:
- a Parameterwith the specified type
 
- 
withRequiredCreates a newParameterinstance using the specified required.- Parameters:
- required- the new- booleanto use
- Returns:
- a Parameterwith the specified required
 
- 
withEditableCreates a newParameterinstance using the specified editable.- Parameters:
- editable- the new- booleanto use
- Returns:
- a Parameterwith the specified editable
 
- 
withDescriptionCreates a newParameterinstance using the specified description.- Parameters:
- description- the new- Stringto use
- Returns:
- a Parameterwith the specified description
 
- 
withSinceCreates a newParameterinstance using the specified since.- Parameters:
- since- the new- Stringto use
- Returns:
- a Parameterwith the specified since
 
- 
withDeprecatedCreates a newParameterinstance using the specified deprecated.- Parameters:
- deprecated- the new- Stringto use
- Returns:
- a Parameterwith the specified deprecated
 
- 
withExpressionCreates a newParameterinstance using the specified expression.- Parameters:
- expression- the new- Stringto use
- Returns:
- a Parameterwith the specified expression
 
- 
withDefaultValueCreates a newParameterinstance using the specified defaultValue.- Parameters:
- defaultValue- the new- Stringto use
- Returns:
- a Parameterwith the specified defaultValue
 
- 
newInstanceCreates a newParameterinstance. Equivalent tonewInstance(true).- Returns:
- a new Parameter
- See Also:
 
- 
newInstanceCreates a newParameterinstance using default values or not. Equivalent tonewBuilder(withDefaults).build().- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new Parameter
 
- 
newBuilderCreates a newParameterbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new Builder
- See Also:
 
- 
newBuilderCreates a newParameterbuilder instance using default values or not.- Parameters:
- withDefaults- the boolean indicating whether default values should be used
- Returns:
- a new Builder
 
- 
newBuilderCreates a newParameterbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
- from- the- Parameterinstance to use as a basis
- Returns:
- a new Builder
 
- 
newBuilderCreates a newParameterbuilder instance using the specified object as a basis.- Parameters:
- from- the- Parameterinstance to use as a basis
- forceCopy- the boolean indicating if a copy should be forced
- Returns:
- a new Builder
 
 
-