Interface ComponentPageElementResources
-
- All Superinterfaces:
ContextValueEncoder
,OperationTracker
- All Known Implementing Classes:
ComponentPageElementResourcesImpl
public interface ComponentPageElementResources extends ContextValueEncoder, OperationTracker
Provides access to common methods of various services, needed by implementations ofComponentPageElement
andInternalComponentResources
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <S,T>
Tcoerce(S input, Class<T> targetType)
Performs a coercion from an input type to a desired output type.Link
createComponentEventLink(ComponentResources resources, String eventType, boolean forForm, Object... context)
Creates a link on behalf of a component.Link
createPageRenderLink(Class pageClass, boolean override, Object... context)
Creates a page render request link to render a specific page.Link
createPageRenderLink(String pageName, boolean override, Object... context)
Creates a page render request link to render a specific page.<T> PerThreadValue<T>
createPerThreadValue()
Wrapper aroundPerthreadManager.createValue()
.org.slf4j.Logger
getEventLogger(org.slf4j.Logger componentLogger)
Returns the event logger for the provided component logger.Messages
getMessages(ComponentModel componentModel)
Used to obtain aMessages
instance for a particular component.ComponentResourceSelector
getSelector()
Returns the selector associated with this resources.boolean
isRenderTracingEnabled()
Returns true if component element tracing is enabled.Class
toClass(String className)
Gets the Class instance for then give name.-
Methods inherited from interface org.apache.tapestry5.services.ContextValueEncoder
toClient, toValue
-
Methods inherited from interface org.apache.tapestry5.ioc.OperationTracker
invoke, perform, run
-
-
-
-
Method Detail
-
getSelector
ComponentResourceSelector getSelector()
Returns the selector associated with this resources.- Since:
- 5.3
-
getMessages
Messages getMessages(ComponentModel componentModel)
Used to obtain aMessages
instance for a particular component. If the component extends from another component, then its localized properties will merge with its parent's properties (with the subclass overriding the super class on any conflicts).- Parameters:
componentModel
-- Returns:
- the message catalog for the component, in the indicated locale
- See Also:
ComponentMessagesSource
-
coerce
<S,T> T coerce(S input, Class<T> targetType)
Performs a coercion from an input type to a desired output type. When the target type is a primitive, the actual conversion will be to the equivalent wrapper type. In some cases, the TypeCoercer will need to search for an appropriate coercion, and may even combine existing coercions to form new ones; in those cases, the results of the search are cached.- Type Parameters:
S
- source type (input)T
- target type (output)- Parameters:
input
-targetType
- defines the target type- Returns:
- the coerced value
- See Also:
TypeCoercer
-
toClass
Class toClass(String className)
Gets the Class instance for then give name.- Parameters:
className
- fully qualified class name- Returns:
- the class instance
- See Also:
ComponentClassCache
-
createComponentEventLink
Link createComponentEventLink(ComponentResources resources, String eventType, boolean forForm, Object... context)
Creates a link on behalf of a component.- Parameters:
resources
- resources for the componenteventType
- type of event to createforForm
- true if generating for a form submissioncontext
- additional event context associated with the link- Returns:
- the link
- Since:
- 5.1.0.0
-
createPageRenderLink
Link createPageRenderLink(String pageName, boolean override, Object... context)
Creates a page render request link to render a specific page.- Parameters:
pageName
- the logical name of the page to link tooverride
- if true, the context is used even if empty (normally, the target page is allowed to passivate, providing a context, when the provided context is empty)context
- the activation context for the page. If omitted, the activation context is obtained from the target page- Returns:
- link for a render request to the targetted page
- Since:
- 5.1.0.0
-
createPageRenderLink
Link createPageRenderLink(Class pageClass, boolean override, Object... context)
Creates a page render request link to render a specific page. Using a page class, rather than a page name, is more refactoring safe (in the even the page is renamed or moved).- Parameters:
pageClass
- identifies the page to link tooverride
- if true, the context is used even if empty (normally, the target page is allowed to passivate, providing a context, when the provided context is empty)context
- the activation context for the page. If omitted, the activation context is obtained from the target page- Returns:
- link for a render request to the targetted page
- Since:
- 5.1
-
getEventLogger
org.slf4j.Logger getEventLogger(org.slf4j.Logger componentLogger)
Returns the event logger for the provided component logger. The event logger is based on the component logger's name (which matches the component class name) with a "tapestry..events." prefix.- Parameters:
componentLogger
- provides base name for logger- Returns:
- the logger
-
createPerThreadValue
<T> PerThreadValue<T> createPerThreadValue()
Wrapper aroundPerthreadManager.createValue()
.- Since:
- 5.2.0
-
isRenderTracingEnabled
boolean isRenderTracingEnabled()
Returns true if component element tracing is enabled. When enabled, rendering of the component produces additional comments to identify what component and stage is rendering.- Since:
- 5.4
-
-