Package net.sf.saxon.expr
Class Component
java.lang.Object
net.sf.saxon.expr.Component
- Direct Known Subclasses:
Component.M
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 -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
export
(ExpressionPresenter out, Map<Component, Integer> componentIdMap, Map<StylesheetPackage, Integer> packageIdMap) getActor()
Get the actor (for example a compiled template, function, or variable) that is executed when this component is calledGet the component from which this one is derivedGet the component's binding vector; that is the list of external references to other componentsint
Get the containing package of this componentGet the declaring package of this componentGet the visibility of the componentDetermine whether the visibility of the component is due to an explicit visibility attribute on the component declarationboolean
Ask whether this is a hidden component derived from an abstract component with no implementationlistComponentReferences
(Map<Component, Integer> componentIdMap) static Component
makeComponent
(Actor actor, Visibility visibility, VisibilityProvenance provenance, StylesheetPackage containingPackage, StylesheetPackage declaringPackage) Create a componentvoid
setBaseComponent
(Component original) Set the component from which this one is derivedvoid
setComponentBindings
(List<ComponentBinding> bindings) Set the component's binding vector; that is the list of external references to other componentsvoid
setVisibility
(Visibility visibility, VisibilityProvenance provenance) Set the visibility of the component, and say whether it is explicit or defaulted
-
Field Details
-
actor
-
-
Method Details
-
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 Functionvisibility
- the visibility of the componentprovenance
- where the visibility property came fromcontainingPackage
- the package to which this component belongsdeclaringPackage
- the package in which the original declaration of the component appears- Returns:
- the constructed component
-
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
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
Set the visibility of the component, and say whether it is explicit or defaulted- Parameters:
visibility
- the visibility of the componentprovenance
- where the visibility property came from
-
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
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
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
Get the declaring package of this component- Returns:
- the package in which the code of the component was originally declared
-
getContainingPackage
Get the containing package of this component- Returns:
- the package that contains this (version of the) 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
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, Map<Component, Integer> componentIdMap, Map<StylesheetPackage, throws XPathExceptionInteger> packageIdMap) - Throws:
XPathException
-
listComponentReferences
-
getComponentKind
public int getComponentKind()
-