diff --git a/RegExpSupport/src/org/intellij/lang/regexp/psi/RegExpClass.java b/RegExpSupport/src/org/intellij/lang/regexp/psi/RegExpClass.java index 897c3d47b3ef..d1bde6942c22 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/psi/RegExpClass.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/psi/RegExpClass.java @@ -20,9 +20,10 @@ import org.jetbrains.annotations.NotNull; /** * Represents a class indicated by [...] */ -public interface RegExpClass extends RegExpAtom { +public interface RegExpClass extends RegExpAtom, RegExpClassElement { + /** - * True, is the class is negated: [^...] + * @return true, if the class is negated: [^...] */ boolean isNegated(); diff --git a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpClassImpl.java b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpClassImpl.java index 55300038682f..a183be8a3e47 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpClassImpl.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpClassImpl.java @@ -23,17 +23,19 @@ import org.intellij.lang.regexp.psi.RegExpClassElement; import org.intellij.lang.regexp.psi.RegExpElementVisitor; import org.jetbrains.annotations.NotNull; -public class RegExpClassImpl extends RegExpElementImpl implements RegExpClass, RegExpClassElement { +public class RegExpClassImpl extends RegExpElementImpl implements RegExpClass { public RegExpClassImpl(ASTNode astNode) { super(astNode); } + @Override public boolean isNegated() { final ASTNode node = getNode().getFirstChildNode(); return node != null && node.getElementType() == RegExpTT.CARET; } + @Override @NotNull public RegExpClassElement[] getElements() { final ASTNode[] nodes = getNode().getChildren(RegExpElementTypes.CLASS_ELEMENTS); @@ -44,6 +46,7 @@ public class RegExpClassImpl extends RegExpElementImpl implements RegExpClass, R return e; } + @Override public void accept(RegExpElementVisitor visitor) { visitor.visitRegExpClass(this); }