    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *     http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017package org.apache.commons.configuration2.builder;
    018
    019import java.util.Map;
    020
    021import org.apache.commons.configuration2.tree.ExpressionEngine;
    022
    023/**
    024 * <p>
    025 * A specialized parameters object for hierarchical configurations.
    026 * </p>
    027 * <p>
    028 * This class defines special properties for hierarchical configurations.
    029 * Because most hierarchical configurations are file-based configurations this
    030 * class extends {@code FileBasedBuilderParametersImpl}.
    031 * </p>
    032 *
    033 * @since 2.0
    034 */
    035public class HierarchicalBuilderParametersImpl extends
    036        FileBasedBuilderParametersImpl implements
    037        HierarchicalBuilderProperties<HierarchicalBuilderParametersImpl>
    038{
    039    /** Constant for the expression engine property. */
    040    private static final String PROP_EXPRESSION_ENGINE = "expressionEngine";
    041
    042    /**
    043     * {@inheritDoc} This implementation copies some more properties defined by
    044     * this class.
    045     */
    046    @Override
    047    public void inheritFrom(final Map<String, ?> source)
    048    {
    049        super.inheritFrom(source);
    050        copyPropertiesFrom(source, PROP_EXPRESSION_ENGINE);
    051    }
    052
    053    /**
    054     * {@inheritDoc} This implementation stores the expression engine in the
    055     * internal parameters map.
    056     */
    057    @Override
    058    public HierarchicalBuilderParametersImpl setExpressionEngine(
    059            final ExpressionEngine engine)
    060    {
    061        storeProperty(PROP_EXPRESSION_ENGINE, engine);
    062        return this;
    063    }
    064}