org.apache.tapestry5.model

## Interface ComponentModel

- All Known Subinterfaces:
    MutableComponentModel
  All Known Implementing Classes:
    MutableComponentModelImpl

      public interface ComponentModel

  Defines a component in terms of its capabilities, parameters, sub-components, etc. During runtime, the component model is immutable. During construction time, when the class is being transformed and loaded, the model is mutable.
  See Also:
    `MutableComponentModel`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Resource` | `getBaseResource()` Returns the resource corresponding to the class file for this component.
    `java.lang.String` | `getComponentClassName()` The fully qualified class name of the component.
    `java.util.List<java.lang.String>` | `getDeclaredParameterNames()` Returns an alphabetically sorted list of the names of all formal parameters defined by this specific class (parameters inherited from base classes are not identified).
    `java.util.List<java.lang.String>` | `getEmbeddedComponentIds()` Returns the ids of all embedded components defined within the component class (via the `Component` annotation), including those defined by any super-class.
    `EmbeddedComponentModel` | `getEmbeddedComponentModel(java.lang.String componentId)` Returns an embedded component defined by this component or by a super-class.
    `java.lang.String` | `getFieldPersistenceStrategy(java.lang.String fieldName)` Returns the persistent strategy associated with the field.
    `java.util.Set<java.lang.Class>` | `getHandledRenderPhases()` Returns a set of all the render phases that this model (including parent models) that are handled.
    `java.lang.String` | `getLibraryName()` Returns the name of the library that defines this component; this may be the empty string for an application page or component, or will be a name of a library (possibly including "core" for built-in components).
    `org.slf4j.Logger` | `getLogger()` Returns object that will be used to log warnings and errors related to this component.
    `java.lang.String` | `getMeta(java.lang.String key)` Gets a meta value identified by the given key.
    `java.util.List<java.lang.String>` | `getMixinClassNames()` Returns a list of the class names of mixins that are part of the component's implementation.
    `java.lang.String[]` | `getOrderForMixin(java.lang.String mixinClassName)`
    `ParameterModel` | `getParameterModel(java.lang.String parameterName)` Return a single parameter model by parameter name, or null if the parameter is not defined (is not a formal parameter).
    `java.util.List<java.lang.String>` | `getParameterNames()` Returns an alphabetically sorted list of the names of all formal parameters.
    `ComponentModel` | `getParentModel()` Returns the component model for this component's super-class, if it exists.
    `java.util.List<java.lang.String>` | `getPersistentFieldNames()` Returns a list of the names of all persistent fields (within this class, or any super-class).
    `boolean` | `getSupportsInformalParameters()` Returns true if the model indicates that informal parameters, additional parameters beyond the formal parameter defined for the component, are supported.
    `boolean` | `handleActivationEventContext()` Relevant for pages only, indicates that the component handle the `EventConstants.ACTIVATE` events with a catch all rules
    `boolean` | `handlesEvent(java.lang.String eventType)` Determines if the component has an event handler for the indicated event name (case insensitive).
    `boolean` | `isFormalParameter(java.lang.String parameterName)` Returns true if the named parameter is formally defined (there's a ParameterModel).
    `boolean` | `isMixinAfter()` Relevant for component mixins only.
    `boolean` | `isPage()` Is this a model of a page (rather than a component, mixin, or base-class)?
    `boolean` | `isRootClass()` Returns true if the modeled component is a root class, a component class whose parent class is not a component class.

- - ### Method Detail

    - #### getLibraryName

          java.lang.String getLibraryName()

      Returns the name of the library that defines this component; this may be the empty string for an application page or component, or will be a name of a library (possibly including "core" for built-in components). Library names are defined by the `LibraryMapping` contributions to the `ComponentClassResolver` service.
      Returns:
        library name containing the component, or empty string for application components
      Since:
        5.4

    - #### isPage

          boolean isPage()

      Is this a model of a page (rather than a component, mixin, or base-class)?
      Returns:
        true if a page
      Since:
        5.3

    - #### getBaseResource

          Resource getBaseResource()

      Returns the resource corresponding to the class file for this component. This is used to find related resources, such as the component's template and message catalog.

    - #### getComponentClassName

          java.lang.String getComponentClassName()

      The fully qualified class name of the component.

    - #### getEmbeddedComponentIds

          java.util.List<java.lang.String> getEmbeddedComponentIds()

      Returns the ids of all embedded components defined within the component class (via the `Component` annotation), including those defined by any super-class.

    - #### getEmbeddedComponentModel

          EmbeddedComponentModel getEmbeddedComponentModel(java.lang.String componentId)

      Returns an embedded component defined by this component or by a super-class.
      Parameters:
        `componentId` - the id of the embedded component
      Returns:
        the embedded component model, or null if no component exists with that id

    - #### getFieldPersistenceStrategy

          java.lang.String getFieldPersistenceStrategy(java.lang.String fieldName)

      Returns the persistent strategy associated with the field.
      Parameters:
        `fieldName` -
      Returns:
        the corresponding strategy, or the empty string
      Throws:
        `java.lang.IllegalArgumentException` - if the named field is not marked as persistent

    - #### getLogger

          org.slf4j.Logger getLogger()

      Returns object that will be used to log warnings and errors related to this component.
      See Also:
        `Log`

    - #### getMixinClassNames

          java.util.List<java.lang.String> getMixinClassNames()

      Returns a list of the class names of mixins that are part of the component's implementation.

    - #### getParameterModel

          ParameterModel getParameterModel(java.lang.String parameterName)

      Return a single parameter model by parameter name, or null if the parameter is not defined (is not a formal parameter). This may be a parameter defined by this component, or from a base class.
      Parameters:
        `parameterName` - the name of the parameter (case is ignored)
      Returns:
        the parameter model if found in this model or a parent model, or null if not found

    - #### isFormalParameter

          boolean isFormalParameter(java.lang.String parameterName)

      Returns true if the named parameter is formally defined (there's a ParameterModel).
      Parameters:
        `parameterName` - name of the parameter (case is ignored)
      Since:
        5.2.0

    - #### getParameterNames

          java.util.List<java.lang.String> getParameterNames()

      Returns an alphabetically sorted list of the names of all formal parameters. This includes parameters defined by a base class.

    - #### getDeclaredParameterNames

          java.util.List<java.lang.String> getDeclaredParameterNames()

      Returns an alphabetically sorted list of the names of all formal parameters defined by this specific class (parameters inherited from base classes are not identified).

    - #### getPersistentFieldNames

          java.util.List<java.lang.String> getPersistentFieldNames()

      Returns a list of the names of all persistent fields (within this class, or any super-class). The names are sorted alphabetically.
      See Also:
        `Persist`

    - #### isRootClass

          boolean isRootClass()

      Returns true if the modeled component is a root class, a component class whose parent class is not a component class. We may in the future require that components only extend from Object.
      Returns:
        true if a root class, false if a subclass

    - #### getSupportsInformalParameters

          boolean getSupportsInformalParameters()

      Returns true if the model indicates that informal parameters, additional parameters beyond the formal parameter defined for the component, are supported. This is false in most cases, but may be set to true for specific classes (when the `SupportsInformalParameters` annotation is present, or inherited from a super-class).
      Returns:
        true if this component model supports informal parameters

    - #### getParentModel

          ComponentModel getParentModel()

      Returns the component model for this component's super-class, if it exists. Remember that only classes in the correct packages, are considered component classes.
      Returns:
        the parent class model, or null if this component's super class is not itself a component class

    - #### isMixinAfter

          boolean isMixinAfter()

      Relevant for component mixins only. Indicates that the mixin behavior should occur after (not before) the component. Normally, this flag is set by the presence of the `MixinAfter` annotation.
      Returns:
        true if the mixin should operate after, not before, the component

    - #### getMeta

          java.lang.String getMeta(java.lang.String key)

      Gets a meta value identified by the given key. If the current model does not provide a value for the key, then the parent component model (if any) is searched.
      Parameters:
        `key` - identifies the value to be accessed
      Returns:
        the value for the key (possibly inherited from a parent model), or null

    - #### getHandledRenderPhases

          java.util.Set<java.lang.Class> getHandledRenderPhases()

      Returns a set of all the render phases that this model (including parent models) that are handled. Render phases are represented by the corresponding annotation (`BeginRender`, `AfterRender`, etc.).
      Returns:
        set of classes
      Since:
        5.0.19, 5.1.0.0

    - #### handlesEvent

          boolean handlesEvent(java.lang.String eventType)

      Determines if the component has an event handler for the indicated event name (case insensitive). This includes handlers in the component class itself, or its super-classes, but does not include event handlers supplied by implementation or instance mixins.
      Parameters:
        `eventType` - name of event to check (case insensitive)
      Returns:
        true if event handler present

    - #### getOrderForMixin

          java.lang.String[] getOrderForMixin(java.lang.String mixinClassName)

      Parameters:
        `mixinClassName` - class name of the mixin for which the ordering is desired
      Returns:
        the ordering constraint(s) for the mixin, potentially null.
      Since:
        5.2.0

    - #### handleActivationEventContext

          boolean handleActivationEventContext()

      Relevant for pages only, indicates that the component handle the `EventConstants.ACTIVATE` events with a catch all rules
      Returns:
        true if the page implements catch all rules for the activate event context, or false otherwise
      Since:
        5.4
      See Also:
        `MutableComponentModel.doHandleActivationEventContext()`

${project.version} - Copyright © 2003-2015 The Apache Software Foundation.