Examples of PlexusConfiguration


Examples of org.codehaus.plexus.configuration.PlexusConfiguration

    private Xpp3Dom convert( MojoDescriptor mojoDescriptor )
    {
        Xpp3Dom dom = new Xpp3Dom( "configuration" );

        PlexusConfiguration c = mojoDescriptor.getMojoConfiguration();

        PlexusConfiguration[] ces = c.getChildren();

        if ( ces != null )
        {
            for ( PlexusConfiguration ce : ces )
            {
View Full Code Here

Examples of org.codehaus.plexus.configuration.PlexusConfiguration

            String id = server.getId();
            if ( id != null && id.equals( repositoryId ) )
            {
                if ( server.getConfiguration() != null )
                {
                    final PlexusConfiguration plexusConf =
                        new XmlPlexusConfiguration( (Xpp3Dom) server.getConfiguration() );

                    ComponentConfigurator componentConfigurator = null;
                    try
                    {
View Full Code Here

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

Examples of org.codehaus.plexus.configuration.PlexusConfiguration

        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

Examples of org.codehaus.plexus.configuration.PlexusConfiguration

        }
        // now we have collection and we have to add some objects to it

        for ( int i = 0; i < configuration.getChildCount(); i++ )
        {
            PlexusConfiguration c = configuration.getChild( i );
            //Object o = null;

            String configEntry = c.getName();

            String name = fromXML( configEntry );

            Class childType = getClassForImplementationHint( null, c, classLoader );

            if ( childType == null && name.indexOf( '.' ) > 0 )
            {
                try
                {
                    childType = classLoader.loadClass( name );
                }
                catch ( ClassNotFoundException e )
                {
                    // not found, continue processing
                }
            }

            if ( childType == null )
            {
                // Some classloaders don't create Package objects for classes
                // so we have to resort to slicing up the class name

                String baseTypeName = baseType.getName();

                int lastDot = baseTypeName.lastIndexOf( '.' );

                String className;

                if ( lastDot == -1 )
                {
                    className = name;
                }
                else
                {
                    String basePackage = baseTypeName.substring( 0, lastDot );

                    className = basePackage + "." + StringUtils.capitalizeFirstLetter( name );
                }

                try
                {
                    childType = classLoader.loadClass( className );
                }
                catch ( ClassNotFoundException e )
                {
                    if ( c.getChildCount() == 0 )
                    {
                        // If no children, try a String.
                        // TODO: If we had generics we could try that instead - or could the component descriptor list an impl?
                        childType = String.class;
                    }
View Full Code Here

Examples of org.codehaus.plexus.configuration.PlexusConfiguration

        List values = new ArrayList();

        for ( int i = 0; i < configuration.getChildCount(); i++ )
        {
            PlexusConfiguration c = configuration.getChild( i );

            String configEntry = c.getName();

            String name = fromXML( configEntry );

            Class childType = getClassForImplementationHint( null, c, classLoader );
View Full Code Here

Examples of org.codehaus.plexus.configuration.PlexusConfiguration

            PlexusConfiguration[] children = configuration.getChildren();

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

                String name = child.getName();

                map.put( name, fromExpression( child, expressionEvaluator ) );
            }
            retValue = map;
        }
View Full Code Here

Examples of org.codehaus.plexus.configuration.PlexusConfiguration

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

        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

Examples of org.codehaus.plexus.configuration.PlexusConfiguration

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

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

            csd.addComponentDescriptor( buildComponentDescriptor( component ) );
        }

        // ----------------------------------------------------------------------
        // 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

Examples of org.codehaus.plexus.configuration.PlexusConfiguration

        int count = c.getChildCount();

        for ( int i = 0; i < count; i++ )
        {
            PlexusConfiguration child = c.getChild( i );

            int childCount = child.getChildCount();

            depth++;

            if ( childCount > 0 )
            {
                display( child, sb, depth );
            }
            else
            {
                String value = child.getValue( null );

                if ( value != null )
                {
                    sb.append( indent( depth ) ).
                        append( '<' ).
                        append( child.getName() );

                    attributes( child, sb );

                    sb.append( '>' ).
                        append( child.getValue( null ) ).
                        append( '<' ).
                        append( '/' ).
                        append( child.getName() ).
                        append( '>' ).
                        append( '\n' );
                }
                else
                {
                    sb.append( indent( depth ) ).
                        append( '<' ).
                        append( child.getName() );

                    attributes( child, sb );

                    sb.append( '/' ).
                        append( '>' ).
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.