    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 * @version $Id: HierarchicalBuilderParametersImpl.java 1842194 2018-09-27 22:24:23Z ggregory $
    034 * @since 2.0
    035 */
    036public class HierarchicalBuilderParametersImpl extends
    037        FileBasedBuilderParametersImpl implements
    038        HierarchicalBuilderProperties<HierarchicalBuilderParametersImpl>
    039{
    040    /** Constant for the expression engine property. */
    041    private static final String PROP_EXPRESSION_ENGINE = "expressionEngine";
    042
    043    /**
    044     * {@inheritDoc} This implementation copies some more properties defined by
    045     * this class.
    046     */
    047    @Override
    048    public void inheritFrom(final Map<String, ?> source)
    049    {
    050        super.inheritFrom(source);
    051        copyPropertiesFrom(source, PROP_EXPRESSION_ENGINE);
    052    }
    053
    054    /**
    055     * {@inheritDoc} This implementation stores the expression engine in the
    056     * internal parameters map.
    057     */
    058    @Override
    059    public HierarchicalBuilderParametersImpl setExpressionEngine(
    060            final ExpressionEngine engine)
    061    {
    062        storeProperty(PROP_EXPRESSION_ENGINE, engine);
    063        return this;
    064    }
    065}