Helper method for hasModifier()
This commit is contained in:
@@ -4,6 +4,7 @@ import com.intellij.lang.ASTNode;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lexer.JetToken;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
@@ -17,4 +18,9 @@ public abstract class JetDeclaration extends JetElement {
|
||||
public JetModifierList getModifierList() {
|
||||
return (JetModifierList) findChildByType(JetNodeTypes.MODIFIER_LIST);
|
||||
}
|
||||
|
||||
public boolean hasModifier(JetToken modifier) {
|
||||
JetModifierList modifierList = getModifierList();
|
||||
return modifierList == null ? false : modifierList.hasModifier(modifier);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user