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. Because most hierarchical configurations are
029 * file-based configurations this class extends {@code FileBasedBuilderParametersImpl}.
030 * </p>
031 *
032 * @since 2.0
033 */
034public class HierarchicalBuilderParametersImpl extends FileBasedBuilderParametersImpl
035    implements HierarchicalBuilderProperties<HierarchicalBuilderParametersImpl> {
036    /** Constant for the expression engine property. */
037    private static final String PROP_EXPRESSION_ENGINE = "expressionEngine";
038
039    /**
040     * {@inheritDoc} This implementation copies some more properties defined by this class.
041     */
042    @Override
043    public void inheritFrom(final Map<String, ?> source) {
044        super.inheritFrom(source);
045        copyPropertiesFrom(source, PROP_EXPRESSION_ENGINE);
046    }
047
048    /**
049     * {@inheritDoc} This implementation stores the expression engine in the internal parameters map.
050     */
051    @Override
052    public HierarchicalBuilderParametersImpl setExpressionEngine(final ExpressionEngine engine) {
053        storeProperty(PROP_EXPRESSION_ENGINE, engine);
054        return this;
055    }
056}