Examples of makeReadOnly()


Examples of org.apache.avalon.framework.configuration.DefaultConfiguration.makeReadOnly()

        copyAttributes( layer, merged );

        mergeChildren( layer, base, merged );

        merged.setValue( getValue( layer, base ) );
        merged.makeReadOnly();

        return merged;
    }

    private static void mergeChildren( final Configuration layer,
View Full Code Here

Examples of org.apache.avalon.framework.configuration.DefaultConfiguration.makeReadOnly()

    public static Configuration split( final Configuration merged, final Configuration base )
        throws ConfigurationException
    {
        final DefaultConfiguration layer = doSplit( merged, base, false );

        layer.makeReadOnly();

        return layer;
    }

    private static DefaultConfiguration doSplit( final Configuration merged,
View Full Code Here

Examples of org.apache.avalon.framework.configuration.DefaultConfiguration.makeReadOnly()

            }
            else if( !ConfigurationUtil.equals( kids[ i ], mergedWith ) )
            {
                final DefaultConfiguration layerChild = doSplit( kids[ i ], mergedWith, keyAttr );

                layerChild.makeReadOnly();

                layer.addChild( layerChild );
            }
        }
    }
View Full Code Here

Examples of org.apache.avalon.framework.configuration.DefaultConfiguration.makeReadOnly()

        assertEquals( 1, root.getMutableChildren( "child2" ).length );  
        assertTrue( root.getMutableChildren( "child1" )[0] == root.getChild( "child1" ) );  
       
        // Add an immutable child.  
        DefaultConfiguration immutableChild = new DefaultConfiguration( "immutable-child", "-" );  
        immutableChild.makeReadOnly();  
       
        try  
        {  
            immutableChild.setAttribute( "attr", "attr" );  
            fail( "Read-only DefaultConfiguration wasn't read-only!" );  
View Full Code Here

Examples of org.apache.avalon.framework.configuration.DefaultConfiguration.makeReadOnly()

        assertEquals( 1, root.getMutableChildren( "child2" ).length );  
        assertTrue( root.getMutableChildren( "child1" )[0] == root.getChild( "child1" ) );  
       
        // Add an immutable child.  
        DefaultConfiguration immutableChild = new DefaultConfiguration( "immutable-child", "-" );  
        immutableChild.makeReadOnly();  
       
        try  
        {  
            immutableChild.setAttribute( "attr", "attr" );  
            fail( "Read-only DefaultConfiguration wasn't read-only!" );  
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        assertTrue( "value1".equals( context.get( "key1" ) ) );
        context.put( "key1", "" );
        assertTrue( "".equals( context.get( "key1" ) ) );

        context.put( "key1", "value1" );
        context.makeReadOnly();

        try
        {
            context.put( "key1", "" );
            throw new AssertionFailedError( "You are not allowed to change a value after it has been made read only" );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        throws ContextException
    {
        final DefaultContext context = new DefaultContext();
        context.put( "key1", new ResolvableString() );
        context.put( "test", "Cool Test" );
        context.makeReadOnly();

        final Context newContext = (Context) context;
        assertTrue( "Cool Test".equals( newContext.get( "test" ) ) );
        assertTrue( ! "This is a ${test}.".equals( newContext.get( "key1" ) ) );
        assertTrue( "This is a Cool Test.".equals( newContext.get( "key1" ) ) );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

    public void testCascadingContext()
         throws ContextException
    {
        final DefaultContext parent = new DefaultContext();
        parent.put( "test", "ok test" );
        parent.makeReadOnly();
        final DefaultContext child = new DefaultContext( parent );
        child.put( "check", new ResolvableString("This is an ${test}.") );
        child.makeReadOnly();
        final Context context = (Context) child;
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

        final DefaultContext parent = new DefaultContext();
        parent.put( "test", "ok test" );
        parent.makeReadOnly();
        final DefaultContext child = new DefaultContext( parent );
        child.put( "check", new ResolvableString("This is an ${test}.") );
        child.makeReadOnly();
        final Context context = (Context) child;

        assertTrue ( "ok test".equals( context.get( "test" ) ) );
        assertTrue ( ! "This is an ${test}.".equals( context.get( "check" ) ) );
        assertTrue ( "This is an ok test.".equals( context.get( "check" ) ) );
View Full Code Here

Examples of org.apache.avalon.framework.context.DefaultContext.makeReadOnly()

    public void testHiddenItems()
        throws ContextException
    {
        final DefaultContext parent = new DefaultContext();
        parent.put( "test", "test" );
        parent.makeReadOnly();
        final DefaultContext child = new DefaultContext( parent );
        child.put( "check", "check" );
        final Context context = (Context) child;
       
        assertTrue ( "check".equals( context.get( "check" ) ) );
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.