Package org.codehaus.plexus.configuration

Examples of org.codehaus.plexus.configuration.PlexusConfiguration


    {
        int items = configuration.getChildCount();

        for ( int i = 0; i < items; i++ )
        {
            PlexusConfiguration childConfiguration = configuration.getChild( i );

            String elementName = childConfiguration.getName();

            ComponentValueSetter valueSetter = new ComponentValueSetter( fromXML( elementName ), object, converterLookup, listener );

            valueSetter.configure( childConfiguration, classLoader, expressionEvaluator );
        }
View Full Code Here


        PlexusConfiguration[] components = c.getChild( "components" ).getChildren( "component" );

        for ( int i = 0; i < components.length; i++ )
        {
            PlexusConfiguration component = components[i];

            csd.addComponentDescriptor( buildComponentDescriptor( component, realm ) );
        }

        // ----------------------------------------------------------------------
        // Dependencies
        // ----------------------------------------------------------------------

        PlexusConfiguration[] dependencies = c.getChild( "dependencies" ).getChildren( "dependency" );

        for ( int i = 0; i < dependencies.length; i++ )
        {
            PlexusConfiguration d = dependencies[i];

            ComponentDependency cd = new ComponentDependency();

            cd.setArtifactId( d.getChild( "artifact-id" ).getValue() );

            cd.setGroupId( d.getChild( "group-id" ).getValue() );

            String type = d.getChild( "type" ).getValue();
            if(type != null)
            {
                cd.setType( type );
            }

            cd.setVersion( d.getChild( "version" ).getValue() );

            csd.addDependency( cd );
        }

        return csd;
View Full Code Here

                configuratorId = DEFAULT_CONFIGURATOR_ID;
            }

            ComponentConfigurator componentConfigurator = manager.getContainer().lookup( ComponentConfigurator.class, configuratorId );

            PlexusConfiguration configuration = manager.getContainer().getConfigurationSource().getConfiguration( descriptor );

            if ( configuration != null )
            {
                ClassRealm realm = descriptor.getRealm();
View Full Code Here

    if ( configurationReader != null )
    {
        // User userConfiguration

        PlexusConfiguration userConfiguration = PlexusTools.buildConfiguration( "<User Specified Configuration Reader>", getInterpolationConfigurationReader( configurationReader ) );

        // Merger of bootstrapConfiguration and user userConfiguration

        configuration = PlexusConfigurationMerger.merge( userConfiguration, configuration );
    }
View Full Code Here

                }
            }

            // add configuration data
            if (shouldConfigure(descriptor )) {
                PlexusConfiguration configuration = descriptor.getConfiguration();
                if (configuration != null) {
                    for (String name : configuration.getAttributeNames()) {
                        String value;
                        try {
                            value = configuration.getAttribute(name);
                        } catch (PlexusConfigurationException e) {
                            throw new ComponentInstantiationException("Error getting value for attribute " + name, e);
                        }
                        name = fromXML(name);
                        recipe.setProperty(name, value);
                    }
                    for (PlexusConfiguration child : configuration.getChildren()) {
                        String name = child.getName();
                        name = fromXML(name);
                        if (child.getChildCount() == 0) {
                            recipe.setProperty(name, child.getValue());
                        } else {
View Full Code Here

        }

        MapConverter converter = new MapConverter();
        ConverterLookup converterLookup = new DefaultConverterLookup();
        DefaultExpressionEvaluator expressionEvaluator = new DefaultExpressionEvaluator();
        PlexusConfiguration configuration = container.getConfigurationSource().getConfiguration( descriptor );

        if ( configuration != null )
        {
            Map context = (Map) converter.fromConfiguration(converterLookup,
                                                            configuration,
View Full Code Here

    {
        int items = configuration.getChildCount();

        for ( int i = 0; i < items; i++ )
        {
            PlexusConfiguration childConfiguration = configuration.getChild( i );

            String elementName = childConfiguration.getName();

            ComponentValueSetter valueSetter = new ComponentValueSetter( fromXML( elementName ), object, converterLookup, listener );

            valueSetter.configure( childConfiguration, classLoader, expressionEvaluator );
        }
View Full Code Here

        if ( children != null && children.length > 0 )
        {
            for ( int i = 0; i < children.length; i++ )
            {
                PlexusConfiguration child = children[i];

                addEntry( retValue, element, child );
            }
        }
View Full Code Here

    {
        try
        {
            XmlPlexusConfigurationReader reader = new XmlPlexusConfigurationReader();
           
            PlexusConfiguration result = reader.read( configuration );

            return result;
        }
        catch ( PlexusConfigurationException e )
        {
View Full Code Here

        PlexusConfiguration[] requirements = configuration.getChild( "requirements" ).getChildren( "requirement" );

        for ( int i = 0; i < requirements.length; i++ )
        {
            PlexusConfiguration requirement = requirements[i];

            ComponentRequirement cr;

            PlexusConfiguration[] hints = requirement.getChild( "role-hints" ).getChildren( "role-hint" );
            if ( hints != null && hints.length > 0 )
            {
                cr = new ComponentRequirementList();

                List<String> hintList = new LinkedList<String>();
                for ( PlexusConfiguration hint : hints )
                {
                    hintList.add( hint.getValue() );
                }

                ( (ComponentRequirementList) cr ).setRoleHints( hintList );
            }
            else
            {
                cr = new ComponentRequirement();

                cr.setRoleHint( requirement.getChild( "role-hint" ).getValue() );
            }

            cr.setRole( requirement.getChild( "role" ).getValue() );

            cr.setFieldName( requirement.getChild( "field-name" ).getValue() );

            cd.addRequirement( cr );
        }

        return cd;
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.configuration.PlexusConfiguration

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.