Package org.apache.avalon.meta.info

Examples of org.apache.avalon.meta.info.EntryDescriptor


    public void testJoin()
    {
        ContextDescriptor desc = (ContextDescriptor) getDescriptor();
        EntryDescriptor[] good = new EntryDescriptor[]{
            new EntryDescriptor( "key", String.class.getName() ),
            new EntryDescriptor( "no conflict", String.class.getName() )
        };
        EntryDescriptor[] bad = new EntryDescriptor[]{
            new EntryDescriptor( "key", Integer.class.getName() )
        };

        checkDescriptor( desc );
        EntryDescriptor[] merged = desc.merge( good );
        checkDescriptor( desc );
View Full Code Here


    public void setUp()
    {
        m_classname = "org.apache.avalon.playground.MyContext";
        m_entries = new EntryDescriptor[]{
            new EntryDescriptor( "key", String.class.getName() )
        };
    }
View Full Code Here

        final String entryType = getNamedParameter( tag, TYPE_PARAM, "java.lang.String" );
        final String optional = getNamedParameter( tag, OPTIONAL_PARAM, "false" );
        final boolean isOptional = "true".equals( optional );
        final String volatileValue = getNamedParameter( tag, VOLATILE_PARAM, "false" );
        final boolean isVolatile = "true".equals( volatileValue );
        return new EntryDescriptor( key, entryType, isOptional, isVolatile, alias );
    }
View Full Code Here

    {
        final ArrayList entrys = new ArrayList();

        for( int i = 0; i < entrySet.length; i++ )
        {
            final EntryDescriptor service = buildEntry( entrySet[ i ] );
            entrys.add( service );
        }

        return (EntryDescriptor[])entrys.toArray( new EntryDescriptor[ entrys.size() ] );
    }
View Full Code Here

            final String type = config.getAttribute( "type", "java.lang.String" );
            final boolean isVolatile = config.getAttributeAsBoolean( "volatile", false );
            final boolean optional =
              config.getAttributeAsBoolean( "optional", false );
            final String alias = config.getAttribute( "alias", null );
            return new EntryDescriptor( key, type, optional, isVolatile, alias );
        }
        catch( Throwable e )
        {
            final String error =
              "Unable to build entry descriptor."
View Full Code Here

          name, classname, version, lifestyle, null, schema, attributes );
    }

    private ContextDescriptor buildPhoenixContext()
    {
        EntryDescriptor name =
          new EntryDescriptor(
            ContextDescriptor.NAME_KEY,
            "java.lang.String", false, false, "block.name" );
        EntryDescriptor partition =
          new EntryDescriptor(
            ContextDescriptor.PARTITION_KEY,
            "java.lang.String", false, false, "app.name" );
        EntryDescriptor home =
          new EntryDescriptor(
            ContextDescriptor.HOME_KEY,
            "java.io.File", false, false, "app.home" );

        return new ContextDescriptor( new EntryDescriptor[]{ name, partition, home } );
    }
View Full Code Here

        assertTrue( "name", type.getInfo().getName().equals( "primary-component" ) );
        assertTrue(
          "lifestyle", type.getInfo().getLifestyle().equals( "singleton" ) );

        ContextDescriptor context = m_primary.getContext();
        EntryDescriptor entry = context.getEntry( "home" );
        if( entry == null )
        {
            assertTrue( "no context entries", false );
            throw new Exception( "missing context" );
        }
        else
        {
            assertTrue( entry.getKey().equals( "home" ) );
            assertTrue( entry.getClassname().equals( "java.io.File" ) );
        }
    }
View Full Code Here

          name, classname, version, lifestyle, schema, attributes );
    }

    private ContextDescriptor buildPhoenixContext()
    {
        EntryDescriptor name =
          new EntryDescriptor(
            ContextDescriptor.NAME_KEY,
            "java.lang.String", false, false, "block.name" );
        EntryDescriptor partition =
          new EntryDescriptor(
            ContextDescriptor.PARTITION_KEY,
            "java.lang.String", false, false, "app.name" );
        EntryDescriptor home =
          new EntryDescriptor(
            ContextDescriptor.HOME_KEY,
            "java.io.File", false, false, "app.home" );

        return new ContextDescriptor( new EntryDescriptor[]{ name, partition, home } );
    }
View Full Code Here

        final String entryType = getNamedParameter( tag, TYPE_PARAM, "java.lang.String" );
        final String optional = getNamedParameter( tag, OPTIONAL_PARAM, "false" );
        final boolean isOptional = "true".equals( optional );
        final String volatileValue = getNamedParameter( tag, VOLATILE_PARAM, "false" );
        final boolean isVolatile = "true".equals( volatileValue );
        return new EntryDescriptor( key, entryType, isOptional, isVolatile, alias );
    }
View Full Code Here

    {
        final ArrayList entrys = new ArrayList();

        for( int i = 0; i < entrySet.length; i++ )
        {
            final EntryDescriptor service = buildEntry( entrySet[ i ] );
            entrys.add( service );
        }

        return (EntryDescriptor[])entrys.toArray( new EntryDescriptor[ entrys.size() ] );
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.meta.info.EntryDescriptor

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.