Interface ComponentModel

    • Method Detail

      • getLibraryName

        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.
        library name containing the component, or empty string for application components
      • isPage

        boolean isPage()
        Is this a model of a page (rather than a component, mixin, or base-class)?
        true if a page
      • 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.
      • 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​(String componentId)
        Returns an embedded component defined by this component or by a super-class.
        componentId - the id of the embedded component
        the embedded component model, or null if no component exists with that id
      • getLogger

        org.slf4j.Logger getLogger()
        Returns object that will be used to log warnings and errors related to this component.
        See Also:
      • getMixinClassNames

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

        ParameterModel getParameterModel​(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.
        parameterName - the name of the parameter (case is ignored)
        the parameter model if found in this model or a parent model, or null if not found
      • isFormalParameter

        boolean isFormalParameter​(String parameterName)
        Returns true if the named parameter is formally defined (there's a ParameterModel).
        parameterName - name of the parameter (case is ignored)
      • getParameterNames

        Returns an alphabetically sorted list of the names of all formal parameters. This includes parameters defined by a base class.
      • 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

        Returns a list of the names of all persistent fields (within this class, or any super-class). The names are sorted alphabetically.
        See Also:
      • 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.
        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).
        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.
        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.
        true if the mixin should operate after, not before, the component
      • getMeta

        String getMeta​(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.
        key - identifies the value to be accessed
        the value for the key (possibly inherited from a parent model), or null
      • 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.).
        set of classes
      • handlesEvent

        boolean handlesEvent​(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.
        eventType - name of event to check (case insensitive)
        true if event handler present
      • getOrderForMixin

        String[] getOrderForMixin​(String mixinClassName)
        mixinClassName - class name of the mixin for which the ordering is desired
        the ordering constraint(s) for the mixin, potentially null.