Class Helper
-
- All Implemented Interfaces:
public final class HelperHelper methods
sergey.gorbaty
dschach
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringANY_METHOD
-
Method Summary
-
-
Method Detail
-
isTestMethodOrClass
static boolean isTestMethodOrClass(ApexNode<out Object> node)
Check if this node is a test method or a test class. It used to do a check if the class name ended in "Test", but that is not specific.
- Parameters:
node- The node to check- Returns:
`true` if test class or method
- Since:
7.24.0 No longer check class name. Only isTest() in apex parser is used.
-
foundAnySOQLorSOSL
static boolean foundAnySOQLorSOSL(ApexNode<out Object> node)
-
foundAnyDML
static boolean foundAnyDML(ApexNode<out Object> node)
Finds DML operations in a given node descendants' path
- Returns:
true if found DML operations in node descendants
-
isMethodName
static boolean isMethodName(ASTMethodCallExpression methodNode, String className, String methodName)
-
isMethodName
static boolean isMethodName(ASTMethodCallExpression m, String methodName)
-
isMethodCallChain
static boolean isMethodCallChain(ASTMethodCallExpression methodNode, Array<String> methodNames)
-
getFQVariableName
static String getFQVariableName(ASTVariableExpression variable)
-
getFQVariableName
static String getFQVariableName(ASTVariableDeclaration variable)
-
getFQVariableName
static String getFQVariableName(ASTField variable)
-
getFQVariableName
static String getFQVariableName(ASTFieldDeclaration variable)
-
getFQVariableName
static String getFQVariableName(ASTNewKeyValueObjectExpression variable)
-
getFQVariableName
static String getFQVariableName(ASTNewObjectExpression variable)
-
isSystemLevelClass
static boolean isSystemLevelClass(ASTUserClass node)
-
getFQVariableName
static String getFQVariableName(ASTParameter p)
-
isAnyDatabaseMethodCall
static boolean isAnyDatabaseMethodCall(ASTMethodCallExpression node)
- Returns:
true if
nodeis an invocation of aDatabasemethod.
-
getMapKeyType
static String getMapKeyType(String typeName)
Extracts the key type from a Map type string, e.g.
"Map<IKey, String>"returns"IKey". Handles nested generics e.g."Map<List<A>, B>"returns"List<A>".- Parameters:
typeName- full type string (e.g.- Returns:
the key type, or null if the type is not Map<K,V> or malformed
-
-
-
-