Class InternalComponentResourcesImpl
- java.lang.Object
-
- org.apache.tapestry5.commons.internal.util.LockSupport
-
- org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl
-
- All Implemented Interfaces:
Locatable,ComponentResources,ComponentResourcesCommon,InternalComponentResources,InternalComponentResourcesCommon,RenderCommand
public class InternalComponentResourcesImpl extends LockSupport implements InternalComponentResources
The bridge between a component and itsComponentPageElement, that supplies all kinds of resources to the component, including access to its parameters, parameter bindings, and persistent field data.
-
-
Constructor Summary
Constructors Constructor Description InternalComponentResourcesImpl(Page page, ComponentPageElement element, ComponentResources containerResources, ComponentPageElementResources elementResources, java.lang.String completeId, java.lang.String nestedId, Instantiator componentInstantiator, boolean mixin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPageLifecycleListener(PageLifecycleListener listener)Adds a listener object that will be notified about page lifecycle events.voidaddPageResetListener(PageResetListener listener)voidbindParameter(java.lang.String parameterName, Binding binding)Used during construction of the page to identify the binding for a particular parameter.LinkcreateEventLink(java.lang.String eventType, java.lang.Object... context)Creates a component event request link as a callback for this component.LinkcreateFormEventLink(java.lang.String eventType, java.lang.Object... context)Creates a component event request link as a callback for this component.voiddiscardPersistentFieldChanges()Discards all persistent field changes for the page containing the component.BlockfindBlock(java.lang.String blockId)As withComponentResourcesCommon.getBlock(String), but returns null if the block is not found.AnnotationProvidergetAnnotationProvider(java.lang.String parameterName)Returns an annotation provider, used to obtain annotations related to the parameter.ResourcegetBaseResource()Returns the base resource for the component, which will represent the class's location within the classpath (this is used to resolve relative assets).BindinggetBinding(java.lang.String parameterName)Returns the binding for the given parameter name, or null.BlockgetBlock(java.lang.String blockId)Returns a block from the component's template, referenced by its id.BlockgetBlockParameter(java.lang.String parameterName)Used to access an informal parameter that's a Block.BlockgetBody()Returns the body of this component as a (possibly empty) block.java.lang.reflect.TypegetBoundGenericType(java.lang.String parameterName)Returns the generic type of the bound parameter, or null if the parameter is not bound.java.lang.ClassgetBoundType(java.lang.String parameterName)Returns the actual type of the bound parameter, or null if the parameter is not bound.java.lang.StringgetCompleteId()Returns a string consisting of the logical name of the containing page, and thenested idof this component, separated by a colon.ComponentgetComponent()Returns the component this object provides resources for.ComponentModelgetComponentModel()Returns the component model object that defines the behavior of the component.ComponentgetContainer()Returns the component which contains this component, or null for the root component.MessagesgetContainerMessages()Returns theMessagesfrom the container, or null if this is the root component (with no container).ComponentResourcesgetContainerResources()Returns theComponentResourcesfor the container, or null if the this is the root component (that has no container).java.lang.StringgetElementName()Returns the name of element that represents the component in its template, or null if not known.java.lang.StringgetElementName(java.lang.String defaultElementName)Returns the name of element that represents the component in its template, or the provided default element name if the element was a component type (in the Tapestry namespace).ComponentgetEmbeddedComponent(java.lang.String embeddedId)Returns an embedded component, given the component's id.java.lang.ObjectgetFieldChange(java.lang.String fieldName)Get the current persisted value of the field.java.lang.StringgetId()Returns the simple (or local) id of the component.<T> TgetInformalParameter(java.lang.String name, java.lang.Class<T> type)Reads an informal parameter and coerces the bound value to the indicated type.java.util.Map<java.lang.String,Binding>getInformalParameterBindings()Constructs a map linking informal parameters to the corresponding bindings.java.util.List<java.lang.String>getInformalParameterNames()Returns a list of the names of any informal parameters bound to this component.java.util.LocalegetLocale()Returns the locale for the page containing this component.LocationgetLocation()Returns the location associated with this object for error reporting purposes.org.slf4j.LoggergetLogger()Returns the log instance associated with the component (which is based on the component or mixin's class name).MessagesgetMessages()Returns the message catalog for this component.ComponentgetMixinByClassName(java.lang.String mixinClassName)Returns the mixin instance for the fully qualfied mixin class name.java.lang.StringgetNestedId()Return a string consisting the concatenated ids of all containing components, separated by periods.ComponentgetPage()Returns the page that contains this component.PageLifecycleCallbackHubgetPageLifecycleCallbackHub()Provides access to an object that can be used to register callbacks for page lifecycle events.java.lang.StringgetPageName()Returns the logical name of the page containing this component.<T extends java.lang.annotation.Annotation>
TgetParameterAnnotation(java.lang.String parameterName, java.lang.Class<T> annotationType)Obtains an annotation provided by a parameter.ParameterConduitgetParameterConduit(java.lang.String parameterName)Gets a previously stored ParameterConduit, allowing PCs to be shared between a component and a mixin of that component.java.lang.StringgetPropertyName(java.lang.String parameterName)Returns the name of the bound property ifPropBindingis used and the expression points to a property on a bean (e.g.java.lang.ObjectgetRenderVariable(java.lang.String name)Returns a previously stored render variable.ComponentResourceSelectorgetResourceSelector()Returns the selector used when constructing the component and its containing page.booleanhasBody()Returns true if the element has a body and false otherwise.booleanhasFieldChange(java.lang.String fieldName)Checks to see if there is a value stored for the indicated field.booleanisBound(java.lang.String parameterName)Returns true if the named parameter is bound, false if not.booleanisLoaded()Returns true if the component has finished loading.booleanisMixin()Returns true if these resources represent a mixin to another component.booleanisRendering()Returns true if the component is currently rendering, false otherwise.voidpersistFieldChange(java.lang.String fieldName, java.lang.Object newValue)Posts a change to a persistent field.voidpostRenderCleanup()Allows the resources to cleanup any render-time only data.voidremovePageLifecycleListener(PageLifecycleListener listener)Removes a previously added listener.voidrender(MarkupWriter writer, RenderQueue queue)Invoked on an object to request that it render itself.voidrenderInformalParameters(MarkupWriter writer)Indentifies all parameters that are not formal parameters and writes each as a attribute/value pair into the current element of the markup writer.voidsetParameterConduit(java.lang.String parameterName, ParameterConduit conduit)Stores a ParameterConduit for later access.voidstoreRenderVariable(java.lang.String name, java.lang.Object value)Stores a render variable, accessible with the provided name.java.lang.StringtoString()booleantriggerContextEvent(java.lang.String eventType, EventContext context, ComponentEventCallback callback)Triggers a component event.booleantriggerEvent(java.lang.String eventType, java.lang.Object[] context, ComponentEventCallback handler)A convenience method for invokingComponentResourcesCommon.triggerContextEvent(String, EventContext , ComponentEventCallback).-
Methods inherited from class org.apache.tapestry5.commons.internal.util.LockSupport
acquireReadLock, downgradeWriteLockToReadLock, releaseReadLock, releaseWriteLock, takeWriteLock, upgradeReadLockToWriteLock
-
-
-
-
Constructor Detail
-
InternalComponentResourcesImpl
public InternalComponentResourcesImpl(Page page, ComponentPageElement element, ComponentResources containerResources, ComponentPageElementResources elementResources, java.lang.String completeId, java.lang.String nestedId, Instantiator componentInstantiator, boolean mixin)
-
-
Method Detail
-
isMixin
public boolean isMixin()
Description copied from interface:ComponentResourcesReturns true if these resources represent a mixin to another component. The component is the container of this resources.- Specified by:
isMixinin interfaceComponentResources
-
getLocation
public Location getLocation()
Description copied from interface:LocatableReturns the location associated with this object for error reporting purposes.- Specified by:
getLocationin interfaceLocatable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getComponentModel
public ComponentModel getComponentModel()
Description copied from interface:ComponentResourcesReturns the component model object that defines the behavior of the component.- Specified by:
getComponentModelin interfaceComponentResources
-
getEmbeddedComponent
public Component getEmbeddedComponent(java.lang.String embeddedId)
Description copied from interface:ComponentResourcesReturns an embedded component, given the component's id.- Specified by:
getEmbeddedComponentin interfaceComponentResources- Parameters:
embeddedId- selects the embedded component (case is ignored)
-
getFieldChange
public java.lang.Object getFieldChange(java.lang.String fieldName)
Description copied from interface:InternalComponentResourcesGet the current persisted value of the field.- Specified by:
getFieldChangein interfaceInternalComponentResources- Parameters:
fieldName- the name of the field to access- Returns:
- the value stored for the field, or null if no value is currently stored
-
getId
public java.lang.String getId()
Description copied from interface:ComponentResourcesCommonReturns the simple (or local) id of the component. The id will be unique within the component's immediate container. For a page's root component, the value null is returned.- Specified by:
getIdin interfaceComponentResourcesCommon
-
hasFieldChange
public boolean hasFieldChange(java.lang.String fieldName)
Description copied from interface:InternalComponentResourcesChecks to see if there is a value stored for the indicated field.- Specified by:
hasFieldChangein interfaceInternalComponentResources
-
createEventLink
public Link createEventLink(java.lang.String eventType, java.lang.Object... context)
Description copied from interface:ComponentResourcesCommonCreates a component event request link as a callback for this component. The event type and context (as well as the page name and nested component id) will be encoded into a URL. A request for the URL will ComponentResourcesCommon.triggerEvent(String, Object[], org.apache.tapestry5.ComponentEventCallback) trigger} the named event on the component.- Specified by:
createEventLinkin interfaceComponentResourcesCommon- Parameters:
eventType- the type of event to be triggered. Event types should be Java identifiers (contain only letters, numbers and the underscore).context- additional objects to be encoded into the path portion of the link; each is converted to a string and URI encoded- Returns:
- link object for the callback
-
createFormEventLink
public Link createFormEventLink(java.lang.String eventType, java.lang.Object... context)
Description copied from interface:ComponentResourcesCommonCreates a component event request link as a callback for this component. The event type and context (as well as the page name and nested component id) will be encoded into a URL. A request for the URL will ComponentResourcesCommon.triggerEvent(String, Object[], org.apache.tapestry5.ComponentEventCallback) trigger} the named event on the component. This is only used for form submission events, as extra data may be encoded in the form as hidden fields.- Specified by:
createFormEventLinkin interfaceComponentResourcesCommon- Parameters:
eventType- the type of event to be triggered. Event types should be Java identifiers (contain only letters, numbers and the underscore).context- additional objects to be encoded into the path portion of the link; each is converted to a string and URI encoded- Returns:
- link object for the callback
-
discardPersistentFieldChanges
public void discardPersistentFieldChanges()
Description copied from interface:ComponentResourcesDiscards all persistent field changes for the page containing the component. Changes are eliminated from persistent storage (such as theSession) which will take effect in the next request (the attached page instance is not affected).- Specified by:
discardPersistentFieldChangesin interfaceComponentResources
-
getElementName
public java.lang.String getElementName()
Description copied from interface:ComponentResourcesReturns the name of element that represents the component in its template, or null if not known.- Specified by:
getElementNamein interfaceComponentResources- Returns:
- the element name or null
-
getInformalParameterNames
public java.util.List<java.lang.String> getInformalParameterNames()
Description copied from interface:ComponentResourcesReturns a list of the names of any informal parameters bound to this component.- Specified by:
getInformalParameterNamesin interfaceComponentResources- Returns:
- the name sorted alphabetically
- See Also:
SupportsInformalParameters
-
getInformalParameter
public <T> T getInformalParameter(java.lang.String name, java.lang.Class<T> type)
Description copied from interface:ComponentResourcesReads an informal parameter and coerces the bound value to the indicated type.- Specified by:
getInformalParameterin interfaceComponentResources- Parameters:
name- name of informal parametertype- output value type- Returns:
- instance of type
-
getBody
public Block getBody()
Description copied from interface:ComponentResourcesCommonReturns the body of this component as a (possibly empty) block. When invoked on a mixin, returns the containing component's body.- Specified by:
getBodyin interfaceComponentResourcesCommon
-
hasBody
public boolean hasBody()
Description copied from interface:ComponentResourcesCommonReturns true if the element has a body and false otherwise. Only components may have a body; pages and mixins will return false.- Specified by:
hasBodyin interfaceComponentResourcesCommon
-
getCompleteId
public java.lang.String getCompleteId()
Description copied from interface:ComponentResourcesCommonReturns a string consisting of the logical name of the containing page, and thenested idof this component, separated by a colon. I.e., "MyPage:foo.bar.baz". For a page, returns just the page's name. This value is often used to obtain an equivalent component instance in a later request.- Specified by:
getCompleteIdin interfaceComponentResourcesCommon- See Also:
ComponentSource.getComponent(String)
-
getComponent
public Component getComponent()
Description copied from interface:ComponentResourcesReturns the component this object provides resources for.- Specified by:
getComponentin interfaceComponentResources
-
isBound
public boolean isBound(java.lang.String parameterName)
Description copied from interface:ComponentResourcesReturns true if the named parameter is bound, false if not.- Specified by:
isBoundin interfaceComponentResources
-
getParameterAnnotation
public <T extends java.lang.annotation.Annotation> T getParameterAnnotation(java.lang.String parameterName, java.lang.Class<T> annotationType)
Description copied from interface:ComponentResourcesObtains an annotation provided by a parameter.- Specified by:
getParameterAnnotationin interfaceComponentResources- Parameters:
parameterName- name of parameter to search for the annotationannotationType- the type of annotation- Returns:
- the annotation if found or null otherwise
-
isRendering
public boolean isRendering()
Description copied from interface:ComponentResourcesCommonReturns true if the component is currently rendering, false otherwise. This is most often used to determine if parameter values should be cached.- Specified by:
isRenderingin interfaceComponentResourcesCommon
-
triggerEvent
public boolean triggerEvent(java.lang.String eventType, java.lang.Object[] context, ComponentEventCallback handler)
Description copied from interface:ComponentResourcesCommonA convenience method for invokingComponentResourcesCommon.triggerContextEvent(String, EventContext , ComponentEventCallback). Wraps the context values into anEventContext.- Specified by:
triggerEventin interfaceComponentResourcesCommon- Parameters:
eventType- event type (as determined from the request, or otherwise by design)context- Values that may be provided to the event handler method as method parameters, or null if no context values are availablehandler- the handler to be informed of the result, or null if the event is a notification that does not support return values from event handler methods (the value true is allowed even if the handler is null).- Returns:
- true if any event handler was invoked (even if no event handler method returns a non-null value)
- See Also:
OnEventWorker,OnEvent
-
triggerContextEvent
public boolean triggerContextEvent(java.lang.String eventType, EventContext context, ComponentEventCallback callback)
Description copied from interface:ComponentResourcesCommonTriggers a component event. A search for an event handling method will occur, first in the component, then its container, and so on. When a matching event handler method is located, it is invoked. If the method returns a value, the value is passed to the callback (if callback is null, then it is an error for a method to return a non-null value). Resolution of event type to event handler methods is case insensitive.- Specified by:
triggerContextEventin interfaceComponentResourcesCommon- Parameters:
eventType- event type (as determined from the request, or otherwise by design)context- the context (as extracted from the request, or provided by the triggering component); these values may be provided to event handler methods via their parameters (may not be null)callback- the handler to be informed of the result, or null if the event is a notification that does not support return values from event handler methods (the value true is allowed even if the handler is null).- Returns:
- true if any event handler was invoked (even if no event handler method returns a non-null value)
- See Also:
OnEventWorker,OnEvent
-
getNestedId
public java.lang.String getNestedId()
Description copied from interface:ComponentResourcesCommonReturn a string consisting the concatenated ids of all containing components, separated by periods. In addition, nested ids are always all lower case. I.e., "foo.bar.baz". Returns null for the root component of a page.- Specified by:
getNestedIdin interfaceComponentResourcesCommon
-
getPage
public Component getPage()
Description copied from interface:ComponentResourcesReturns the page that contains this component. Technically, the page itself is an internal object in Tapestry and this returns the root component of the actual page, but from an application developer point of view, this is the page.- Specified by:
getPagein interfaceComponentResources
-
isLoaded
public boolean isLoaded()
Description copied from interface:InternalComponentResourcesCommonReturns true if the component has finished loading. Initially, this value will be false.- Specified by:
isLoadedin interfaceInternalComponentResourcesCommon- See Also:
PageLifecycleListener.containingPageDidLoad()
-
persistFieldChange
public void persistFieldChange(java.lang.String fieldName, java.lang.Object newValue)
Description copied from interface:InternalComponentResourcesPosts a change to a persistent field. If the component is still loading, then this change is ignored. Otherwise, it is propagated, via thepageto thePersistentFieldManager.- Specified by:
persistFieldChangein interfaceInternalComponentResources
-
bindParameter
public void bindParameter(java.lang.String parameterName, Binding binding)
Description copied from interface:InternalComponentResourcesCommonUsed during construction of the page to identify the binding for a particular parameter.- Specified by:
bindParameterin interfaceInternalComponentResourcesCommon
-
getBoundType
public java.lang.Class getBoundType(java.lang.String parameterName)
Description copied from interface:ComponentResourcesReturns the actual type of the bound parameter, or null if the parameter is not bound. This is primarily used with property bindings, and is used to determine the actual type of the property, rather than the type of parameter (remember that type coercion automatically occurs, which can mask significant differences between the parameter type and the bound property type).- Specified by:
getBoundTypein interfaceComponentResources- Parameters:
parameterName- used to select the parameter (case is ignored)- Returns:
- the type of the bound parameter, or null if the parameter is not bound
- See Also:
Binding.getBindingType()
-
getBoundGenericType
public java.lang.reflect.Type getBoundGenericType(java.lang.String parameterName)
Description copied from interface:ComponentResourcesReturns the generic type of the bound parameter, or null if the parameter is not bound. This is useful for when the parameter is bound to a generic property (eg java.util.List) to determine the element type.- Specified by:
getBoundGenericTypein interfaceComponentResources- Parameters:
parameterName- used to select the parameter (case is ignored)- Returns:
- the generic type of the bound parameter, or null if the parameter is not bound
- See Also:
Binding.getBindingType()
-
getBinding
public Binding getBinding(java.lang.String parameterName)
Description copied from interface:InternalComponentResourcesCommonReturns the binding for the given parameter name, or null.- Specified by:
getBindingin interfaceInternalComponentResourcesCommon- Parameters:
parameterName- name of component parameter- Returns:
- binding if bound, or null
-
getAnnotationProvider
public AnnotationProvider getAnnotationProvider(java.lang.String parameterName)
Description copied from interface:ComponentResourcesReturns an annotation provider, used to obtain annotations related to the parameter.- Specified by:
getAnnotationProviderin interfaceComponentResources- Parameters:
parameterName- used to select the parameter (case is ignored)- Returns:
- the annotation provider, or null if the parameter is not bound
-
getLogger
public org.slf4j.Logger getLogger()
Description copied from interface:ComponentResourcesCommonReturns the log instance associated with the component (which is based on the component or mixin's class name).- Specified by:
getLoggerin interfaceComponentResourcesCommon- See Also:
ComponentModel.getLogger()
-
getMixinByClassName
public Component getMixinByClassName(java.lang.String mixinClassName)
Description copied from interface:InternalComponentResourcesCommonReturns the mixin instance for the fully qualfied mixin class name.- Specified by:
getMixinByClassNamein interfaceInternalComponentResourcesCommon- Parameters:
mixinClassName- fully qualified class name- Returns:
- IllegalArgumentException if no such mixin is associated with the core component
-
renderInformalParameters
public void renderInformalParameters(MarkupWriter writer)
Description copied from interface:ComponentResourcesIndentifies all parameters that are not formal parameters and writes each as a attribute/value pair into the current element of the markup writer.- Specified by:
renderInformalParametersin interfaceComponentResources- Parameters:
writer- to whichattributeswill be written
-
getContainer
public Component getContainer()
Description copied from interface:ComponentResourcesReturns the component which contains this component, or null for the root component. For mixins, this returns the component to which the mixin is attached.- Specified by:
getContainerin interfaceComponentResources
-
getContainerResources
public ComponentResources getContainerResources()
Description copied from interface:ComponentResourcesReturns theComponentResourcesfor the container, or null if the this is the root component (that has no container). As a special case, for a mixin, this returns the core component's resources.- Specified by:
getContainerResourcesin interfaceComponentResources
-
getContainerMessages
public Messages getContainerMessages()
Description copied from interface:ComponentResourcesReturns theMessagesfrom the container, or null if this is the root component (with no container). As a special case, for a mixin, this return the core component's messages.- Specified by:
getContainerMessagesin interfaceComponentResources
-
getLocale
public java.util.Locale getLocale()
Description copied from interface:ComponentResourcesCommonReturns the locale for the page containing this component.- Specified by:
getLocalein interfaceComponentResourcesCommon- See Also:
ComponentResourcesCommon.getResourceSelector()
-
getResourceSelector
public ComponentResourceSelector getResourceSelector()
Description copied from interface:ComponentResourcesCommonReturns the selector used when constructing the component and its containing page.- Specified by:
getResourceSelectorin interfaceComponentResourcesCommon
-
getMessages
public Messages getMessages()
Description copied from interface:ComponentResourcesReturns the message catalog for this component.- Specified by:
getMessagesin interfaceComponentResources
-
getElementName
public java.lang.String getElementName(java.lang.String defaultElementName)
Description copied from interface:ComponentResourcesCommonReturns the name of element that represents the component in its template, or the provided default element name if the element was a component type (in the Tapestry namespace).- Specified by:
getElementNamein interfaceComponentResourcesCommon- Parameters:
defaultElementName- element name to return if the element name is not known (may be null)- Returns:
- the element name
-
getBlock
public Block getBlock(java.lang.String blockId)
Description copied from interface:ComponentResourcesCommonReturns a block from the component's template, referenced by its id.- Specified by:
getBlockin interfaceComponentResourcesCommon- Parameters:
blockId- the id of the block (case insensitive)- Returns:
- the identified Block
- See Also:
ComponentResourcesCommon.findBlock(String)
-
getBlockParameter
public Block getBlockParameter(java.lang.String parameterName)
Description copied from interface:ComponentResourcesUsed to access an informal parameter that's a Block.- Specified by:
getBlockParameterin interfaceComponentResources- Parameters:
parameterName- the name of the informal parameter (case is ignored)- Returns:
- the informal Block parameter, or null if not bound
-
findBlock
public Block findBlock(java.lang.String blockId)
Description copied from interface:ComponentResourcesCommonAs withComponentResourcesCommon.getBlock(String), but returns null if the block is not found.- Specified by:
findBlockin interfaceComponentResourcesCommon- Parameters:
blockId- the id of the block (case insensitive)- Returns:
- the block, or null
-
getBaseResource
public Resource getBaseResource()
Description copied from interface:ComponentResourcesReturns the base resource for the component, which will represent the class's location within the classpath (this is used to resolve relative assets).- Specified by:
getBaseResourcein interfaceComponentResources
-
getPageName
public java.lang.String getPageName()
Description copied from interface:ComponentResourcesCommonReturns the logical name of the page containing this component. This is the short name (it often appears in URLs)- Specified by:
getPageNamein interfaceComponentResourcesCommon- Returns:
- the logical name of the page which contains this component
-
getInformalParameterBindings
public java.util.Map<java.lang.String,Binding> getInformalParameterBindings()
Description copied from interface:InternalComponentResourcesCommonConstructs a map linking informal parameters to the corresponding bindings.- Specified by:
getInformalParameterBindingsin interfaceInternalComponentResourcesCommon- Returns:
- map, possible empty
-
getRenderVariable
public java.lang.Object getRenderVariable(java.lang.String name)
Description copied from interface:ComponentResourcesReturns a previously stored render variable.- Specified by:
getRenderVariablein interfaceComponentResources- Parameters:
name- of the variable (case will be ignored)- Returns:
- the variable's value
-
storeRenderVariable
public void storeRenderVariable(java.lang.String name, java.lang.Object value)
Description copied from interface:ComponentResourcesStores a render variable, accessible with the provided name.- Specified by:
storeRenderVariablein interfaceComponentResources- Parameters:
name- of value to storevalue- value to store (may not be null)
-
postRenderCleanup
public void postRenderCleanup()
Description copied from interface:InternalComponentResourcesAllows the resources to cleanup any render-time only data.- Specified by:
postRenderCleanupin interfaceInternalComponentResources
-
addPageLifecycleListener
public void addPageLifecycleListener(PageLifecycleListener listener)
Description copied from interface:ComponentResourcesAdds a listener object that will be notified about page lifecycle events.- Specified by:
addPageLifecycleListenerin interfaceComponentResources
-
removePageLifecycleListener
public void removePageLifecycleListener(PageLifecycleListener listener)
Description copied from interface:ComponentResourcesRemoves a previously added listener.- Specified by:
removePageLifecycleListenerin interfaceComponentResources
-
addPageResetListener
public void addPageResetListener(PageResetListener listener)
Description copied from interface:InternalComponentResources- Specified by:
addPageResetListenerin interfaceInternalComponentResources- Parameters:
listener- to register
-
getParameterConduit
public ParameterConduit getParameterConduit(java.lang.String parameterName)
Description copied from interface:InternalComponentResourcesGets a previously stored ParameterConduit, allowing PCs to be shared between a component and a mixin of that component.- Specified by:
getParameterConduitin interfaceInternalComponentResources
-
setParameterConduit
public void setParameterConduit(java.lang.String parameterName, ParameterConduit conduit)
Description copied from interface:InternalComponentResourcesStores a ParameterConduit for later access. Tthis occurs inside a component'sPageLifecycleListener.containingPageDidLoad()lifecycle method.- Specified by:
setParameterConduitin interfaceInternalComponentResources
-
getPropertyName
public java.lang.String getPropertyName(java.lang.String parameterName)
Description copied from interface:InternalComponentResourcesReturns the name of the bound property ifPropBindingis used and the expression points to a property on a bean (e.g. user.name). Otherwise this method returns null.- Specified by:
getPropertyNamein interfaceInternalComponentResources- Parameters:
parameterName- name of the parameter
-
render
public void render(MarkupWriter writer, RenderQueue queue)
Description copied from interface:RenderCommandInvoked on an object to request that it render itself. This involves a mix of invoking methods on the writer, and queueing up additional commands (often, representing children of the object that was invoked) to perform additional rendering. In this way, rendering is a tail recursive algorithm, but is not implemented using tail recursion.- Specified by:
renderin interfaceRenderCommand- Since:
- 5.3
-
getPageLifecycleCallbackHub
public PageLifecycleCallbackHub getPageLifecycleCallbackHub()
Description copied from interface:ComponentResourcesProvides access to an object that can be used to register callbacks for page lifecycle events.- Specified by:
getPageLifecycleCallbackHubin interfaceComponentResources- Returns:
- the hub
-
-