Newer Version Available

This content describes an older version of this product. View Latest

SymbolTable

A complex type that represents all user-defined tokens in the Body of an ApexClass, ApexClassMember, or ApexTriggerMember and their associated line and column locations within the Body.

Fields

Field Details
constructors
Type
array of Constructor
Description
Contains the position, scope and signature of constructors for the Apex class. Apex triggers don't have constructors.
Constructor includes the following fields:
  • location
  • modifiers
  • name
  • references
  • visibility (scope: Global, Public or Private)
  • parameters
externalReferences
Type
array of ExternalReference
Description
Contains the name, namespace, and external class, method and variable references for the Apex class or trigger. These references can be used for symbol highlighting or code navigation.
ExternalReference includes the following fields:
  • methods
  • modifiers
  • name
  • namespace
  • references
  • variables
innerClasses
Type
array of SymbolTable
Description
Contains a symbol table for each inner class of the Apex class or trigger.
interfaces
Type
array of String
Description
Contains a set of strings for each interface with the namespace and name, for example: ['System.Batchable', 'MyNamespace.MyInterface'].
methods
Type
array of Method
Description
Contains the position, name, scope, signature, and return type of available Apex methods.
Method includes the following fields:
  • location
  • modifiers
  • name
  • references
  • visibility (scope: Global, Public or Private)
  • parameters
  • returnType
name
Type
string
Description
The name of the Apex class or trigger.
namespace
Type
string
Description
The namespace of the Apex class or trigger. Null if there is no namespace.
properties
Type
array of VisibilitySymbol
Description
Contains the position, name, scope, and references of properties for the Apex class or trigger.
VisibilitySymbol includes the following fields:
  • location
  • modifiers
  • name
  • references
  • visibility (scope: Global, Public or Private)
tableDeclaration
Type
array of Symbol
Description
Contains the position, name, and references of the Apex class or trigger.
Symbol includes the following fields:
  • location
  • modifiers
  • name
  • references
variables
Type
array of Symbol
Description
Contains the position, name and references of related variables.
Symbol includes the following fields:
  • location
  • modifiers
  • name
  • references

Usage

Use symbol tables instead of building a parser or compiler. Symbol tables allow you to do symbol highlighting, code navigation, code completion, symbol searches, and more.

A symbol table cannot be created if the content referenced by the ContentEntityId field doesn’t use a symbol table, or if compiler errors for the last deployment of the MetadataContainer in the MetadataContainerId field prevented a symbol table from being created.