-
Notifications
You must be signed in to change notification settings - Fork 519
ApexClassUtilities
pozil edited this page Oct 16, 2023
·
19 revisions
Contains reusable code dealing with ApexClass objects. This is primarily used by the LWC components for displaying code in an org.
Group Shared Code
See FormattedRecipeDisplayController
Extracts the @group annotation from a class' body. Also demonstrates the use of Regex matchers in Apex.
| Param | Description |
|---|---|
klass |
an ApexClass object |
| Type | Description |
|---|---|
String |
String This is the text following @group through the end of the line. |
ApexClass klass = [SELECT Name, Body FROM ApexClass LIMIT 1];
System.debug(ApexClassUtilities.getGroupFromClassBody(klass));Extracts the @see annotations from a class' body. Also demonstrates the use of Regex matchers in Apex.
| Param | Description |
|---|---|
klass |
an ApexClass object |
| Type | Description |
|---|---|
List<String> |
List<String> These are the values following @see annotations |
ApexClass klass = [SELECT Name, Body FROM ApexClass LIMIT 1];
System.debug(ApexClassUtilities.getRelatedClassesFromClassBody(klass));