Namespace: Consultingwerk.Util
Class 
ClassHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:ClassHelper
Purpose:Class contains generic supporting routines to work
with classes
Syntax:Static methods only, private constructor to disallow
instance creation
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Mon Jul 12 20:31:09 CEST 2010
Notes:This file is intended for GUI for .NET only
The result temp-table description is in Consultingwerk/Util/TempTables/ttClassNames.i
Provides logging for .classpath file usage through the "ClassHelper"
custom log entry type
More extensive logging can be activated through the "ClassHelperExt"
logging type



Top Method Summary
Options Name Purpose
+ CHARACTER ClassNameToFile (character) Converts a class name into the source code file name (.cls)
+ Progress.Lang.Class FileNameToClass (character) Returns the Progress.Lang.Class reference for a type referenced by either the .cls or .r file name
+ CHARACTER FileNameToClassName (character) Returns the Class Name for a type referenced by either the .cls or .r file name
+ GetClassNames (character, character, logical, character, table) Returns all class names found in the specified root directory that match the specified base type (class or interface), optionally including abstract classes
+ GetClassNames (character, character, table) Returns all class names found in the specified root directory that match the specified base type (class or interface)
+ GetClassNames (character, table) Returns all class names found in the specified root directory that match the specified base type (class or interface)
+ GetClassNames (table) Returns all class names found in the specified root directory that match the specified base type, optionally including abstract classes
# LOGICAL GetClassNamesFromExternalRuntime (character, character, logical, character) Starts a separate Progress client to perform the Class name lookup.
+ GetClassNamesInClassPath (character, logical, table) Returns all class names found in the directories specified in the .classpath file and that match the specified base type, optionally including or excluding abstract classes
+ GetClassNamesInClassPath (character, table) Returns all class names found in the directories specified in the .classpath file and that match the specified base type
+ GetClassNamesInClassPathNoDotNet (character, logical, table) Returns all class names found in the directories specified in the .classpath file and that match the specified base type, optionally including or excluding abstract classes
+ GetClassNamesInProcedureLibrary (character, character, logical, table) Returns all class names found in the specified root directory that match the specified base type (class or interface), optionally including abstract classes
+ GetClassNamesNoDotNet (character, character, logical, character, table) Returns all class names found in the specified root directory that match the specified base type (class or interface), optionally including abstract classes
+ INTEGER NumInstances (Class) Returns the current number of instances of the given class
+ CHARACTER ShortClassName (Class) Returns the ShortClassName for the given Class object
+ CHARACTER ShortPackageName (character) Returns the class name with a shortend package name
+ CHARACTER ShortPackageName (Class) Returns the class name with a shortend package name
+ Consultingwerk.ClassName SplitClassName (character) Splits a full class name into package and class name
+ WriteLogMessage (character) Writes a message to the logfile

Top Constructor Summary
Options Name Purpose
# ClassHelper () Constructor for the ClassHelper class

Top Property Summary
Options Name Purpose
+ LOGICAL ForceIncludeSmartComponents
+ CHARACTER LogfileName
+ LOGICAL UseExternalRuntimeForGetClassNames
+ LOGICAL UseRcodeOnlyForExternalRuntime


Method Detail
Top

PUBLIC CHARACTER ClassNameToFile (character)

Purpose: Converts a class name into the source code file name (.cls)
Notes:

Parameters:
pcClassName CHARACTER
The ClassName to convert into a source code file name
Returns CHARACTER
The file name of the class source code
Top

PUBLIC Progress.Lang.Class FileNameToClass (character)

Purpose: Returns the Progress.Lang.Class reference for a type referenced
by either the .cls or .r file name
Notes:

Parameters:
pcFileName CHARACTER
The file name
Returns Progress.Lang.Class
The Progress.Lang.Class reference of the matching typ
Top

PUBLIC CHARACTER FileNameToClassName (character)

Purpose: Returns the Class Name for a type referenced by either the .cls or
.r file name
Notes: Does not verify if it's a valid class name

Parameters:
pcFileName CHARACTER
The file name
Returns CHARACTER
The resulting class name
Top

PUBLIC GetClassNames (character, character, logical, character, table)

Purpose: Returns all class names found in the specified root directory
that match the specified base type (class or interface), optionally
including abstract classes
Notes: The routine is designed to run on a windows client only, as it
uses the .NET Framework

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
pcPath CHARACTER
The directory to look in (including sub folders)
plIncludeAbstract LOGICAL
Include abstract classes in the search
pcPrefix CHARACTER
The prefix (name space/package name) to add to the returned class names
ttClassNames TEMP-TABLE ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PUBLIC GetClassNames (character, character, table)

Purpose: Returns all class names found in the specified root directory
that match the specified base type (class or interface)
Notes: The routine is designed to run on a windows client only, as it
uses the .NET Framework

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
pcPath CHARACTER
The directory to look in (including sub folders)
ttClassNames TEMP-TABLE ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PUBLIC GetClassNames (character, table)

Purpose: Returns all class names found in the specified root directory
that match the specified base type (class or interface)
Notes: The routine is designed to run on a windows client only, as it
uses the .NET Framework

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
ttClassNames TEMP-TABLE ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PUBLIC GetClassNames (table)

Purpose: Returns all class names found in the specified root directory
that match the specified base type, optionally including abstract
classes
Notes: The routine is designed to run on a windows client only, as it
uses the .NET Framework, uses Progress.Lang.Object as the base
type for the ClassLookup through GetClassNames (pcBaseType, OUTPUT TABLE ttClassNames)

Parameters:
ttClassNames TEMP-TABLE ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PROTECTED LOGICAL GetClassNamesFromExternalRuntime (character, character, logical, character)

