Class ComponentBinding


  • public class ComponentBinding
    extends java.lang.Object
    A ComponentBinding is a reference from one component to another; for example a variable reference or function call. ComponentBindings are held in the binding vector of the calling component, and are separate from the instruction/expression that contains the reference, to provide a level of indirection; this means that when a component is re-bound in a using package, for example to call overriding versions of templates or functions called from the component, the compiled code of the calling component does not need to be changed, only the contents of the binding vector.

    The ComponentBinding class is immutable.

    • Constructor Detail

      • ComponentBinding

        public ComponentBinding​(SymbolicName name,
                                Component target)
        Create a ComponentBinding
        Parameters:
        name - the symbolic name of the component that is the target of this binding. This includes the component kind (e.g. function, template, variable), its name, and in the case of functions, its arity.
        target - the target of the binding
    • Method Detail

      • getSymbolicName

        public SymbolicName getSymbolicName()
        Get the symbolic name of the component binding
        Returns:
        the symbolic name of the component that is the target of this binding. This includes the component kind (e.g. function, template, variable), its name, and in the case of functions, its arity.
      • getTarget

        public Component getTarget()
        Get the target of the component binding, for example a template, function, or global variable.
        Returns:
        the target of the component binding