org.apache.tapestry5.internal.pageload

## Class EmbeddedComponentAssemblerImpl

- java.lang.Object
- - org.apache.tapestry5.internal.pageload.EmbeddedComponentAssemblerImpl

-     public class EmbeddedComponentAssemblerImpl
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmbeddedComponentAssemblerImpl(ComponentAssemblerSource assemblerSource, ComponentInstantiatorSource instantiatorSource, ComponentClassResolver componentClassResolver, String componentClassName, ComponentResourceSelector selector, EmbeddedComponentModel embeddedModel, String templateMixins, Location location, boolean strictMixinParameters)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addMixinsToElement(ComponentPageElement newElement)` Adds mixins to the newly created embedded element.
    `org.apache.tapestry5.internal.pageload.ParameterBinder` | `createParameterBinder(String qualifiedParameterName)` 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.
    `Set<String>` | `getFormalParameterNames()` Returns the names of all formal parameters.
    `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,
                                                ComponentResourceSelector selector,
                                                EmbeddedComponentModel embeddedModel,
                                                String templateMixins,
                                                Location location,
                                                boolean strictMixinParameters)

      Parameters:
        `assemblerSource` -
        `instantiatorSource` - used to access component models
        `componentClassResolver` - used to convert mixin types to component models
        `componentClassName` - class name of embedded component
        `selector` - used to select template and other resources
        `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
        `strictMixinParameters` - if true (e.g., the 5.4 DTD) then mixin parameters must be fully qualified

  - ### 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 qualifiedParameterName)

      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). In addition, a special mixinid that matches the component's class name can be used; this is necessary to disambiguate informal parameters of the component from formal mixin parameters (where an unqualified name would be bound to the mixin's parameter). 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:
        `qualifiedParameterName` - 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 int addMixinsToElement(ComponentPageElement newElement)

      Adds mixins to the newly created embedded element.
      Parameters:
        `newElement` - new element requiring mixins
      Returns:
        number of mixins added

    - #### getLocation

          public Location getLocation()

      Description copied from interface: `Locatable`
      Returns the location associated with this object for error reporting purposes.

    - #### getFormalParameterNames

          public Set<String> getFormalParameterNames()

      Returns the names of all formal parameters.

5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.