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



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
+ 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
+ CHARACTER ShortClassName (Class) Returns the ShortClassName for the given Class object
+ 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 Ability to force GetClassNames to include classes from the Consultingwerk.SmartComponents package
+ CHARACTER LogfileName Gets and sets the name of the Logfile that should be created during the Consultingwerk.Util.ClassHelper:GetClassNamesInClassPath calls
+ LOGICAL UseExternalRuntimeForGetClassNames Allows to start the GetClassNames () in a separate runtime
+ LOGICAL UseRcodeOnlyForExternalRuntime Constrols that ClassHelper:GetClassNamesFromExternalRuntime does only search for the rcode of getclassnames.p to evaluate the absolute filename passed as the -p argument of the AVN


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 TABLE
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 TABLE
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 TABLE
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 TABLE
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 TABLE
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 TABLE
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 TABLE
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 TABLE
OUTPUT Temp-Table with the list of matching classnames
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 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

Purpose: Ability to force GetClassNames to include classes from the
Consultingwerk.SmartComponents package
Notes:

Returns LOGICAL
Top

PUBLIC CHARACTER LogfileName

Purpose: Gets and sets the name of the Logfile that should be created during
the Consultingwerk.Util.ClassHelper:GetClassNamesInClassPath calls
Notes:

Returns CHARACTER
Top

PUBLIC LOGICAL UseExternalRuntimeForGetClassNames

Purpose: Allows to start the GetClassNames () in a separate runtime
Notes: Typically set from the _idestartup.p procedure in a project root

Returns LOGICAL
Top

PUBLIC LOGICAL UseRcodeOnlyForExternalRuntime

Purpose: Constrols that ClassHelper:GetClassNamesFromExternalRuntime does only
search for the rcode of getclassnames.p to evaluate the absolute filename
passed as the -p argument of the AVN
Notes: Required for customers that seperate r-code and source code during
development but still make source code and r-code available to the
AVM runtime when testing for whatever reasons. See SCL-837

Returns LOGICAL


©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:46:16