Extension node getters

This commit is contained in:
Maxim Shafirov
2011-01-09 15:09:55 +03:00
parent fbae9c0979
commit c0f70d0ff9
@@ -2,6 +2,7 @@ package org.jetbrains.jet.lang.psi;
import com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import java.util.Collections;
@@ -15,6 +16,11 @@ public class JetExtension extends JetTypeParameterListOwner {
super(node);
}
@Override
public void accept(@NotNull JetVisitor visitor) {
visitor.visitExtension(this);
}
public List<JetDeclaration> getDeclarations() {
JetClassBody body = (JetClassBody) findChildByType(JetNodeTypes.CLASS_BODY);
if (body == null) return Collections.emptyList();
@@ -22,9 +28,8 @@ public class JetExtension extends JetTypeParameterListOwner {
return body.getDeclarations();
}
@Override
public void accept(@NotNull JetVisitor visitor) {
visitor.visitExtension(this);
@Nullable
public JetTypeReference getTargetTypeRef() {
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
}
}