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 Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class used to create Parameter instances. -
Method Summary
Modifier 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
-
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
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
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
The description of this parameter's use inside the Mojo.- Returns:
- a
String
-
getSince
Specify the version when the parameter was added to the API. Similar to Javadoc since.- Returns:
- a
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
Parameter expression, to let user override default value with a user property, system property or project property.- Returns:
- a
String
-
getDefaultValue
The default value, as an expression that will be evaluated at injection or run-time.- Returns:
- a
String
-
with
Creates a new builder with this object as the basis.- Returns:
- a
Builder
-
withName
Creates a newParameterinstance using the specified name.- Parameters:
name- the newStringto use- Returns:
- a
Parameterwith the specified name
-
withAlias
Creates a newParameterinstance using the specified alias.- Parameters:
alias- the newStringto use- Returns:
- a
Parameterwith the specified alias
-
withType
Creates a newParameterinstance using the specified type.- Parameters:
type- the newStringto use- Returns:
- a
Parameterwith the specified type
-
withRequired
Creates a newParameterinstance using the specified required.- Parameters:
required- the newbooleanto use- Returns:
- a
Parameterwith the specified required
-
withEditable
Creates a newParameterinstance using the specified editable.- Parameters:
editable- the newbooleanto use- Returns:
- a
Parameterwith the specified editable
-
withDescription
Creates a newParameterinstance using the specified description.- Parameters:
description- the newStringto use- Returns:
- a
Parameterwith the specified description
-
withSince
Creates a newParameterinstance using the specified since.- Parameters:
since- the newStringto use- Returns:
- a
Parameterwith the specified since
-
withDeprecated
Creates a newParameterinstance using the specified deprecated.- Parameters:
deprecated- the newStringto use- Returns:
- a
Parameterwith the specified deprecated
-
withExpression
Creates a newParameterinstance using the specified expression.- Parameters:
expression- the newStringto use- Returns:
- a
Parameterwith the specified expression
-
withDefaultValue
Creates a newParameterinstance using the specified defaultValue.- Parameters:
defaultValue- the newStringto use- Returns:
- a
Parameterwith the specified defaultValue
-
newInstance
Creates a newParameterinstance. Equivalent tonewInstance(true).- Returns:
- a new
Parameter - See Also:
-
newInstance
Creates 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
-
newBuilder
Creates a newParameterbuilder instance. Equivalent tonewBuilder(true).- Returns:
- a new
Builder - See Also:
-
newBuilder
Creates a newParameterbuilder instance using default values or not.- Parameters:
withDefaults- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newParameterbuilder instance using the specified object as a basis. Equivalent tonewBuilder(from, false).- Parameters:
from- theParameterinstance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newParameterbuilder instance using the specified object as a basis.- Parameters:
from- theParameterinstance to use as a basisforceCopy- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-