-
Notifications
You must be signed in to change notification settings - Fork 460
ApexClassUtilities
pozil edited this page Nov 14, 2024
·
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.
public static String getGroupFromClassBody(ApexClass klass)
Name | Type | Description |
---|---|---|
klass | ApexClass | an ApexClass object |
String
Text following ,[object Object], 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.
public static List<String> getRelatedClassesFromClassBody(ApexClass klass)
Name | Type | Description |
---|---|---|
klass | ApexClass | an ApexClass object |
List<String>
Values following ,[object Object], annotations
ApexClass klass = [SELECT Name, Body FROM ApexClass LIMIT 1];
System.debug(ApexClassUtilities.getRelatedClassesFromClassBody(klass));