4

When issuing a query against the ApexClass with the Tooling API, I can get back return types and method parameters. However, they simply return "LIST" for lists.

Is there a way to get back the parameterized type of those lists? E.g. instead of "LIST" get back "List<Account>"?

4

I've asked this question already of Salesforce and currently it is not supported. Hopefully one day we will get hold of the grammar for Apex, which will give us another option for parsing Apex source code. In the meantime the best you could do is use the line location information in the Symbol table entry to locate the line the Apex source code and parse it out yourself.

  • Funny you should answer this @Andrew Fawcett, as I am working on a ToolingAPI Apex library inspired by your metadata library. That's what I figured, having to parse out the types. Hopefully they provide a means of getting the parameterized types in the future. – James Loghry Jan 7 '14 at 18:44
  • Excellent stuff James, do you want to work together on this, github.com/afawcett/apex-toolingapi. It's early days. – Andrew Fawcett Jan 7 '14 at 19:18
  • Would love that. I've started my own here: github.com/dancinllama/Force-Tooling-Belt but maybe we could merge them – James Loghry Jan 7 '14 at 19:20
  • Yeah lets have a chat about it, the SOAP variant of the API is full of xsd:extension usage, which is going to stress the workaround i used in the Metadata API (specifically in receiving XML). Hence why i went for the REST API. – Andrew Fawcett Jan 7 '14 at 19:24

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.