org.apache.tapestry5.internal.pageload
Class EmbeddedComponentAssemblerImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.pageload.EmbeddedComponentAssemblerImpl

public class EmbeddedComponentAssemblerImpl
extends Object


Constructor Summary
EmbeddedComponentAssemblerImpl(ComponentAssemblerSource assemblerSource, ComponentInstantiatorSource instantiatorSource, ComponentClassResolver componentClassResolver, String componentClassName, Locale locale, EmbeddedComponentModel embeddedModel, String templateMixins, Location location)
           
 
Method Summary
 void addMixinsToElement(ComponentPageElement newElement)
          Adds mixins to the newly created embedded element.
 org.apache.tapestry5.internal.pageload.ParameterBinder createParameterBinder(String parameterName)
          Creates a binder that can later be used to bind the parameter.
 org.apache.tapestry5.internal.pageload.ComponentAssembler getComponentAssembler()
          Returns the assembler responsible for creating instances of this embedded component.
 Location getLocation()
          Returns the location associated with this object for error reporting purposes.
 boolean isBound(String parameterName)
          Checks to see if the parameter name has been bound.
 void setBound(String parameterName)
          Marks the parameter name as bound.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedComponentAssemblerImpl

public EmbeddedComponentAssemblerImpl(ComponentAssemblerSource assemblerSource,
                                      ComponentInstantiatorSource instantiatorSource,
                                      ComponentClassResolver componentClassResolver,
                                      String componentClassName,
                                      Locale locale,
                                      EmbeddedComponentModel embeddedModel,
                                      String templateMixins,
                                      Location location)
Parameters:
assemblerSource -
instantiatorSource - used to access component models
componentClassResolver - used to convert mixin types to component models
componentClassName - class name of embedded component
locale -
embeddedModel - embedded model (may be null for components defined in the template)
templateMixins - list of mixins from the t:mixins element (possibly null)
location - location of components element in its container's template
Method Detail

getComponentAssembler

public org.apache.tapestry5.internal.pageload.ComponentAssembler getComponentAssembler()
Returns the assembler responsible for creating instances of this embedded component.


createParameterBinder

public org.apache.tapestry5.internal.pageload.ParameterBinder createParameterBinder(String parameterName)
Creates a binder that can later be used to bind the parameter. The parameter name may be unqualified ("value") or have a mixin prefix ("mymixin.value"). In the former case, the correct mixin is located (though the more typical case is to bind a parameter of the component itself, not a parameter of a mixin attached to the component). In the latter case, the mixinId is validated (to ensure it exists).

If the name of the parameter does not match a formal parameter of the component (or mixin) and the component (or mixin) does not support informal parameters, then null is returned.

This method should only be called at page-assembly time as it requires some data that is collected during ComponentAssembly construction in order to handle published parameters of embedded components.

Parameters:
parameterName - simple or qualified parameter name
Returns:
object that can bind the parameter

isBound

public boolean isBound(String parameterName)
Checks to see if the parameter name has been bound.


setBound

public void setBound(String parameterName)
Marks the parameter name as bound. This is necessary to keep template bindings from overriding bindings in the Component annotation (even inherited bindings).


addMixinsToElement

public void addMixinsToElement(ComponentPageElement newElement)
Adds mixins to the newly created embedded element.

Parameters:
newElement - new element requiring mixins

getLocation

public Location getLocation()
Description copied from interface: Locatable
Returns the location associated with this object for error reporting purposes.



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