public class ComponentPageElementResourcesImpl extends Object implements ComponentPageElementResources
| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
<S,T> T |
coerce(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 around
PerthreadManager.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 a
Messages instance for a particular component. |
ComponentResourceSelector |
getSelector()
Returns the selector associated with this resources.
|
<T> T |
invoke(String description,
Invokable<T> operation)
As with
OperationTracker.run(String, Runnable), but the operation may return a value. |
boolean |
isRenderTracingEnabled()
Returns true if component element tracing is enabled.
|
<T> T |
perform(String description,
IOOperation<T> operation)
As with
OperationTracker.invoke(String, Invokable), but the operation may throw an IOException. |
void |
run(String description,
Runnable operation)
Executes the operation.
|
Class |
toClass(String className)
Gets the Class instance for then give name.
|
String |
toClient(Object value)
Converts a context value into a client-side string (that will ultimately be encoded into a URL).
|
<T> T |
toValue(Class<T> requiredType,
String clientValue)
Converts a client value back into a server-side object.
|
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)
public ComponentResourceSelector getSelector()
ComponentPageElementResourcesgetSelector in interface ComponentPageElementResourcespublic Messages getMessages(ComponentModel componentModel)
ComponentPageElementResourcesMessages 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).getMessages in interface ComponentPageElementResourcesComponentMessagesSourcepublic <S,T> T coerce(S input, Class<T> targetType)
ComponentPageElementResourcescoerce in interface ComponentPageElementResourcesS - source type (input)T - target type (output)targetType - defines the target typeTypeCoercerpublic Class toClass(String className)
ComponentPageElementResourcestoClass in interface ComponentPageElementResourcesclassName - fully qualified class nameComponentClassCachepublic Link createComponentEventLink(ComponentResources resources, String eventType, boolean forForm, Object... context)
ComponentPageElementResourcescreateComponentEventLink in interface ComponentPageElementResourcesresources - resources for the componenteventType - type of event to createforForm - true if generating for a form submissioncontext - additional event context associated with the linkpublic Link createPageRenderLink(String pageName, boolean override, Object... context)
ComponentPageElementResourcescreatePageRenderLink in interface ComponentPageElementResourcespageName - 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 pagepublic Link createPageRenderLink(Class pageClass, boolean override, Object... context)
ComponentPageElementResourcescreatePageRenderLink in interface ComponentPageElementResourcespageClass - 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 pagepublic org.slf4j.Logger getEventLogger(org.slf4j.Logger componentLogger)
ComponentPageElementResourcesgetEventLogger in interface ComponentPageElementResourcescomponentLogger - provides base name for loggerpublic String toClient(Object value)
ContextValueEncodertoClient in interface ContextValueEncodervalue - to convert (may not be null)ValueEncoder.toClient(Object)public <T> T toValue(Class<T> requiredType, String clientValue)
ContextValueEncodertoValue in interface ContextValueEncoderrequiredType - required type to convert the string toclientValue - value obtained from context passed from clientValueEncoder.toValue(String)public <T> T invoke(String description, Invokable<T> operation)
OperationTrackerOperationTracker.run(String, Runnable), but the operation may return a value.invoke in interface OperationTrackerdescription - used if there is an exceptionoperation - to invokepublic <T> T perform(String description, IOOperation<T> operation) throws IOException
OperationTrackerOperationTracker.invoke(String, Invokable), but the operation may throw an IOException.perform in interface OperationTrackerdescription - used if there is an exception (outside of IOException)operation - to performIOExceptionpublic void run(String description, Runnable operation)
OperationTrackerRuntimeException it will be logged and rethrown
wrapped as a OperationException.run in interface OperationTrackerdescription - used if there is an exceptionoperation - to executepublic <T> PerThreadValue<T> createPerThreadValue()
ComponentPageElementResourcesPerthreadManager.createValue().createPerThreadValue in interface ComponentPageElementResourcespublic boolean isRenderTracingEnabled()
ComponentPageElementResourcesisRenderTracingEnabled in interface ComponentPageElementResources5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.