Examples of DefaultConfigurationBuilder

Whitespace handling. Since mixed content is not allowed in the configurations, whitespace is completely discarded in non-leaf nodes. For the leaf nodes the default behavior is to trim the space surrounding the value. This can be changed by specifying xml:space attribute with value of preserve in that case the whitespace is left intact.

@author Avalon Development Team @version CVS $Revision: 1.33 $ $Date: 2004/04/03 23:55:54 $
  • org.apache.commons.configuration.DefaultConfigurationBuilder
    pache.org/configuration/team-list.html">Commons Configuration team @version $Id: DefaultConfigurationBuilder.java 595043 2007-11-14 20:44:43Z oheger $

  • Examples of org.apache.commons.configuration.DefaultConfigurationBuilder

                CombinedConfiguration configuration;
                if ( StringUtils.isNotBlank( properties ) )
                {
                    try
                    {
                        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
                        DefaultExpressionEngine expressionEngine = new DefaultExpressionEngine();
                        expressionEngine.setPropertyDelimiter( propertyDelimiter );
                        builder.setExpressionEngine( expressionEngine );

                        StringSearchInterpolator interpolator = new StringSearchInterpolator( "${", "}" );
                        // interpolation as plexus did it before
                        interpolator.addValueSource( new PropertiesBasedValueSource( System.getProperties() ) );

                        String interpolatedProps = interpolator.interpolate( properties );

                        logger.debug( "Loading configuration into commons-configuration, xml {}", interpolatedProps );
                        builder.load( new StringReader( interpolatedProps ) );
                        configuration = builder.getConfiguration( false );
                        configuration.setExpressionEngine( expressionEngine );
                        //configuration.set
                    }
                    catch ( InterpolationException e )
                    {
    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.