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 com.intellij.lang.ASTNode;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes; import org.jetbrains.jet.JetNodeTypes;
import java.util.Collections; import java.util.Collections;
@@ -15,6 +16,11 @@ public class JetExtension extends JetTypeParameterListOwner {
super(node); super(node);
} }
@Override
public void accept(@NotNull JetVisitor visitor) {
visitor.visitExtension(this);
}
public List<JetDeclaration> getDeclarations() { public List<JetDeclaration> getDeclarations() {
JetClassBody body = (JetClassBody) findChildByType(JetNodeTypes.CLASS_BODY); JetClassBody body = (JetClassBody) findChildByType(JetNodeTypes.CLASS_BODY);
if (body == null) return Collections.emptyList(); if (body == null) return Collections.emptyList();
@@ -22,9 +28,8 @@ public class JetExtension extends JetTypeParameterListOwner {
return body.getDeclarations(); return body.getDeclarations();
} }
@Nullable
@Override public JetTypeReference getTargetTypeRef() {
public void accept(@NotNull JetVisitor visitor) { return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
visitor.visitExtension(this);
} }
} }