Package net.sf.saxon.expr

## Class Component

- java.lang.Object
- - net.sf.saxon.expr.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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `Component.M` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Actor` | `actor` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `export​(ExpressionPresenter out, java.util.Map<Component,​java.lang.Integer> componentIdMap, java.util.Map<StylesheetPackage,​java.lang.Integer> packageIdMap)` |
    `Actor` | `getActor()` | Get the actor (for example a compiled template, function, or variable) that is executed when this component is called
    `Component` | `getBaseComponent()` | Get the component from which this one is derived
    `java.util.List<ComponentBinding>` | `getComponentBindings()` | Get the component's binding vector; that is the list of external references to other components
    `int` | `getComponentKind()` |
    `StylesheetPackage` | `getContainingPackage()` | Get the containing package of this component
    `StylesheetPackage` | `getDeclaringPackage()` | Get the declaring package of this component
    `Visibility` | `getVisibility()` | Get the visibility of the component
    `VisibilityProvenance` | `getVisibilityProvenance()` | Determine whether the visibility of the component is due to an explicit visibility attribute on the component declaration
    `boolean` | `isHiddenAbstractComponent()` | Ask whether this is a hidden component derived from an abstract component with no implementation
    `java.lang.String` | `listComponentReferences​(java.util.Map<Component,​java.lang.Integer> componentIdMap)` |
    `static Component` | `makeComponent​(Actor actor, Visibility visibility, VisibilityProvenance provenance, StylesheetPackage containingPackage, StylesheetPackage declaringPackage)` | Create a component
    `void` | `setBaseComponent​(Component original)` | Set the component from which this one is derived
    `void` | `setComponentBindings​(java.util.List<ComponentBinding> bindings)` | Set the component's binding vector; that is the list of external references to other components
    `void` | `setVisibility​(Visibility visibility, VisibilityProvenance provenance)` | Set the visibility of the component, and say whether it is explicit or defaulted

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

    - #### export

          public void export​(ExpressionPresenter out,
                             java.util.Map<Component,​java.lang.Integer> componentIdMap,
                             java.util.Map<StylesheetPackage,​java.lang.Integer> packageIdMap)
                      throws XPathException

      Throws:
        `XPathException`

    - #### listComponentReferences

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

    - #### getComponentKind

          public int getComponentKind()