Class Component

  • Direct Known Subclasses:
    Component.M

    public class Component
    extends java.lang.Object
    Represents a component as defined in the XSLT 3.0 specification: for example a function, a named template, an attribute set, a global variable.
    • Field Detail

      • actor

        protected Actor actor
    • Method Detail

      • makeComponent

        public static Component makeComponent​(Actor actor,
                                              Visibility visibility,
                                              VisibilityProvenance provenance,
                                              StylesheetPackage containingPackage,
                                              StylesheetPackage declaringPackage)
        Create a component
        Parameters:
        actor - the compiled code that implements the component, for example a Template or Function
        visibility - the visibility of the component
        provenance - where the visibility property came from
        containingPackage - the package to which this component belongs
        declaringPackage - the package in which the original declaration of the component appears
      • getComponentBindings

        public java.util.List<ComponentBinding> getComponentBindings()
        Get the component's binding vector; that is the list of external references to other components
        Returns:
        the binding vector, a list of component bindings. These are identified by a binding slot number held with the individual instruction (such as a call-template instruction or a global variable reference) that contains the external component reference.
      • setComponentBindings

        public void setComponentBindings​(java.util.List<ComponentBinding> bindings)
        Set the component's binding vector; that is the list of external references to other components
        Parameters:
        bindings - the binding vector, a list of component bindings. These are identified by a binding slot number held with the individual instruction (such as a call-template instruction or a global variable reference) that contains the external component reference.
      • setVisibility

        public void setVisibility​(Visibility visibility,
                                  VisibilityProvenance provenance)
        Set the visibility of the component, and say whether it is explicit or defaulted
        Parameters:
        visibility - the visibility of the component
        provenance - where the visibility property came from
      • getVisibility

        public Visibility getVisibility()
        Get the visibility of the component
        Returns:
        the component's visibility. In the declaring package this will be the original declared or exposed visibility; in a using package, it will be the visibility of the component within that package.
      • getVisibilityProvenance

        public VisibilityProvenance getVisibilityProvenance()
        Determine whether the visibility of the component is due to an explicit visibility attribute on the component declaration
        Returns:
        the origin of the visibility information
      • isHiddenAbstractComponent

        public boolean isHiddenAbstractComponent()
        Ask whether this is a hidden component derived from an abstract component with no implementation
        Returns:
        true if this component is hidden, and its base component is abstract
      • getActor

        public Actor getActor()
        Get the actor (for example a compiled template, function, or variable) that is executed when this component is called
        Returns:
        the code forming the implementation of this component
      • getDeclaringPackage

        public StylesheetPackage getDeclaringPackage()
        Get the declaring package of this component
        Returns:
        the package in which the code of the component was originally declared
      • getContainingPackage

        public StylesheetPackage getContainingPackage()
        Get the containing package of this component
        Returns:
        the package that contains this (version of the) component
      • getBaseComponent

        public Component getBaseComponent()
        Get the component from which this one is derived
        Returns:
        the component from which this one is derived. This is set when the component appears in the package as a result of xsl:use-package; a component C in the used package is modified to create a component D in the using package, and D.getBaseComponent() returns C. The value will be null in the case of a component whose declaring package is the same as its containing package, that is, an "original" component (including an overriding component)
      • setBaseComponent

        public void setBaseComponent​(Component original)
        Set the component from which this one is derived
        Parameters:
        original - the component from which this one is derived. This is set when the component appears in the package as a result of xsl:use-package; a component C in the used package is modified to create a component D in the using package, and D.getBaseComponent() returns C. The value will be null in the case of a component whose declaring package is the same as its containing package, that is, an "original" component (including an overriding component)
      • listComponentReferences

        public java.lang.String listComponentReferences​(java.util.Map<Component,​java.lang.Integer> componentIdMap)
      • getComponentKind

        public int getComponentKind()