[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pdt-dev] Check if any class in the superclasshierarchy implements an interface

Hi,

findTypeInHierarchy() expectes an ITypeBinding as the first parameter. In the IndexingVisitorExtension
i only have AstNodes from the package org.eclipse.php.internal.core.compiler.ast.nodes.* available.

It looks like the TypeDeclarations from the org.eclipse.php.internal.core.ast.nodes.* package
have a method resolveTypeBinding() which returns an ITypeBinding.

This raises a more general question: What's the difference between the AstNode classes in the 2 packages:

org.eclipse.php.internal.core.compiler.ast.nodes.*
org.eclipse.php.internal.core.ast.nodes.*

And if i'm inside a PHPASTVisitor, can i convert the classes from the org.eclipse.php.internal.core.compiler.ast.nodes somehow
to the corresponding org.eclipse.php.internal.core.ast.nodes.* class?


regards

-robert


ps: i've tried to search the pdt source for any examples of findTypeInHierarchy(), but it looks like it's not
being used anywhere.



On 10/27/11 2:33 PM, Roy Ganor wrote:
Hi,

Try using org.eclipse.php.internal.core.ast.nodes.Bindings.findTypeInHierarchy(ITypeBinding, String)

Roy
-----Original Message-----
From: pdt-dev-bounces@xxxxxxxxxxx [mailto:pdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Robert Gruendler
Sent: Thursday, October 27, 2011 12:36 PM
To: pdt-dev@xxxxxxxxxxx
Subject: [pdt-dev] Check if any class in the superclasshierarchy implements an interface

Hi,

i'm trying to check in my IndexingVisitorExtension if a visited class
implements a certain interface.

The ClassDeclaration's "getSuperclasses()" method seemed to be a way to 
do this,
but as it turns out it only evaluates the direct superclass and the 
direct implemented
interfaces.

So i'm wondering if i somehow can walk through the complete superclass 
hierarchy during
indexing of a php class?

regards

-robert


_______________________________________________
pdt-dev mailing list
pdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pdt-dev
_______________________________________________
pdt-dev mailing list
pdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pdt-dev