Examples of DelegatingPropertySource


Examples of org.apache.tapestry.util.DelegatingPropertySource

     *
     **/

    protected IPropertySource createPropertySource(RequestContext context)
    {
        DelegatingPropertySource result = new DelegatingPropertySource();

        ApplicationServlet servlet = context.getServlet();
        IApplicationSpecification spec = servlet.getApplicationSpecification();

        result.addSource(new PropertyHolderPropertySource(spec));
        result.addSource(new ServletPropertySource(servlet.getServletConfig()));
        result.addSource(new ServletContextPropertySource(servlet.getServletContext()));

        if (spec.checkExtension(EXTENSION_PROPERTY_SOURCE_NAME))
        {
            IPropertySource source =
                (IPropertySource) spec.getExtension(
                    EXTENSION_PROPERTY_SOURCE_NAME,
                    IPropertySource.class);

            result.addSource(source);
        }

        result.addSource(SystemPropertiesPropertySource.getInstance());

        // Lastly, add a final source to handle "factory defaults".

        ResourceBundle bundle =
            ResourceBundle.getBundle("org.apache.tapestry.ConfigurationDefaults");

        result.addSource(new ResourceBundlePropertySource(bundle));

        return result;
    }
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

        return getTemplateEncodingProperty(source);
    }
   
    private IPropertySource getComponentPropertySource(IRequestCycle cycle, IComponent component)
    {
        DelegatingPropertySource source = new DelegatingPropertySource();

        // Search for the encoding property in the following order:
        // First search the component specification
        source.addSource(new PropertyHolderPropertySource(component.getSpecification()));

        // Then search its library specification
        source.addSource(new PropertyHolderPropertySource(component.getNamespace().getSpecification()));

        // Then search the rest of the standard path
        source.addSource(cycle.getEngine().getPropertySource());
       
        return source;
    }
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

     *
     **/

    protected IPropertySource createPropertySource()
    {
        DelegatingPropertySource result = new DelegatingPropertySource();

        result.addSource(new ServletPropertySource(getServletConfig()));
        result.addSource(new ServletContextPropertySource(getServletContext()));
        result.addSource(SystemPropertiesPropertySource.getInstance());

        return result;
    }
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

     *
     **/

    protected IPropertySource createPropertySource()
    {
        DelegatingPropertySource result = new DelegatingPropertySource();

        result.addSource(new ServletPropertySource(getServletConfig()));
        result.addSource(new ServletContextPropertySource(getServletContext()));
        result.addSource(SystemPropertiesPropertySource.getInstance());

        return result;
    }
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

     *
     **/

    protected IPropertySource createPropertySource(RequestContext context)
    {
        DelegatingPropertySource result = new DelegatingPropertySource();

        ApplicationServlet servlet = context.getServlet();
        IApplicationSpecification spec = servlet.getApplicationSpecification();

        result.addSource(new PropertyHolderPropertySource(spec));
        result.addSource(new ServletPropertySource(servlet.getServletConfig()));
        result.addSource(new ServletContextPropertySource(servlet.getServletContext()));

        if (spec.checkExtension(EXTENSION_PROPERTY_SOURCE_NAME))
        {
            IPropertySource source =
                (IPropertySource) spec.getExtension(
                    EXTENSION_PROPERTY_SOURCE_NAME,
                    IPropertySource.class);

            result.addSource(source);
        }

        result.addSource(SystemPropertiesPropertySource.getInstance());

        // Lastly, add a final source to handle "factory defaults".

        ResourceBundle bundle =
            ResourceBundle.getBundle("org.apache.tapestry.ConfigurationDefaults");

        result.addSource(new ResourceBundlePropertySource(bundle));

        return result;
    }
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

        expect(source, "foo", null);
    }

    public void testDelegator()
    {
        DelegatingPropertySource source = new DelegatingPropertySource(buildServletSource());

        source.addSource(SystemPropertiesPropertySource.getInstance());

        expect(source, "java.os", System.getProperty("java.os"));
        expect(source, "alpha", "bravo");
        expect(source, "gamma", null);
    }
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

     *
     **/

    protected IPropertySource createPropertySource(RequestContext context)
    {
        DelegatingPropertySource result = new DelegatingPropertySource();

        ApplicationServlet servlet = context.getServlet();
        IApplicationSpecification spec = servlet.getApplicationSpecification();

        result.addSource(new PropertyHolderPropertySource(spec));
        result.addSource(new ServletPropertySource(servlet.getServletConfig()));
        result.addSource(new ServletContextPropertySource(servlet.getServletContext()));

        if (spec.checkExtension(EXTENSION_PROPERTY_SOURCE_NAME))
        {
            IPropertySource source =
                (IPropertySource) spec.getExtension(
                    EXTENSION_PROPERTY_SOURCE_NAME,
                    IPropertySource.class);

            result.addSource(source);
        }

        result.addSource(SystemPropertiesPropertySource.getInstance());

        // Lastly, add a final source to handle "factory defaults".

        ResourceBundle bundle =
            ResourceBundle.getBundle("org.apache.tapestry.ConfigurationDefaults");

        result.addSource(new ResourceBundlePropertySource(bundle));

        return result;
    }
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

            __CLOVER_328_0.S[7466]++;orderer.add(c, c.getName(), c.getAfter(), c.getBefore());
        }}

        __CLOVER_328_0.S[7467]++;List ordered = orderer.getOrderedObjects();

        __CLOVER_328_0.S[7468]++;DelegatingPropertySource delegate = new DelegatingPropertySource();

        __CLOVER_328_0.S[7469]++;i = ordered.iterator();
        __CLOVER_328_0.S[7470]++;while ((((i.hasNext()) && (++__CLOVER_328_0.CT[1293] != 0)) || (++__CLOVER_328_0.CF[1293] == 0))){
        {
            __CLOVER_328_0.S[7471]++;PropertySourceContribution c = (PropertySourceContribution) i.next();

            __CLOVER_328_0.S[7472]++;delegate.addSource(c.getSource());
        }}

        __CLOVER_328_0.S[7473]++;_delegate = delegate;
    } finally { }}
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

   * @param component the component for which the properties will be looked up
   * @param applicationPropertySource the property source for the application
   * @param locale the locale to be used for localizing the properties
   */
  public DefaultComponentPropertySource(IComponent component, IPropertySource applicationPropertySource, Locale locale) {try { __CLOVER_76_0.M[451]++;
        __CLOVER_76_0.S[1963]++;DelegatingPropertySource source = new DelegatingPropertySource();

        // Search for the encoding property in the following order:
        // First search the component specification
        __CLOVER_76_0.S[1964]++;source.addSource(new PropertyHolderPropertySource(component.getSpecification()));

        // Then search its library specification
        __CLOVER_76_0.S[1965]++;source.addSource(new PropertyHolderPropertySource(component.getNamespace().getSpecification()));

        // Then search the rest of the standard path
        __CLOVER_76_0.S[1966]++;source.addSource(applicationPropertySource);

        __CLOVER_76_0.S[1967]++;if ((((locale != null) && (++__CLOVER_76_0.CT[372] != 0)) || (++__CLOVER_76_0.CF[372] == 0))){
            __CLOVER_76_0.S[1968]++;source = new LocalizedPropertySource(locale, source);}
       
        __CLOVER_76_0.S[1969]++;_degatingPropertySource = source;
View Full Code Here

Examples of org.apache.tapestry.util.DelegatingPropertySource

     *
     * @param context the request context for which this property source will be created
     */
    public DefaultPropertySource(RequestContext context)
    {try { __CLOVER_78_0.M[454]++;
        __CLOVER_78_0.S[1972]++;DelegatingPropertySource result = new DelegatingPropertySource();

        __CLOVER_78_0.S[1973]++;HttpServlet servlet = context.getServlet();
        __CLOVER_78_0.S[1974]++;IApplicationSpecification spec = context.getApplicationSpecification();

        __CLOVER_78_0.S[1975]++;result.addSource(new PropertyHolderPropertySource(spec));
        __CLOVER_78_0.S[1976]++;result.addSource(new ServletPropertySource(servlet.getServletConfig()));
        __CLOVER_78_0.S[1977]++;result.addSource(new ServletContextPropertySource(servlet.getServletContext()));

        __CLOVER_78_0.S[1978]++;if ((((spec.checkExtension(EXTENSION_PROPERTY_SOURCE_NAME)) && (++__CLOVER_78_0.CT[373] != 0)) || (++__CLOVER_78_0.CF[373] == 0))){
        {
            __CLOVER_78_0.S[1979]++;IPropertySource source =
                (IPropertySource) spec.getExtension(
                    EXTENSION_PROPERTY_SOURCE_NAME,
                    IPropertySource.class);

            __CLOVER_78_0.S[1980]++;result.addSource(source);
        }}

        __CLOVER_78_0.S[1981]++;result.addSource(SystemPropertiesPropertySource.getInstance());

        // Lastly, add a final source to handle "factory defaults".

        __CLOVER_78_0.S[1982]++;ResourceBundle bundle =
            ResourceBundle.getBundle("org.apache.tapestry.ConfigurationDefaults");

        __CLOVER_78_0.S[1983]++;result.addSource(new ResourceBundlePropertySource(bundle));

        __CLOVER_78_0.S[1984]++;_degatingPropertySource = result;
    } finally { }}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.