Package org.eclipse.sisu.plexus
Class CompositeBeanHelper
java.lang.Object
org.eclipse.sisu.plexus.CompositeBeanHelper
Helper class that implements low-level Plexus configuration of composite beans.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ExpressionEvaluator
private final ConfigurationListener
private final ClassLoader
private final ConverterLookup
private static final Type[]
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeBeanHelper
(ConverterLookup lookup, ClassLoader loader, ExpressionEvaluator evaluator, ConfigurationListener listener) -
Method Summary
Modifier and TypeMethodDescriptionprivate Object
convertProperty
(Class<?> beanType, Class<?> rawPropertyType, Type genericPropertyType, PlexusConfiguration configuration) private static Type
expandType
(Type type) private static Field
private static Method
findMethod
(Class<?> beanType, Type[] paramTypeHolder, String methodName) private static Type[]
getTypeArguments
(Type type) void
setDefault
(Object bean, Object defaultValue, PlexusConfiguration configuration) Calls the default "set" method on the bean; re-converts the configuration if necessary.private static void
void
setProperty
(Object bean, String propertyName, Class<?> valueType, PlexusConfiguration configuration) Sets a property in the bean; looks for public setter/adder method before checking fields.
-
Field Details
-
NO_TYPES
-
lookup
-
loader
-
evaluator
-
listener
-
-
Constructor Details
-
CompositeBeanHelper
public CompositeBeanHelper(ConverterLookup lookup, ClassLoader loader, ExpressionEvaluator evaluator, ConfigurationListener listener)
-
-
Method Details
-
setDefault
public void setDefault(Object bean, Object defaultValue, PlexusConfiguration configuration) throws ComponentConfigurationException Calls the default "set" method on the bean; re-converts the configuration if necessary.- Parameters:
bean
- The bean being configureddefaultValue
- The default valueconfiguration
- The configuration- Throws:
ComponentConfigurationException
-
setProperty
public void setProperty(Object bean, String propertyName, Class<?> valueType, PlexusConfiguration configuration) throws ComponentConfigurationException Sets a property in the bean; looks for public setter/adder method before checking fields.- Parameters:
bean
- The bean being configuredpropertyName
- The property namevalueType
- The value typeconfiguration
- The configuration- Throws:
ComponentConfigurationException
-
convertProperty
private Object convertProperty(Class<?> beanType, Class<?> rawPropertyType, Type genericPropertyType, PlexusConfiguration configuration) throws ComponentConfigurationException - Throws:
ComponentConfigurationException
-
getTypeArguments
-
expandType
-
findMethod
-
findField
-
setField
- Throws:
Exception
-