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
Modifier and TypeClassDescriptionstatic class
Builder class used to create Parameter instances. -
Constructor Summary
ModifierConstructorDescriptionprotected
Parameter
(Parameter.Builder builder) Constructor for this class, to be called from its subclasses andParameter.Builder
. -
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.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.static Parameter.Builder
Creates a newParameter
builder instance.static Parameter.Builder
newBuilder
(boolean withDefaults) Creates a newParameter
builder instance using default values or not.static Parameter.Builder
newBuilder
(Parameter from) Creates a newParameter
builder instance using the specified object as a basis.static Parameter.Builder
newBuilder
(Parameter from, boolean forceCopy) Creates a newParameter
builder instance using the specified object as a basis.static Parameter
Creates a newParameter
instance.static Parameter
newInstance
(boolean withDefaults) Creates a newParameter
instance using default values or not.with()
Creates a new builder with this object as the basis.Creates a newParameter
instance using the specified alias.withDefaultValue
(String defaultValue) Creates a newParameter
instance using the specified defaultValue.withDeprecated
(String deprecated) Creates a newParameter
instance using the specified deprecated.withDescription
(String description) Creates a newParameter
instance using the specified description.withEditable
(boolean editable) Creates a newParameter
instance using the specified editable.withExpression
(String expression) Creates a newParameter
instance using the specified expression.Creates a newParameter
instance using the specified name.withRequired
(boolean required) Creates a newParameter
instance using the specified required.Creates a newParameter
instance using the specified since.Creates a newParameter
instance using the specified type.
-
Constructor Details
-
Parameter
Constructor for this class, to be called from its subclasses andParameter.Builder
.- See Also:
-
-
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 newParameter
instance using the specified name.- Parameters:
name
- the newString
to use- Returns:
- a
Parameter
with the specified name
-
withAlias
Creates a newParameter
instance using the specified alias.- Parameters:
alias
- the newString
to use- Returns:
- a
Parameter
with the specified alias
-
withType
Creates a newParameter
instance using the specified type.- Parameters:
type
- the newString
to use- Returns:
- a
Parameter
with the specified type
-
withRequired
Creates a newParameter
instance using the specified required.- Parameters:
required
- the newboolean
to use- Returns:
- a
Parameter
with the specified required
-
withEditable
Creates a newParameter
instance using the specified editable.- Parameters:
editable
- the newboolean
to use- Returns:
- a
Parameter
with the specified editable
-
withDescription
Creates a newParameter
instance using the specified description.- Parameters:
description
- the newString
to use- Returns:
- a
Parameter
with the specified description
-
withSince
Creates a newParameter
instance using the specified since.- Parameters:
since
- the newString
to use- Returns:
- a
Parameter
with the specified since
-
withDeprecated
Creates a newParameter
instance using the specified deprecated.- Parameters:
deprecated
- the newString
to use- Returns:
- a
Parameter
with the specified deprecated
-
withExpression
Creates a newParameter
instance using the specified expression.- Parameters:
expression
- the newString
to use- Returns:
- a
Parameter
with the specified expression
-
withDefaultValue
Creates a newParameter
instance using the specified defaultValue.- Parameters:
defaultValue
- the newString
to use- Returns:
- a
Parameter
with the specified defaultValue
-
newInstance
Creates a newParameter
instance. Equivalent tonewInstance(true)
.- Returns:
- a new
Parameter
- See Also:
-
newInstance
Creates a newParameter
instance 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 newParameter
builder instance. Equivalent tonewBuilder(true)
.- Returns:
- a new
Builder
- See Also:
-
newBuilder
Creates a newParameter
builder instance using default values or not.- Parameters:
withDefaults
- the boolean indicating whether default values should be used- Returns:
- a new
Builder
-
newBuilder
Creates a newParameter
builder instance using the specified object as a basis. Equivalent tonewBuilder(from, false)
.- Parameters:
from
- theParameter
instance to use as a basis- Returns:
- a new
Builder
-
newBuilder
Creates a newParameter
builder instance using the specified object as a basis.- Parameters:
from
- theParameter
instance to use as a basisforceCopy
- the boolean indicating if a copy should be forced- Returns:
- a new
Builder
-