Class ComponentPageElementResourcesImpl
java.lang.Object
org.apache.tapestry5.internal.structure.ComponentPageElementResourcesImpl
- All Implemented Interfaces:
ComponentPageElementResources,OperationTracker,ContextValueEncoder
public class ComponentPageElementResourcesImpl
extends Object
implements ComponentPageElementResources
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tapestry5.ioc.OperationTracker
OperationTracker.NonLoggableException -
Constructor Summary
ConstructorsConstructorDescriptionComponentPageElementResourcesImpl(ComponentResourceSelector selector, ComponentMessagesSource componentMessagesSource, TypeCoercer typeCoercer, ComponentClassCache componentClassCache, ContextValueEncoder contextValueEncoder, LinkSource linkSource, RequestPageCache requestPageCache, ComponentClassResolver componentClassResolver, LoggerSource loggerSource, OperationTracker tracker, PerthreadManager perThreadManager, boolean productionMode, boolean componentTracingEnabled, RequestGlobals requestGlobals) -
Method Summary
Modifier and TypeMethodDescription<S,T> T Performs a coercion from an input type to a desired output type.createComponentEventLink(ComponentResources resources, String eventType, boolean forForm, Object... context) Creates a link on behalf of a component.createPageRenderLink(Class pageClass, boolean override, Object... context) Creates a page render request link to render a specific page.createPageRenderLink(String pageName, boolean override, Object... context) Creates a page render request link to render a specific page.<T> PerThreadValue<T>Wrapper aroundPerthreadManager.createValue().org.slf4j.LoggergetEventLogger(org.slf4j.Logger componentLogger) Returns the event logger for the provided component logger.getMessages(ComponentModel componentModel) Used to obtain aMessagesinstance for a particular component.Returns the selector associated with this resources.<T> TAs withOperationTracker.run(String, Runnable), but the operation may return a value.booleanReturns true if component element tracing is enabled.<T> Tperform(String description, IOOperation<T> operation) As withOperationTracker.invoke(String, Invokable), but the operation may throw anIOException.voidExecutes the operation.Gets the Class instance for then give name.Converts a context value into a client-side string (that will ultimately be encoded into a URL).<T> TConverts a client value back into a server-side object.
-
Constructor Details
-
ComponentPageElementResourcesImpl
public ComponentPageElementResourcesImpl(ComponentResourceSelector selector, ComponentMessagesSource componentMessagesSource, TypeCoercer typeCoercer, ComponentClassCache componentClassCache, ContextValueEncoder contextValueEncoder, LinkSource linkSource, RequestPageCache requestPageCache, ComponentClassResolver componentClassResolver, LoggerSource loggerSource, OperationTracker tracker, PerthreadManager perThreadManager, boolean productionMode, boolean componentTracingEnabled, RequestGlobals requestGlobals)
-
-
Method Details
-
getSelector
Description copied from interface:ComponentPageElementResourcesReturns the selector associated with this resources.- Specified by:
getSelectorin interfaceComponentPageElementResources
-
getMessages
Description copied from interface:ComponentPageElementResourcesUsed to obtain aMessagesinstance 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).- Specified by:
getMessagesin interfaceComponentPageElementResources- Returns:
- the message catalog for the component, in the indicated locale
- See Also:
-
coerce
Description copied from interface:ComponentPageElementResourcesPerforms 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.- Specified by:
coercein interfaceComponentPageElementResources- Type Parameters:
S- source type (input)T- target type (output)targetType- defines the target type- Returns:
- the coerced value
- See Also:
-
toClass
Description copied from interface:ComponentPageElementResourcesGets the Class instance for then give name.- Specified by:
toClassin interfaceComponentPageElementResources- Parameters:
className- fully qualified class name- Returns:
- the class instance
- See Also:
-
createComponentEventLink
public Link createComponentEventLink(ComponentResources resources, String eventType, boolean forForm, Object... context) Description copied from interface:ComponentPageElementResourcesCreates a link on behalf of a component.- Specified by:
createComponentEventLinkin interfaceComponentPageElementResources- 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
-
createPageRenderLink
Description copied from interface:ComponentPageElementResourcesCreates a page render request link to render a specific page.- Specified by:
createPageRenderLinkin interfaceComponentPageElementResources- 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
-
createPageRenderLink
Description copied from interface:ComponentPageElementResourcesCreates 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).- Specified by:
createPageRenderLinkin interfaceComponentPageElementResources- 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
-
getEventLogger
Description copied from interface:ComponentPageElementResourcesReturns 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.- Specified by:
getEventLoggerin interfaceComponentPageElementResources- Parameters:
componentLogger- provides base name for logger- Returns:
- the logger
-
toClient
Description copied from interface:ContextValueEncoderConverts a context value into a client-side string (that will ultimately be encoded into a URL).- Specified by:
toClientin interfaceContextValueEncoder- Parameters:
value- to convert (may not be null)- Returns:
- string representation of the value
- See Also:
-
toValue
Description copied from interface:ContextValueEncoderConverts a client value back into a server-side object.- Specified by:
toValuein interfaceContextValueEncoder- Parameters:
requiredType- required type to convert the string toclientValue- value obtained from context passed from client- Returns:
- the client value converted or coerced into a server value
- See Also:
-
invoke
Description copied from interface:OperationTrackerAs withOperationTracker.run(String, Runnable), but the operation may return a value.- Specified by:
invokein interfaceOperationTracker- Parameters:
description- used if there is an exceptionoperation- to invoke- Returns:
- result of operation
-
perform
Description copied from interface:OperationTrackerAs withOperationTracker.invoke(String, Invokable), but the operation may throw anIOException.- Specified by:
performin interfaceOperationTracker- Parameters:
description- used if there is an exception (outside of IOException)operation- to perform- Returns:
- result of operation
- Throws:
IOException
-
run
Description copied from interface:OperationTrackerExecutes the operation. If the operation throws aRuntimeExceptionit will be logged and rethrown wrapped as aOperationException.- Specified by:
runin interfaceOperationTracker- Parameters:
description- used if there is an exceptionoperation- to execute
-
createPerThreadValue
Description copied from interface:ComponentPageElementResourcesWrapper aroundPerthreadManager.createValue().- Specified by:
createPerThreadValuein interfaceComponentPageElementResources
-
isRenderTracingEnabled
Description copied from interface:ComponentPageElementResourcesReturns true if component element tracing is enabled. When enabled, rendering of the component produces additional comments to identify what component and stage is rendering.- Specified by:
isRenderTracingEnabledin interfaceComponentPageElementResources
-