Package org.apache.avalon.framework.configuration

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


    {
        final ValidationResult result = new ValidationResult();
        final DefaultConfiguration branched =
            new DefaultConfiguration( "root", configuration.getLocation() );
        branched.addAll( configuration );
        branched.makeReadOnly();

        try
        {
            final Verifier verifier = m_schema.newVerifier();
            final VerifierHandler handler = verifier.getVerifierHandler();
View Full Code Here


        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

    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

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

                layerChild.makeReadOnly();

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

        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

        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

        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

    copyAttributes(layer, merged);

    mergeChildren(layer, base, merged);

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

    return merged;
  }

  private static void mergeChildren(final Configuration layer, final Configuration base,
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.