All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.tapestry.ioc.services.SymbolSource Maven / Gradle / Ivy

// Copyright 2006, 2007 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.apache.tapestry.ioc.services;

import org.apache.tapestry.ioc.annotations.Value;

/**
 * Used to manage symbols, configuration properties whose value is evaluated at runtime.
 * Symbols use the Ant syntax: ${foo.bar.baz} where foo.bar.baz is the
 * name of the symbol. The symbol may appear inside annotation, such as {@link Value}. Values for
 * symbols are provided by {@link SymbolProvider}.
 */
public interface SymbolSource
{
    /**
     * Expands the value for a particular symbol. This may involve recursive expansion, if the
     * immediate value for the symbol itself contains symbols.
     *
     * @param symbolName
     * @return the expanded string
     * @throws RuntimeException if the symbol name can not be expanded (no {@link SymbolProvider} can provide its
     *                          value), or if an expansion is directly or indirectly recursive
     */
    String valueForSymbol(String symbolName);

    /**
     * Given an input string that may contain symbols, returns the string with any and
     * all symbols fully expanded.
     *
     * @param input
     * @return expanded input
     */
    String expandSymbols(String input);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy