SUPER system reference
- Last Updated: December 13, 2018
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
SUPER system reference
Syntax
You
can invoke the super class implementation of an instance method
using the SUPER system reference. Executing a super
class method using the SUPER system reference within
a subclass causes control to switch to the version of the method in
the next higher super class that implements it, bypassing any classes
that do not implement the method. The SUPER system
reference is normally used to invoke the super class behavior for
a method from within the subclass method that overrides the invoked
behavior, and there by construct a chain of behavior. However, it
can also be used to invoke any other method in a super class. Therefore,
the method name to invoke is part of the syntax.
SUPER system
reference is different from the SUPER statement.
You can only invoke the SUPER statement from within
a constructor and it invokes a specified super class constructor.
For more information, see SUPER statement.This is the syntax to call
a super class version of a method using the SUPER system
reference:
|
Element descriptions for this syntax diagram follow:
- return-variable
- If the method returns a value that is assigned, the variable to hold the value returned by the method.
- method-name
- The name of the method to call in the class hierarchy. The first method found, starting from the immediate super class of the current class and searching upward in the class hierarchy, is the method executed. It might be anywhere in the class hierarchy starting from the immediate super class.
- [ parameter [ , parameter]...]
- The parameters of the method. For more information on the syntax of parameter, see the Parameter passing syntax reference entry in ABL Reference.
- NO-ERROR
- Optionally redirects error processing when the method is called as a statement.
From within a class, any
invocation of an overridden method without the use of the SUPER system
reference invokes the most derived subclass's implementation of
the method. From within a class, any invocation of an overridden
method with the use of the SUPER system reference
invokes the super class's implementation of the method. There is
no direct access to the super class's implementation of the overridden
method from outside the class.
The SUPER system
reference does for class methods what the RUN SUPER statement
does for internal procedures running in a persistent super procedure.
Both provide access to code further up the execution stack. The RUN
SUPER statement, which must appear in an internal procedure,
runs the super procedure version of the current internal procedure.