org.apache.tapestry5.services
Interface ComponentSource

All Known Implementing Classes:
ComponentSourceImpl

public interface ComponentSource

Used by classes that need to retrieve a component by its complete id, or a page by its logical page name or root component class. The complete id is the logical name of the containing page, a colon, and the nested component id. It may also just be the page name (for the root component of a page).


Method Summary
 Component getComponent(String completeId)
          Gets a component by its complete id.
 Component getPage(Class pageClass)
          A convienience for obtaining a page instance via a class instance.
 Component getPage(String pageName)
          Returns the page identified by its logical page name.
 

Method Detail

getComponent

Component getComponent(String completeId)
Gets a component by its complete id. If the component id is for a mixin, then the mixin attached to the component will be returned. A mixin's complete id is its container's complete id, suffixed with "$" and the mixin's id (its simple class name).

Parameters:
completeId - complete component id (case insensitive)
Returns:
the component
Throws:
IllegalArgumentException - if the component can not be found
See Also:
ComponentResourcesCommon.getCompleteId()

getPage

Component getPage(String pageName)
Returns the page identified by its logical page name. A logical page name is the short form of a page name often emebedded into URLs.

Parameters:
pageName - the logical page name
Returns:
the corresponding page's root component
Throws:
IllegalArgumentException - if the page can not be found

getPage

Component getPage(Class pageClass)
A convienience for obtaining a page instance via a class instance. This is provided so as to be refactoring safe. The pageClass is simply converted to a class name and this is used to locate a page instance.

Parameters:
pageClass - used to locate the page instance
Returns:
the page instance


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.