Package org.codehaus.plexus.component.configurator

Examples of org.codehaus.plexus.component.configurator.ComponentConfigurationException


        this.lookup = lookup;
        this.listener = listener;

        if ( object == null )
        {
            throw new ComponentConfigurationException( "Component is null" );
        }

        initSetter();

        initField();

        if ( setter == null && field == null )
        {
            throw new ComponentConfigurationException(
                "Cannot find setter nor field in " + object.getClass().getName() + " for '" + fieldName + "'" );
        }

        if ( setterTypeConverter == null && fieldTypeConverter == null )
        {
            throw new ComponentConfigurationException( "Cannot find converter for " + setterParamType.getName() +
                ( fieldType != null && ! fieldType.equals( setterParamType ) ? " or " + fieldType.getName() : "" ) );
        }
    }
View Full Code Here


                field.setAccessible( false );
            }
        }
        catch ( IllegalAccessException e )
        {
            throw new ComponentConfigurationException( "Cannot access field: " + exceptionInfo, e );
        }
        catch ( IllegalArgumentException e )
        {
            throw new ComponentConfigurationException( "Cannot assign value '" + value + "' to field: " + exceptionInfo,
                                                       e );
        }
    }
View Full Code Here

    private void setValueUsingSetter( Object value )
        throws ComponentConfigurationException
    {
        if ( setterParamType == null || setter == null )
        {
            throw new ComponentConfigurationException( "No setter found" );
        }

        String exceptionInfo = object.getClass().getName() + "." + setter.getName() + "( " +
            setterParamType.getClass().getName() + " )";

        if ( listener != null )
        {
            listener.notifyFieldChangeUsingSetter( fieldName, value, object );
        }

        try
        {
            setter.invoke( object, new Object[]{value} );
        }
        catch ( IllegalAccessException e )
        {
            throw new ComponentConfigurationException( "Cannot access method: " + exceptionInfo, e );
        }
        catch ( IllegalArgumentException e )
        {
            throw new ComponentConfigurationException(
                "Invalid parameter supplied while setting '" + value + "' to " + exceptionInfo, e );
        }
        catch ( InvocationTargetException e )
        {
            throw new ComponentConfigurationException( "Setter " + exceptionInfo +
                " threw exception when called with parameter '" + value + "': " + e.getTargetException().getMessage(),
                                                       e );
        }
    }
View Full Code Here

        }

        // try setting field using value found with method
        // converter, if present.

        ComponentConfigurationException savedEx = null;

        if ( value != null )
        {
            try
            {
View Full Code Here

        }

        if ( retValue == null )
        {
            // this is highly irregular
            throw new ComponentConfigurationException( "Configuration converter lookup failed for type: " + type );
        }

        return retValue;
    }
View Full Code Here

                                     ConfigurationListener listener )
        throws ComponentConfigurationException
    {
        if ( configuration.getChildCount() > 0 )
        {
            throw new ComponentConfigurationException( "When configuring a basic element the configuration cannot " +
                "contain any child elements. " + "Configuration element '" + configuration.getName() + "'." );
        }

        Object retValue = fromExpression( configuration, expressionEvaluator );
View Full Code Here

        if ( name == null )
        {
            String msg = "Converter: java.util.Properties. Trying to convert the configuration element: '" + element
                + "', missing child element 'name'.";

            throw new ComponentConfigurationException( msg );
        }

        String value = property.getChild( "value" ).getValue( "" );

        properties.put( name, value );
View Full Code Here

        }

        if ( retValue == null )
        {
            // this is highly irregular
            throw new ComponentConfigurationException( "Configuration converter lookup failed for type: " + type );
        }

        return retValue;
    }
View Full Code Here

                catch ( ExpressionEvaluationException e )
                {
                    String msg =
                        "Error evaluating the expression '" + expression + "' for configuration value '"
                            + configuration.getName() + "'";
                    throw new ComponentConfigurationException( configuration, msg, e );
                }
            }

            if ( value == null && ( config == null || config.getChildCount() <= 0 ) )
            {
View Full Code Here

            methodConfigure.invoke( componentConfigurator, wagon, plexusConf, realm );
        }
        catch ( Exception e )
        {
            throw new ComponentConfigurationException(
                "fail to configure wagon component for a maven2 use " + e.getMessage(), e );
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.component.configurator.ComponentConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.