4

I have been looking at the tooling api in versions 28.0 and 29.0.

I have a couple of example classes that implement custom interfaces and also some that implement standard interfaces (i.e. Database.Batchable, Database.AllowsCallouts, etc).

So far my tests show that the SymbolTable will show when the class uses a standard interface, but it is not showing the implementation of custom Apex interfaces.

Is this "by design" for the Tooling API? Is the Tooling API only suppose to show standard interfaces or is this a bug in the Tooling API that it does not show custom interfaces?

Thanks for the help.

Cheers!

2

I think in all cases SymbolTable don't provide details about Interface it implements:

I have a class MyApexClass Implements TestInterface but symbolTable don't tell about that:

SymbolTable:

{
    "attributes":{
        "type":"ApexClass",
        "url":"/services/data/v28.0/tooling/sobjects/ApexClass/01p900000039ceyAAA"
    },
    "Id":"01p900000039ceyAAA",
    "NamespacePrefix":null,
    "Name":"MyApexClass",
    "ApiVersion":28.0,
    "Status":"Active",
    "IsValid":true,
    "BodyCrc":1.926715952E9,
    "Body":"public class MyApexClass implements TestInterface\n{ \n\n    public MyApexClass() {}  \n    \n}",
    "LengthWithoutComments":89,
    "CreatedDate":"2013-09-08T14:32:30.000+0000",
    "CreatedById":"00590000001CfQjAAK",
    "LastModifiedDate":"2013-09-08T16:20:39.000+0000",
    "LastModifiedById":"00590000001CfQjAAK",
    "SystemModstamp":"2013-09-08T16:20:39.000+0000",
    "SymbolTable":{
        "name":"MyApexClass",
        "constructors":[{
            "parameters":[],
            "visibility":"PUBLIC",
            "modifiers":[],
            "name":"MyApexClass",
            "location":{"column":12,"line":4},
            "type":null,
            "references":[]
        }],
        "methods":[],
        "properties":[],
        "id":"01p900000039cey",
        "namespace":null,
        "externalReferences":[],
        "innerClasses":[],
        "variables":[],
        "tableDeclaration":{
            "modifiers":[],
            "name":"MyApexClass",
            "location":{
                "column":14,"line":1
            },
            "type":"MyApexClass",
            "references":[]
        }
    }
}

Now with Database.Batchable<sObject> SymbolTable:

{
    "attributes":{
        "type":"ApexClass",
        "url":"/services/data/v28.0/tooling/sobjects/ApexClass/01p900000039ceyAAA"
    },
    "Id":"01p900000039ceyAAA",
    "NamespacePrefix":null,
    "Name":"MyApexClass",
    "ApiVersion":28.0,
    "Status":"Active",
    "IsValid":true,
    "BodyCrc":1.810529477E9,
    "Body":"public class MyApexClass implements Database.Batchable<sObject>\n{ \n\n    public MyApexClass() {}  \n    \n    public Database.QueryLocator start(Database.BatchableContext BC){\n      return Database.getQueryLocator('SELECT id FROM Account');\n   }\n    \n    public void execute(Database.BatchableContext ct, LIST<SObject> scopr) {}\n    \n    public void finish(Database.BatchableContext ct) {}\n    \n    public void execute(){}\n    \n}",
    "LengthWithoutComments":405,
    "CreatedDate":"2013-09-08T14:32:30.000+0000",
    "CreatedById":"00590000001CfQjAAK",
    "LastModifiedDate":"2013-09-08T16:32:06.000+0000",
    "LastModifiedById":"00590000001CfQjAAK",
    "SystemModstamp":"2013-09-08T16:32:06.000+0000",
    "SymbolTable":{
        "name":"MyApexClass",
        "constructors":[{
            "parameters":[],
            "visibility":"PUBLIC",
            "modifiers":[]

It only provide details about methods in class and their parameter. Here 3 methods are because of Database.Batchable so it may make confusion that it is showing Interface details.

In Tooling API developer Guide it is written that it provide details of Interfaces in SymbolTable but it doesn't work for API v28.0 may be for v29.0.

  • 1
    I can confirm it only shows system interface implementations at present. – Andrew Fawcett Dec 9 '13 at 9:19
  • @AndrewFawcett But it should show custom Interface logically. Perhaps Salesforce has a good reason for this. – Ashwani Jan 8 '14 at 9:31
  • Yes I am sure they do, though I cannot even speculate tbh, its not as if system interfaces vs customers are expressed differently. I'll see if i can find anything out... – Andrew Fawcett Jan 8 '14 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.