Class implementation = getClassForImplementationHint( type, configuration, classLoader );
final Class<?> implType = getClassForImplementationHint( type, configuration, loader ); if ( null == value && implType.isInterface() && configuration.getChildCount() == 0 )
public Object fromConfiguration( ConverterLookup converterLookup, PlexusConfiguration configuration, Class type, Class baseType, ClassLoader classLoader, ExpressionEvaluator expressionEvaluator, ConfigurationListener listener ) throws ComponentConfigurationException { Object retValue = fromExpression( configuration, expressionEvaluator, type ); if ( retValue == null ) { try { // it is a "composite" - we compose it from its children. It does not have a value of its own Class implementation = getClassForImplementationHint( type, configuration, classLoader ); retValue = instantiateObject( implementation ); processConfiguration( converterLookup, retValue, classLoader, configuration, expressionEvaluator, listener ); } catch ( ComponentConfigurationException e ) { if ( e.getFailedConfiguration() == null ) { e.setFailedConfiguration( configuration ); } throw e; } } return retValue; }
public void processConfiguration( final ConverterLookup lookup, final Object bean, final ClassLoader loader, final PlexusConfiguration configuration, final ExpressionEvaluator evaluator, final ConfigurationListener listener ) throws ComponentConfigurationException { final CompositeBeanHelper helper = new CompositeBeanHelper( lookup, loader, evaluator, listener ); for ( int i = 0, size = configuration.getChildCount(); i < size; i++ ) { final PlexusConfiguration element = configuration.getChild( i ); final String propertyName = fromXML( element.getName() ); Class<?> valueType; try { valueType = getClassForImplementationHint( null, element, loader ); } catch ( final ComponentConfigurationException e ) { valueType = null; } helper.setProperty( bean, propertyName, valueType, element ); } } }