Package org.apache.maven.configuration
Class DefaultBeanConfigurationRequest
- java.lang.Object
-
- org.apache.maven.configuration.DefaultBeanConfigurationRequest
-
- All Implemented Interfaces:
BeanConfigurationRequest
public class DefaultBeanConfigurationRequest extends java.lang.Object implements BeanConfigurationRequest
A basic bean configuration request.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectbeanprivate java.lang.ClassLoaderclassLoaderprivate java.lang.Objectconfigurationprivate java.lang.StringconfigurationElementprivate BeanConfigurationPathTranslatorpathTranslatorprivate BeanConfigurationValuePreprocessorvaluePreprocessor
-
Constructor Summary
Constructors Constructor Description DefaultBeanConfigurationRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private PluginfindPlugin(Model model, java.lang.String groupId, java.lang.String artifactId)java.lang.ObjectgetBean()Gets the bean to configure.java.lang.ClassLoadergetClassLoader()Gets the class loader from which to load any types referenced by the configuration.java.lang.ObjectgetConfiguration()Gets the configuration to unmarshal into the bean.java.lang.StringgetConfigurationElement()Returns configuration element name ornull.BeanConfigurationPathTranslatorgetPathTranslator()Gets the optional path translator for configuration values unmarshalled to files.BeanConfigurationValuePreprocessorgetValuePreprocessor()Gets the optional preprocessor for configuration values.DefaultBeanConfigurationRequestsetBean(java.lang.Object bean)Sets the bean to configure.DefaultBeanConfigurationRequestsetClassLoader(java.lang.ClassLoader classLoader)Sets the class loader from which to load any types referenced by the configuration.DefaultBeanConfigurationRequestsetConfiguration(java.lang.Object configuration)Sets the configuration to unmarshal into the bean.DefaultBeanConfigurationRequestsetConfiguration(java.lang.Object configuration, java.lang.String element)Sets the configuration to unmarshal into the bean.DefaultBeanConfigurationRequestsetConfiguration(Model model, java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.String pluginExecutionId)Sets the configuration to the configuration taken from the specified build plugin in the POM.DefaultBeanConfigurationRequestsetPathTranslator(BeanConfigurationPathTranslator pathTranslator)Sets the optional path translator for configuration values unmarshalled to files.DefaultBeanConfigurationRequestsetValuePreprocessor(BeanConfigurationValuePreprocessor valuePreprocessor)Sets the optional preprocessor for configuration values.
-
-
-
Field Detail
-
bean
private java.lang.Object bean
-
configuration
private java.lang.Object configuration
-
configurationElement
private java.lang.String configurationElement
-
classLoader
private java.lang.ClassLoader classLoader
-
valuePreprocessor
private BeanConfigurationValuePreprocessor valuePreprocessor
-
pathTranslator
private BeanConfigurationPathTranslator pathTranslator
-
-
Method Detail
-
getBean
public java.lang.Object getBean()
Description copied from interface:BeanConfigurationRequestGets the bean to configure. Eventually, a valid request must have a bean set.- Specified by:
getBeanin interfaceBeanConfigurationRequest- Returns:
- The bean to configure, or
nullif none.
-
setBean
public DefaultBeanConfigurationRequest setBean(java.lang.Object bean)
Description copied from interface:BeanConfigurationRequestSets the bean to configure. Eventually, a valid request must have a bean set.- Specified by:
setBeanin interfaceBeanConfigurationRequest- Parameters:
bean- The bean to configure, may benull.- Returns:
- This request for chaining, never
null.
-
getConfiguration
public java.lang.Object getConfiguration()
Description copied from interface:BeanConfigurationRequestGets the configuration to unmarshal into the bean.- Specified by:
getConfigurationin interfaceBeanConfigurationRequest- Returns:
- The configuration to unmarshal into the bean or
nullif none.
-
getConfigurationElement
public java.lang.String getConfigurationElement()
Description copied from interface:BeanConfigurationRequestReturns configuration element name ornull.- Specified by:
getConfigurationElementin interfaceBeanConfigurationRequest- Returns:
- Configuration element name or
null - See Also:
BeanConfigurationRequest.setConfiguration(Object, String)
-
setConfiguration
public DefaultBeanConfigurationRequest setConfiguration(java.lang.Object configuration)
Description copied from interface:BeanConfigurationRequestSets 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:
setConfigurationin interfaceBeanConfigurationRequest- Parameters:
configuration- The configuration to unmarshal, may benull.- Returns:
- This request for chaining, never
null.
-
setConfiguration
public DefaultBeanConfigurationRequest setConfiguration(java.lang.Object configuration, java.lang.String element)
Description copied from interface:BeanConfigurationRequestSets the configuration to unmarshal into the bean. The configuration should be taken fromConfigurationContainer.getConfiguration()or a similar source. Ifelementis notnull, child configuration element with the specified name will be unmarshaled.- Specified by:
setConfigurationin interfaceBeanConfigurationRequest- Parameters:
configuration- The configuration to unmarshal, may benull.element- Configuration element name to unmarshal ornullto unmarshal entire configuration.- Returns:
- This request for chaining, never
null.
-
setConfiguration
public DefaultBeanConfigurationRequest setConfiguration(Model model, java.lang.String pluginGroupId, java.lang.String pluginArtifactId, java.lang.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 benullor empty.pluginArtifactId- The artifact id of the plugin whose configuration should be used, must not benullor empty.pluginExecutionId- The id of a plugin execution whose configuration should be used, may benullor empty to use the general plugin configuration.- Returns:
- This request for chaining, never
null.
-
findPlugin
private Plugin findPlugin(Model model, java.lang.String groupId, java.lang.String artifactId)
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Description copied from interface:BeanConfigurationRequestGets 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:
getClassLoaderin interfaceBeanConfigurationRequest- Returns:
- The class loader to load referenced types from or
nullif unset.
-
setClassLoader
public DefaultBeanConfigurationRequest setClassLoader(java.lang.ClassLoader classLoader)
Description copied from interface:BeanConfigurationRequestSets 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:
setClassLoaderin 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:BeanConfigurationRequestGets the optional preprocessor for configuration values.- Specified by:
getValuePreprocessorin interfaceBeanConfigurationRequest- Returns:
- The preprocessor for configuration values or
nullif none.
-
setValuePreprocessor
public DefaultBeanConfigurationRequest setValuePreprocessor(BeanConfigurationValuePreprocessor valuePreprocessor)
Description copied from interface:BeanConfigurationRequestSets the optional preprocessor for configuration values.- Specified by:
setValuePreprocessorin interfaceBeanConfigurationRequest- Parameters:
valuePreprocessor- The preprocessor for configuration values, may benullif unneeded.- Returns:
- This request for chaining, never
null.
-
getPathTranslator
public BeanConfigurationPathTranslator getPathTranslator()
Description copied from interface:BeanConfigurationRequestGets the optional path translator for configuration values unmarshalled to files.- Specified by:
getPathTranslatorin interfaceBeanConfigurationRequest- Returns:
- The path translator for files or
nullif none.
-
setPathTranslator
public DefaultBeanConfigurationRequest setPathTranslator(BeanConfigurationPathTranslator pathTranslator)
Description copied from interface:BeanConfigurationRequestSets the optional path translator for configuration values unmarshalled to files.- Specified by:
setPathTranslatorin interfaceBeanConfigurationRequest- Parameters:
pathTranslator- The path translator for files, may benullif unneeded.- Returns:
- This request for chaining, never
null.
-
-