Package org.apache.commons.configuration.interpol

Examples of org.apache.commons.configuration.interpol.ConfigurationInterpolator


   * @return the newly created interpolator object
   * @since 1.4
   */
  protected ConfigurationInterpolator createInterpolator()
  {
    ConfigurationInterpolator interpol = new ConfigurationInterpolator();
    interpol.setDefaultLookup(new StrLookup()
    {
      public String lookup(String var)
      {
        Object prop = resolveContainerStore(var);
        return (prop != null) ? prop.toString() : null;
View Full Code Here


     * @return the newly created interpolator object
     * @since 1.4
     */
    protected ConfigurationInterpolator createInterpolator()
    {
        ConfigurationInterpolator interpol = new ConfigurationInterpolator();
        interpol.setDefaultLookup(new StrLookup()
        {
            public String lookup(String var)
            {
                Object prop = resolveContainerStore(var);
                return (prop != null) ? prop.toString() : null;
View Full Code Here

    public void testLocalLookupsInInterpolatorAreInherited() {
        parent.addProperty("tablespaces.tablespace.name", "default");
        parent.addProperty("tablespaces.tablespace(-1).name", "test");
        parent.addProperty("tables.table(0).var", "${brackets:x}");
       
        ConfigurationInterpolator interpolator = parent.getInterpolator();
        interpolator.registerLookup("brackets", new StrLookup(){

            public String lookup(String key) {
                return "(" + key +")";
            }
           
View Full Code Here

        InterpolationTestHelper.testGetInterpolator(subset);
    }
   
    public void testLocalLookupsInInterpolatorAreInherited() {
        BaseConfiguration config = new BaseConfiguration();
        ConfigurationInterpolator interpolator = config.getInterpolator();
        interpolator.registerLookup("brackets", new StrLookup(){

            public String lookup(String key) {
                return "(" + key +")";
            }
           
View Full Code Here

     * @param config the configuration to test
     */
    public static void testGetInterpolator(AbstractConfiguration config)
    {
        config.addProperty("var", "${echo:testVar}");
        ConfigurationInterpolator interpol = config.getInterpolator();
        interpol.registerLookup("echo", new StrLookup()
        {
            public String lookup(String varName)
            {
                return "Value of variable " + varName;
            }
View Full Code Here

     * @return the newly created interpolator object
     * @since 1.4
     */
    protected ConfigurationInterpolator createInterpolator()
    {
        ConfigurationInterpolator interpol = new ConfigurationInterpolator();
        interpol.setDefaultLookup(new StrLookup()
        {
            public String lookup(String var)
            {
                Object prop = resolveContainerStore(var);
                return (prop != null) ? prop.toString() : null;
View Full Code Here

     *
     * @return the new interpolator
     */
    protected ConfigurationInterpolator createInterpolator()
    {
        ConfigurationInterpolator interpolator = super.createInterpolator();
        interpolator.setParentInterpolator(getParent().getInterpolator());
        return interpolator;
    }
View Full Code Here

            return super.interpolate(base);
        }
        else
        {
            SubsetConfiguration config = new SubsetConfiguration(parent, "");
            ConfigurationInterpolator interpolator = config.getInterpolator();
            getInterpolator().registerLocalLookups(interpolator);
            if (parent instanceof AbstractConfiguration)
            {
                interpolator.setParentInterpolator(((AbstractConfiguration) parent).getInterpolator());
            }
            return config.interpolate(base);
        }
    }
View Full Code Here

     * @return the newly created interpolator object
     * @since 1.4
     */
    protected ConfigurationInterpolator createInterpolator()
    {
        ConfigurationInterpolator interpol = new ConfigurationInterpolator();
        interpol.setDefaultLookup(new StrLookup()
        {
            public String lookup(String var)
            {
                Object prop = resolveContainerStore(var);
                return (prop != null) ? prop.toString() : null;
View Full Code Here

     *
     * @return the {@code ConfigurationInterpolator}
     */
    protected ConfigurationInterpolator getInterpolator()
    {
        ConfigurationInterpolator result;
        boolean done;

        // This might create multiple instances under high load,
        // however, always the same instance is returned.
        do
View Full Code Here

TOP

Related Classes of org.apache.commons.configuration.interpol.ConfigurationInterpolator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.