Package org.apache.maven.configuration
Class DefaultBeanConfigurationRequest
- java.lang.Object
-
- org.apache.maven.configuration.DefaultBeanConfigurationRequest
-
- All Implemented Interfaces:
BeanConfigurationRequest
public class DefaultBeanConfigurationRequest extends Object implements BeanConfigurationRequest
A basic bean configuration request.- Author:
- Benjamin Bentmann
-
-
Constructor Summary
Constructors Constructor Description DefaultBeanConfigurationRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getBean()
Gets the bean to configure.ClassLoader
getClassLoader()
Gets the class loader from which to load any types referenced by the configuration.Object
getConfiguration()
Gets the configuration to unmarshal into the bean.String
getConfigurationElement()
Returns configuration element name ornull
.BeanConfigurationPathTranslator
getPathTranslator()
Gets the optional path translator for configuration values unmarshalled to files.BeanConfigurationValuePreprocessor
getValuePreprocessor()
Gets the optional preprocessor for configuration values.DefaultBeanConfigurationRequest
setBean(Object bean)
Sets the bean to configure.DefaultBeanConfigurationRequest
setClassLoader(ClassLoader classLoader)
Sets the class loader from which to load any types referenced by the configuration.DefaultBeanConfigurationRequest
setConfiguration(Object configuration)
Sets the configuration to unmarshal into the bean.DefaultBeanConfigurationRequest
setConfiguration(Object configuration, String element)
Sets the configuration to unmarshal into the bean.DefaultBeanConfigurationRequest
setConfiguration(Model model, String pluginGroupId, String pluginArtifactId, String pluginExecutionId)
Sets the configuration to the configuration taken from the specified build plugin in the POM.DefaultBeanConfigurationRequest
setPathTranslator(BeanConfigurationPathTranslator pathTranslator)
Sets the optional path translator for configuration values unmarshalled to files.DefaultBeanConfigurationRequest
setValuePreprocessor(BeanConfigurationValuePreprocessor valuePreprocessor)
Sets the optional preprocessor for configuration values.
-
-
-
Method Detail
-
getBean
public Object getBean()
Description copied from interface:BeanConfigurationRequest
Gets the bean to configure. Eventually, a valid request must have a bean set.- Specified by:
getBean
in interfaceBeanConfigurationRequest
- Returns:
- The bean to configure, or
null
if none.
-
setBean
public DefaultBeanConfigurationRequest setBean(Object bean)
Description copied from interface:BeanConfigurationRequest
Sets the bean to configure. Eventually, a valid request must have a bean set.- Specified by:
setBean
in interfaceBeanConfigurationRequest
- Parameters:
bean
- The bean to configure, may benull
.- Returns:
- This request for chaining, never
null
.
-
getConfiguration
public Object getConfiguration()
Description copied from interface:BeanConfigurationRequest
Gets the configuration to unmarshal into the bean.- Specified by:
getConfiguration
in interfaceBeanConfigurationRequest
- Returns:
- The configuration to unmarshal into the bean or
null
if none.
-
getConfigurationElement
public String getConfigurationElement()
Description copied from interface:BeanConfigurationRequest
Returns configuration element name ornull
.- Specified by:
getConfigurationElement
in interfaceBeanConfigurationRequest
- Returns:
- Configuration element name or
null
- See Also:
BeanConfigurationRequest.setConfiguration(Object, String)
-
setConfiguration
public DefaultBeanConfigurationRequest setConfiguration(Object configuration)
Description copied from interface:BeanConfigurationRequest
Sets the configuration to unmarshal into the bean. The configuration should be taken fromConfigurationContainer.getConfiguration()
or a similar source. Fully equivalent tosetConfiguration(configuration, null)
.- Specified by:
setConfiguration
in interfaceBeanConfigurationRequest
- Parameters:
configuration
- The configuration to unmarshal, may benull
.- Returns:
- This request for chaining, never
null
.
-
setConfiguration
public DefaultBeanConfigurationRequest setConfiguration(Object configuration, String element)
Description copied from interface:BeanConfigurationRequest
Sets the configuration to unmarshal into the bean. The configuration should be taken fromConfigurationContainer.getConfiguration()
or a similar source. Ifelement
is notnull
, child configuration element with the specified name will be unmarshaled.- Specified by:
setConfiguration
in interfaceBeanConfigurationRequest
- Parameters:
configuration
- The configuration to unmarshal, may benull
.element
- Configuration element name to unmarshal ornull
to unmarshal entire configuration.- Returns:
- This request for chaining, never
null
.
-
setConfiguration
public DefaultBeanConfigurationRequest setConfiguration(Model model, String pluginGroupId, String pluginArtifactId, String pluginExecutionId)
Sets the configuration to the configuration taken from the specified build plugin in the POM. First, the build plugins will be searched for the specified plugin, if that fails, the plugin management section will be searched.- Parameters:
model
- The POM to extract the plugin configuration from, may benull
.pluginGroupId
- The group id of the plugin whose configuration should be used, must not benull
or empty.pluginArtifactId
- The artifact id of the plugin whose configuration should be used, must not benull
or empty.pluginExecutionId
- The id of a plugin execution whose configuration should be used, may benull
or empty to use the general plugin configuration.- Returns:
- This request for chaining, never
null
.
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from interface:BeanConfigurationRequest
Gets the class loader from which to load any types referenced by the configuration. If unset, the class loader of the bean class will be used.- Specified by:
getClassLoader
in interfaceBeanConfigurationRequest
- Returns:
- The class loader to load referenced types from or
null
if unset.
-
setClassLoader
public DefaultBeanConfigurationRequest setClassLoader(ClassLoader classLoader)
Description copied from interface:BeanConfigurationRequest
Sets the class loader from which to load any types referenced by the configuration. If unset, the class loader of the bean class will be used.- Specified by:
setClassLoader
in interfaceBeanConfigurationRequest
- Parameters:
classLoader
- The class loader to load referenced types from, may benull
.- Returns:
- This request for chaining, never
null
.
-
getValuePreprocessor
public BeanConfigurationValuePreprocessor getValuePreprocessor()
Description copied from interface:BeanConfigurationRequest
Gets the optional preprocessor for configuration values.- Specified by:
getValuePreprocessor
in interfaceBeanConfigurationRequest
- Returns:
- The preprocessor for configuration values or
null
if none.
-
setValuePreprocessor
public DefaultBeanConfigurationRequest setValuePreprocessor(BeanConfigurationValuePreprocessor valuePreprocessor)
Description copied from interface:BeanConfigurationRequest
Sets the optional preprocessor for configuration values.- Specified by:
setValuePreprocessor
in interfaceBeanConfigurationRequest
- Parameters:
valuePreprocessor
- The preprocessor for configuration values, may benull
if unneeded.- Returns:
- This request for chaining, never
null
.
-
getPathTranslator
public BeanConfigurationPathTranslator getPathTranslator()
Description copied from interface:BeanConfigurationRequest
Gets the optional path translator for configuration values unmarshalled to files.- Specified by:
getPathTranslator
in interfaceBeanConfigurationRequest
- Returns:
- The path translator for files or
null
if none.
-
setPathTranslator
public DefaultBeanConfigurationRequest setPathTranslator(BeanConfigurationPathTranslator pathTranslator)
Description copied from interface:BeanConfigurationRequest
Sets the optional path translator for configuration values unmarshalled to files.- Specified by:
setPathTranslator
in interfaceBeanConfigurationRequest
- Parameters:
pathTranslator
- The path translator for files, may benull
if unneeded.- Returns:
- This request for chaining, never
null
.
-
-