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     */
017    package org.apache.camel.component.properties;
018    
019    import java.util.Properties;
020    
021    /**
022     * Interface for property parses that can attempt parsing property names using a fixed property name prefix and suffix.
023     */
024    public interface AugmentedPropertyNameAwarePropertiesParser extends PropertiesParser {
025        
026        /**
027         * Parses the string, applying the optional {@code propertyPrefix} and
028         * {@code propertySuffix} to the parsed property names, and replaces the
029         * property placeholders with values from the given properties.
030         * 
031         * @param text the text to be parsed
032         * @param properties the properties resolved which values should be looked
033         *            up
034         * @param prefixToken the prefix token
035         * @param suffixToken the suffix token
036         * @param propertyPrefix the optional property name prefix to augment parsed
037         *            property names with
038         * @param propertySuffix the optional property name suffix to augment parsed
039         *            property names with
040         * @param fallbackToUnaugmentedProperty flag indicating if the originally
041         *            parsed property name should by used for resolution if there is
042         *            no match to the augmented property name
043         *            
044         * @return the parsed text with replaced placeholders
045         *
046         * @throws IllegalArgumentException if uri syntax is not valid or a property
047         *             is not found
048         */
049        String parseUri(String text, Properties properties, String prefixToken, String suffixToken,
050                        String propertyPrefix, String propertySuffix, boolean fallbackToUnaugmentedProperty) throws IllegalArgumentException;
051    }