Package org.codehaus.plexus.component.repository

Examples of org.codehaus.plexus.component.repository.ComponentRequirement


        assertEquals( "parameter-description", mp.getDescription() );
        assertEquals( "deprecated-parameter", mp.getDeprecated() );
        assertEquals( "${jar.finalName}", mp.getExpression() );
        assertEquals( "${project.build.finalName}", mp.getDefaultValue() );

        ComponentRequirement cr = md.getRequirements().get( 0 );

        assertEquals( "org.codehaus.plexus.archiver.Archiver", cr.getRole() );
        assertEquals( "jar", cr.getRoleHint() );
        assertEquals( "jarArchiver", cr.getFieldName() );

        ComponentDependency cd = pd.getDependencies().get( 0 );

        assertEquals( "org.apache.maven", cd.getGroupId() );
        assertEquals( "maven-plugin-api", cd.getArtifactId() );
View Full Code Here


        if ( components != null && !components.isEmpty() )
        {
            for ( Component component : components )
            {
                ComponentRequirement cr = new ComponentRequirement();
                cr.setRole( component.getRole() );
                cr.setRoleHint( component.getHint() );

                descriptor.addRequirement( cr );
            }
        }
View Full Code Here

            config.put( "project", project );
            config.put( "session", new MavenSession( null, null, null, null, null, null, null, null, null, null ) );
            config.put( "mojoExecution", new MojoExecution( md ) );

            ComponentRequirement cr = new ComponentRequirement();
            cr.setRole( PathTranslator.class.getName() );

            wrapper.addComponentRequirement( cr, pt );
        }

        wrapper.setComponentConfiguration( config );
View Full Code Here

        List requirements = componentDescriptor.getRequirements();

        for ( Iterator i = requirements.iterator(); i.hasNext(); )
        {
            ComponentRequirement requirement = (ComponentRequirement) i.next();

            Field field = findMatchingField( component, componentDescriptor, requirement, container );

            // we want to use private fields.
            if ( !field.isAccessible() )
View Full Code Here

        final PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();

        for ( final Iterator i = requirements.iterator(); i.hasNext(); )
        {
            final ComponentRequirement requirement = ( ComponentRequirement ) i.next();

            final PropertyDescriptor propertyDescriptor = findMatchingPropertyDescriptor( requirement, propertyDescriptors );

            if ( propertyDescriptor != null )
            {
View Full Code Here

        final List requirements = componentDescriptor.getRequirements();

        for ( final Iterator iterator = requirements.iterator(); iterator.hasNext(); )
        {
            final ComponentRequirement requirement = (ComponentRequirement) iterator.next();

            try
            {
                dag.addEdge( componentKey, requirement.getRole() );
            }
            catch ( CycleDetectedException e )
            {
                throw new CompositionException( "Cyclic requirement detected", e );
            }
View Full Code Here

        List requirements = componentDescriptor.getRequirements();

        for ( Iterator i = requirements.iterator(); i.hasNext(); )
        {
            ComponentRequirement requirement = (ComponentRequirement) i.next();

            List descriptors = addRequirement( (MapOrientedComponent) component, container, requirement );

            retValue.addAll( descriptors );
        }
View Full Code Here

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

            ComponentRequirement cr = new ComponentRequirement();

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

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

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

            cd.addRequirement( cr );
        }

        return cd;
View Full Code Here

        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

        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.component.repository.ComponentRequirement

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.