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
-
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 calledComponent
getBaseComponent()
Get the component from which this one is derivedjava.util.List<ComponentBinding>
getComponentBindings()
Get the component's binding vector; that is the list of external references to other componentsint
getComponentKind()
StylesheetPackage
getContainingPackage()
Get the containing package of this componentStylesheetPackage
getDeclaringPackage()
Get the declaring package of this componentVisibility
getVisibility()
Get the visibility of the componentVisibilityProvenance
getVisibilityProvenance()
Determine whether the visibility of the component is due to an explicit visibility attribute on the component declarationboolean
isHiddenAbstractComponent()
Ask whether this is a hidden component derived from an abstract component with no implementationjava.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 componentvoid
setBaseComponent(Component original)
Set the component from which this one is derivedvoid
setComponentBindings(java.util.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 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 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
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 componentprovenance
- 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()
-
-