org.codehaus.plexus.component.configurator.converters

Class AbstractConfigurationConverter

Implemented Interfaces:
ConfigurationConverter
Known Direct Subclasses:
AbstractBasicConverter, ArrayConverter, ClassRealmConverter, CollectionConverter, MapConverter, ObjectWithFieldsConverter, PlexusConfigurationConverter, PropertiesConverter

public abstract class AbstractConfigurationConverter
extends java.lang.Object
implements ConfigurationConverter

Version:
$Id: AbstractConfigurationConverter.java 2636 2005-10-08 07:12:05Z brett $
Author:
Michal Maczka

Method Summary

Object
fromConfiguration(ConverterLookup converterLookup, PlexusConfiguration configuration, Class type, Class baseType, ClassLoader classLoader, ExpressionEvaluator expressionEvaluator)
protected Object
fromExpression(PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator)
protected Object
fromExpression(PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator, Class type)
protected String
fromXML(String elementName)
protected Class
getClassForImplementationHint(Class type, PlexusConfiguration configuration, ClassLoader classLoader)
We will check if user has provided a hint which class should be used for given field.
protected Object
instantiateObject(Class clazz)
protected Object
instantiateObject(String classname, ClassLoader classLoader)
protected Class
loadClass(String classname, ClassLoader classLoader)
protected String
toXML(String fieldName)

Method Details

fromConfiguration

public Object fromConfiguration(ConverterLookup converterLookup,
                                PlexusConfiguration configuration,
                                Class type,
                                Class baseType,
                                ClassLoader classLoader,
                                ExpressionEvaluator expressionEvaluator)
            throws ComponentConfigurationException
Specified by:
fromConfiguration in interface ConfigurationConverter

fromExpression

protected Object fromExpression(PlexusConfiguration configuration,
                                ExpressionEvaluator expressionEvaluator)
            throws ComponentConfigurationException

fromExpression

protected Object fromExpression(PlexusConfiguration configuration,
                                ExpressionEvaluator expressionEvaluator,
                                Class type)
            throws ComponentConfigurationException

fromXML

protected String fromXML(String elementName)

getClassForImplementationHint

protected Class getClassForImplementationHint(Class type,
                                              PlexusConfiguration configuration,
                                              ClassLoader classLoader)
            throws ComponentConfigurationException
We will check if user has provided a hint which class should be used for given field. So we will check if something like is present in configuraion. If 'implementation' hint was provided we will try to load correspoding class If we are unable to do so error will be reported

instantiateObject

protected Object instantiateObject(Class clazz)
            throws ComponentConfigurationException

instantiateObject

protected Object instantiateObject(String classname,
                                   ClassLoader classLoader)
            throws ComponentConfigurationException

loadClass

protected Class loadClass(String classname,
                          ClassLoader classLoader)
            throws ComponentConfigurationException

toXML

protected String toXML(String fieldName)