Package org.codehaus.metaclass.model

Examples of org.codehaus.metaclass.model.Attribute


            parameters.setProperty( "optional", optional );

            final String actualKey = determineKey( attribute, resolvedType );
            parameters.setProperty( "key", actualKey );

            return new Attribute( "dna.dependency", parameters );
        }
        else
        {
            return attribute;
        }
View Full Code Here


        if( null != type )
        {
            parameters.setProperty( "type", type );
        }
        parameters.setProperty( "location", location );
        return new Attribute( attribute.getName(), parameters );
    }
View Full Code Here

                                            final Attribute attribute )
    {
        final String name = attribute.getName();
        if( name.equals( "phoenix:block" ) )
        {
            return new Attribute( "dna.component" );
        }
        else if( name.equals( "phoenix:service" ) )
        {
            final Properties parameters = new Properties();
            final String type = attribute.getParameter( "name", null );
            setParameter( parameters, "type", type );
            return new Attribute( "dna.service", parameters );
        }
        else if( name.equals( "phoenix:mx-topic" ) )
        {
            final String description = attribute.getParameter( "name", "" );
            final Properties parameters = new Properties();
            setParameter( parameters, "description", description );
            return new Attribute( "mx.component", parameters );
        }
        else if( name.equals( "phoenix:mx-proxy" ) )
        {
            final Properties parameters = new Properties();
            final String type = attribute.getParameter( "class", "" );
            setParameter( parameters, "type", type );
            return new Attribute( "mx.proxy", parameters );
        }
        else
        {
            return attribute;
        }
View Full Code Here

            }
            else
            {
                setParameter( parameters, "type", type );
            }
            return new Attribute( "dna.configuration", parameters );
        }
        else if( name.equals( "phoenix:dependency" ) )
        {
            final Properties parameters = new Properties();
            final String key = attribute.getParameter( "role", null );
            final String type = attribute.getParameter( "name", null );
            setParameter( parameters, "type", type );
            setParameter( parameters, "key", key );
            return new Attribute( "dna.dependency", parameters );
        }
        else if( name.equals( "phoenix:mx-operation" ) )
        {
            final DocletTag descriptionTag =
                method.getTagByName( "phoenix:mx-description" );
            final String description;
            if( null != descriptionTag )
            {
                description = descriptionTag.getValue();
            }
            else
            {
                description = method.getComment();
            }
            final Properties parameters = new Properties();
            setParameter( parameters, "description", description );
            return new Attribute( "mx.operation", parameters );
        }
        if( name.equals( "phoenix:mx-attribute" ) )
        {
            final DocletTag descriptionTag =
                method.getTagByName( "phoenix:mx-description" );
            final String description;
            if( null != descriptionTag )
            {
                description = descriptionTag.getValue();
            }
            else
            {
                description = method.getComment();
            }
            final Properties parameters = new Properties();
            setParameter( parameters, "description", description );
            return new Attribute( "mx.attribute", parameters );
        }
        else if( name.equals( "phoenix:mx-description" ) )
        {
            return null;
        }
View Full Code Here

                                               final Attribute[] attributes )
    {
        final ArrayList result = new ArrayList();
        for( int i = 0; i < attributes.length; i++ )
        {
            final Attribute attribute = attributes[ i ];
            final String name = attribute.getName();
            if( !name.equals( "phoenix:mx" ) )
            {
                result.add( attribute );
            }
            else
            {
                final Properties parameters = new Properties();
                final String type = attribute.getParameter( "name", "" );
                setParameter( parameters, "type", type );
                result.add( new Attribute( "dna.service", parameters ) );

                final Properties mxParameters = new Properties();
                setParameter( mxParameters, "type", type );
                final String topic = type.substring(
                    type.lastIndexOf( '.' ) + 1 );
                setParameter( mxParameters, "topic", topic );

                result.add( new Attribute( "mx.interface", mxParameters ) );
            }
        }
        return (Attribute[])result.toArray( new Attribute[ result.size() ] );
    }
View Full Code Here

        final ArrayList result = new ArrayList();

        boolean isMxOperation = false;
        for( int i = 0; i < attributes.length; i++ )
        {
            final Attribute attribute = attributes[ i ];
            if( attribute.getName().equals( "mx.operation" ) )
            {
                isMxOperation = true;
            }
            result.add( attribute );
        }
        if( isMxOperation )
        {
            for( int i = 0; i < attributes.length; i++ )
            {
                final Attribute attribute = attributes[ i ];
                if( attribute.getName().equals( "param" ) )
                {
                    final String value = attribute.getValue();
                    final int index = value.indexOf( " " );
                    if( -1 == index )
                    {
                        continue;
                    }
                    final String name = value.substring( 0, index ).trim();
                    final String description = value.substring( index + 1 );
                    final Properties parameters = new Properties();
                    setParameter( parameters, "name", name );
                    setParameter( parameters, "description", description );
                    result.add( new Attribute( "mx.parameter", parameters ) );
                }
            }
        }
        return (Attribute[])result.toArray( new Attribute[ result.size() ] );
    }
View Full Code Here

public final class MetaClassBlockInfoReader implements BlockInfoReader
{
    public ComponentInfo buildComponentInfo( final Class type )
        throws Exception
    {
        final Attribute attribute =
          Attributes.getAttribute( type, "dna.component" );
        if( null == attribute )
        {
            final String message =
                "Type " +
View Full Code Here

        final Class[] types =
          new Class[]{org.apache.avalon.framework.configuration.Configuration.class};
        try
        {
            final Method method = type.getMethod( "configure", types );
            final Attribute attribute =
                Attributes.getAttribute( method, "dna.configuration" );
            if( null == attribute )
            {
                return null;
            }
            final String location = attribute.getParameter( "location" );
            final String schemaType = attribute.getParameter( "type" );
            return new SchemaDescriptor( location, schemaType );
        }
        catch( NoSuchMethodException e )
        {
            return null;
View Full Code Here

        final Attribute[] attributes =
            Attributes.getAttributes( method, "dna.dependency" );
        for( int i = 0; i < attributes.length; i++ )
        {
            final Attribute attribute = attributes[i];
            final String key = attribute.getParameter( "key" );
            final String depType = attribute.getParameter( "type" );
            final boolean optional =
              attribute.getParameter( "optional", "" ).equals( "true" );
            deps.add( new DependencyDescriptor( key, depType, optional ) );
        }

        return (DependencyDescriptor[])deps.toArray( DependencyDescriptor.EMPTY_SET );
    }
View Full Code Here

        final Attribute[] attributes =
          Attributes.getAttributes( type, "dna.service" );
        for( int i = 0; i < attributes.length; i++ )
        {
            final Attribute attribute = attributes[i];
            final String serviceType = attribute.getParameter( "type" );
            services.add( new ServiceDescriptor( serviceType ) );
        }

        return (ServiceDescriptor[])services.toArray( ServiceDescriptor.EMPTY_SET );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.metaclass.model.Attribute

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.