Purpose: Starts a separate Progress client to perform the Class name lookup.
Notes: This appears to increase the reliability (reduction of AVM crashes)

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
pcPath CHARACTER
The directory to look in (including sub folders)
plIncludeAbstract LOGICAL
Include abstract classes in the search
pcPrefix CHARACTER
The prefix (name space/package name) to add to the returned class names
Returns LOGICAL
Logical value indicating if the external runtime could be started
Top

PUBLIC GetClassNamesInClassPath (character, logical, table)

Purpose: Returns all class names found in the directories specified in the
.classpath file and that match the specified base type, optionally
including or excluding abstract classes
Notes: The routine is designed to run on a windows client only, as it
uses the .NET Framework

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
plIncludeAbstract LOGICAL
Include abstract classes in the search
return_ttClassNames TEMP-TABLE return_ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PUBLIC GetClassNamesInClassPath (character, table)

Purpose: Returns all class names found in the directories specified in the
.classpath file and that match the specified base type
Notes: The routine is designed to run on a windows client only, as it
uses the .NET Framework

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
return_ttClassNames TEMP-TABLE return_ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PUBLIC GetClassNamesInClassPathNoDotNet (character, logical, table)

Purpose: Returns all class names found in the directories specified in the
.classpath file and that match the specified base type, optionally
including or excluding abstract classes
Notes: The routine is an alternative to GetClassNamesInClassPath and does
not require access to the .NET Framework (suitable for 10.2B AppServer
and UNIX)

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
plIncludeAbstract LOGICAL
Include abstract classes in the search
return_ttClassNames TEMP-TABLE return_ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PUBLIC GetClassNamesInProcedureLibrary (character, character, logical, table)

Purpose: Returns all class names found in the specified root directory
that match the specified base type (class or interface), optionally
including abstract classes
Notes: The routine is designed to run on a windows client only, as it
uses the .NET Framework

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
pcProcedureLibraryName CHARACTER
The path to the procedure library
plIncludeAbstract LOGICAL
Include abstract classes in the search
ttClassNames TEMP-TABLE ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PUBLIC GetClassNamesNoDotNet (character, character, logical, character, table)

Purpose: Returns all class names found in the specified root directory
that match the specified base type (class or interface), optionally
including abstract classes
Notes: The routine is an alternative to GetClassNames and does not require
access to the .NET Framework (suitable for 10.2B AppServer and
UNIX or PASOE which does not support .NET on Windows as well)

Parameters:
pcBaseType CHARACTER
The base type (class or interface) that the returned classes need to match
pcPath CHARACTER
The directory to look in (including sub folders)
plIncludeAbstract LOGICAL
Include abstract classes in the search
pcPrefix CHARACTER
The prefix (name space/package name) to add to the returned class names
ttClassNames TEMP-TABLE ttClassNames
OUTPUT Temp-Table with the list of matching classnames
Top

PUBLIC INTEGER NumInstances (Class)

Purpose: Returns the current number of instances of the given class
Notes: Iterates the SESSION:FIRST object chain

Parameters:
poClass Progress.Lang.Class
The class to count instances from
Returns INTEGER
The number of instances of the class
Top

PUBLIC CHARACTER ShortClassName (Class)

Purpose: Returns the ShortClassName for the given Class object
Notes: The short name is the class name without the package

Parameters:
poClass Progress.Lang.Class
The class to return the short name for
Returns CHARACTER
The short name of the class
Top

PUBLIC CHARACTER ShortPackageName (character)

Purpose: Returns the class name with a shortend package name
Notes: The package name will the build based on upper case letters
of the package name only. The SmartBusinessEntityAdpater will
be returned as C.SC.I.SmartBusinessEntityAdapter

Parameters:
pcClassName CHARACTER
The class reference to return the shortened class/package name for
Returns CHARACTER
The shortened class/package name
Top

PUBLIC CHARACTER ShortPackageName (Class)

Purpose: Returns the class name with a shortend package name
Notes: The package name will the build based on upper case letters
of the package name only. The SmartBusinessEntityAdpater will
be returned as C.SC.I.SmartBusinessEntityAdapter

Parameters:
poClass Progress.Lang.Class
The class reference to return the shortened class/package name for
Returns CHARACTER
The shortened class/package name
Top

PUBLIC Consultingwerk.ClassName SplitClassName (character)

Purpose: Splits a full class name into package and class name
Notes: Performs no validation of type, just splits based on last period

Parameters:
pcFullClassName CHARACTER
The full class name to split
Returns Consultingwerk.ClassName
The Consultingwerk.ClassName that represents the parts of the class name
Top

PUBLIC WriteLogMessage (character)

Purpose: Writes a message to the logfile
Notes: Does nothing, when the ClassHelper:LogfileName is not set

Parameters:
pcMessage CHARACTER
The message to be written to the logfile


Constructor Detail
Top

PROTECTED ClassHelper ()

Purpose: Constructor for the ClassHelper class
Notes: Protected default constructor



Property Detail
Top

PUBLIC LOGICAL ForceIncludeSmartComponents


Returns LOGICAL
Top

PUBLIC CHARACTER LogfileName


Returns CHARACTER
Top

PUBLIC LOGICAL UseExternalRuntimeForGetClassNames


Returns LOGICAL
Top

PUBLIC LOGICAL UseRcodeOnlyForExternalRuntime


Returns LOGICAL


Temp-Table Detail

Temp-Table return_ttClassNames

Defined in:

Temp-Table ttClassNames

Defined in:


©2006-2019 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       08.08.2019 23:56:59