You can write external user-methods (or routines) for JADE classes. External routines can be written in any language that can create a library. For details, see "Writing External Methods", later in this chapter and "
To add an external method to a class
In the Class List of the Class Browser, select the class to which the external method is to be added.
Select the New External Method command from the Methods menu in the Class Browser.
The External Method Definition dialog, shown in the following image, is then displayed.
Check the Reimplement Superclass Method check box if you want to reimplement an existing external method in a superclass. (You can reimplement an external method only if it is not final in the superclass. For details, see "final Option" under "Controlling the Use of Elements in Other Schemas", in Chapter 1.) A drop‑down list containing all superclass external methods that are not final is then displayed.
Select the method in the parent class that you want to reimplement in the current class. A message box then advises you that you are about to reimplement a superclass method, and prompts you to click the Yes button if you want to continue. The parent class and the method that you selected for reimplementation are then displayed in the Name text box.
Specify the name of your new external method in the Name text box; for example, newExtMethod. The external method name has a maximum length of 100 characters.
In the Entry Point text box, specify the name of the function in the library that is to be the entry point for your external method.
Although the entry point name has a maximum length of 255 characters, if you specify an entry point name greater than 100 characters, it must be enclosed in single quote ('') or double quote ("") characters or exception 6007 (Token too long) is raised. (The schema extract process encloses all entry point names in quote characters.)
The entry point name can include a period, the underscore (_), opening parenthesis ((), closing parenthesis ()), or the ampersand (&) special character. In addition, the entry point name is case-sensitive.
You cannot specify an entry point for an abstract external method of an abstract class.
In the Library combo box, select the library containing your library (.dll) file from the list portion of the combo box or specify the name of an existing library in the text portion.
If you specify a library in this combo box and you specified an entry point in the Entry Point text box, subsequently checking the Abstract check box (which is enabled only for an abstract class) removes values entered in the entry point and library controls.
For details about libraries for your external routines, see "Maintaining Libraries for External Methods and Functions", later in this chapter.
Check the Updating check box if the method can modify properties in the object to which it is sent.
If you did not specify an entry point and library for your external method, check the Abstract check box if the selected class is abstract. An abstract method defines a signature with which all subclass implementations must comply.
The Abstract check box is enabled only when the selected class is an abstract class.
Check the Protected check box if you want the
By default, external methods are not protected; that is, they are displayed in the Methods List of the Class Browser or Primitive Types Browser with the public access icon to the left.
Check the Final check box if you want to specify that the external method cannot be reimplemented in a subclass. The
Check the Subschema Hidden check box if you want to specify that the external method is available only in the local schema; that is, it is not available for use in any subschemas. For details, see "subschemaHidden Option" under "Controlling the Use of Elements in Other Schemas", in Chapter 1.
Check the Type Method check box if you want the
Type methods provide a way of calling a method declared on a type (class, primitive, or interface) without having to have an instance of the type. For more details, see "
In the Final Settings group box, select one of the following option buttons for the appropriate final setting, if required.
Final, if you want to specify that the external method cannot be reimplemented in a subclass. The
Subschema Final, if you want to specify that the external method can be extended or reimplemented in its local schema but not in a subschema.
The
Subschema Copy Final, if you want to specify that the external method cannot be reimplemented in a subschema copy class. For details and an example, see "subschemaCopyFinal Option" under "Controlling the Use of Elements in Other Schemas", in Chapter 1.
In the Execution Location group box, select the Server or Client option button if you want the
By default, no execution option is added to the external method signature and the node in which the method executes is determined by the location of the calling method. For more details, see "
Click the Enter Text button if you want to specify or maintain descriptive text for the external method as part of the definition or maintenance of the method. For details, see "Specifying Text for a Schema Element", in Chapter 3.
You can also specify descriptive text for the external method at any time, by selecting the Text command from the Methods menu. For details, see "Using the Free-Standing Editor Window to Define Text", in Chapter 3.
Click the OK button or the Next button.
A template for the method is then displayed in the editor pane of the Class Browser. Modify the template by adding your external routine code to perform the required operations and then compile it. (For more details, see "Compiling Methods", in Chapter 4 of this guide and "
Before you can define a new external method, the library containing your library file must already exist and you must select the class to which the method is to be added. For details, see "Maintaining Libraries for External Methods and Functions", later in this chapter.