Try OpenEdge Now
skip to main content
Object-oriented Programming
Programming with Class-based Objects : Reflection: using built-in ABL classes : Using the Progress.Lang.Class class : Using Progress.Lang.Class properties and methods
 
Using Progress.Lang.Class properties and methods
Progress.Lang.Class is a built-in ABL class that provides a set of properties and methods that return type information about a class, interface, or enumeration type. Progress.Lang.Class is FINAL and therefore it can not be inherited. The lifetime of these objects is controlled by the ABL session; therefore, you cannot delete them. In other words, using DELETE OBJECT on a Progress.Lang.Class instance will be ignored. However, if all ABL references and all references internally maintained by the AVM are gone, the object will be garbage collected.
The following table describes the public properties on Progress.Lang.Class.
Table 5. Progress.Lang.Class public properties
Property
Description
TypeName
A read-only property that contains the fully qualified class, interface, or enum type name. For example, "acme.myObjs.CustObj" (the sample class defined in Sample classes).
Package
A read-only property that contains the package (relative directory) of the class, interface, or enum type name. For example, "acme.myObjs" (the sample package used in Sample classes).
SuperClass
A read-only property that contains an object reference. This object reference represents the type of the super class if the current data type represents a subclass.
This table describes a sampling of the public methods available on Progress.Lang.Class. (Full descriptions of each of these methods as well as entries for additional methods not included here can be found in OpenEdge Development: ABL Reference.)
Table 6. Progress.Lang.Class public methods
Method
Description
GetClass( INPUT expression AS CHARACTER)
 
Returns a Progress.Lang.Class instance containing information on the object type specified by expression. This method is static.
GetConstructor ( INPUT params
AS Progress.Lang.ParameterList )

GetConstructor ( INPUT flags AS Progress.Reflect.Flags,
INPUT params
AS Progress.Lang.ParameterList )
 
Returns a Progress.Reflect.Constructor instance containing information on the constructor described by the input parameters.
GetConstructors ( )

GetConstructors ( INPUT flags AS Progress.Reflect.Flags )
 
Returns an array of Progress.Reflect.Constructor instances containing information on the constructors described by the input parameters.
GetEvent ( INPUT event-name AS CHARACTER )

GetEvent ( INPUT event-name AS CHARACTER,
INPUT flags AS Progress.Reflect.Flags )
 
Returns a Progress.Reflect.Event instance containing information on the event described by the input parameters.
GetEvents ( )

GetEvents ( INPUT flags AS Progress.Reflect.Flags )
 
Returns an array of Progress.Reflect.Event instances containing information on the events described by the input parameters.
GetInterfaces ( )
 
Returns an array of Progress.Lang.Class instances containing information on the interfaces that the class implements.
GetMethod ( INPUT method-name AS CHARACTER,
INPUT params AS Progress.Lang.ParameterList )

GetMethod ( INPUT method-name AS CHARACTER,
INPUT flags AS Progress.Reflect.Flags,
INPUT params AS Progress.Lang.ParameterList )
 
Returns a Progress.Reflect.Method instance containing information on the method described by the input parameters.
GetMethods ( )

GetMethods ( INPUT flags AS Progress.Reflect.Flags )
 
Returns an array of Progress.Reflect.Method instances containing information on the methods described by the input parameters.
GetProperties ( )

GetProperties ( INPUT flags AS Progress.Reflect.Flags )
 
Returns an array of Progress.Reflect.Property instances containing information on the properties described by the input parameters.
GetProperty ( INPUT property-name AS CHARACTER )

GetProperty ( INPUT property-name AS CHARACTER,
INPUT flags AS Progress.Reflect.Flags )
 
Returns a Progress.Reflect.Property instance containing information on the property described by the input parameters.
GetVariable ( INPUT variable-name AS CHARACTER )

GetVariable ( INPUT variable-name AS CHARACTER,
INPUT flags AS Progress.Reflect.Flags )
 
Returns a Progress.Reflect.Variable instance containing information on the variable described by the input parameters.
GetVariables ( )

GetVariables ( INPUT flags AS Progress.Reflect.Flags )
 
Returns an array of Progress.Reflect.Variable instances containing information on the variables described by the input parameters.
HasStatics ( )
 
Returns TRUE if a given class (or any of its super classes) has any static members.
Invoke ( INPUT object-reference AS Project.Lang.Object,
   INPUT method-name AS CHARACTER )

Invoke ( INPUT object-reference AS Project.Lang.Object,
   INPUT method-name AS CHARACTER,
INPUT parameterlist-object
AS Progress.Lang.ParameterList )

Invoke ( INPUT method-name AS CHARACTER )

Invoke ( INPUT method-name AS CHARACTER,
INPUT parameterlist-object
AS Progress.Lang.ParameterList )
 
Invokes a method when the method name and any parameters are only known at run time. There are four overloaded versions. For more information on using the Invoke( ) method, see Dynamically invoking a method at run time.
IsAbstract ( )
 
Returns TRUE if a given class is abstract.
IsFinal ( )
 
Returns TRUE if the type is defined as FINAL.
New ( )
New ( INPUT parameterlist-object
AS Progress.Lang.ParameterList )
 
Instantiates a class when the class name and any parameters passed to its constructor are only known at run time. For more information on using the New( ) method, see New( ) method.
A number of the methods of Progress.Lang.Class use classes in the Progress.Reflect package both as parameters and as a way of returning information. These are discussed in more detail in Understanding classes in the Progress.Reflect package.