Interface ComponentResourceLocator

  • All Known Implementing Classes:
    DefaultComponentResourceLocator

    public interface ComponentResourceLocator
    A central service that encapsulates the rules for locating resources for components. The service can be overridden, or simply decorated, to implement customized rules for locating templates across one or more axes; this is the approach used to skin Tapestry applications.
    Since:
    5.3
    See Also:
    ComponentTemplateLocator
    • Method Detail

      • locateTemplate

        Resource locateTemplate​(ComponentModel model,
                                ComponentResourceSelector selector)
        Locates the template for a component (including pages and base classes). The implementation takes into account the locale and other axes specified by the selector. If the method returns null, then the component will have no template (which is common for components, but rare for pages).
        Parameters:
        model - defines the component, including its base resource.
        selector - used to identify locale, etc., for the template
        Returns:
        Resource for component template, or null if not found
      • locateMessageCatalog

        List<ResourcelocateMessageCatalog​(Resource baseResource,
                                            ComponentResourceSelector selector)
        Locates the properties files that make up the message catalog for a specific component. The properties files are returned in order of specificity: the properties provided by the first resource override properties in later resources. Only resources specific to the class associated with the model should be concerned (message inheritance from base classes is handled by Tapestry).
        Parameters:
        baseResource - the resource for the base component properties file (i.e., with the ".properties" file extension)
        selector - defined the locale and other axes used to locate individual properties files
        Returns:
        list of properties file Resources
        See Also:
        LocalizedNameGenerator