/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/path/GrPropertySelectionImpl.java

https://bitbucket.org/nbargnesi/idea · Java · 83 lines · 53 code · 12 blank · 18 comment · 0 complexity · aec83ef1441634519e7f95fc25a367cb MD5 · raw file

  1. /*
  2. * Copyright 2000-2009 JetBrains s.r.o.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.path;
  17. import com.intellij.lang.ASTNode;
  18. import com.intellij.openapi.diagnostic.Logger;
  19. import com.intellij.psi.PsiElement;
  20. import org.jetbrains.annotations.NotNull;
  21. import org.jetbrains.plugins.groovy.lang.lexer.TokenSets;
  22. import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor;
  23. import org.jetbrains.plugins.groovy.lang.psi.api.GroovyResolveResult;
  24. import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
  25. import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrPropertySelection;
  26. import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.GrReferenceExpressionImpl;
  27. /**
  28. * @author ilyas
  29. */
  30. public class GrPropertySelectionImpl extends GrReferenceExpressionImpl implements GrPropertySelection {
  31. private static final Logger LOG = Logger.getInstance(GrPropertySelectionImpl.class);
  32. public GrPropertySelectionImpl(@NotNull ASTNode node) {
  33. super(node);
  34. }
  35. public void accept(GroovyElementVisitor visitor) {
  36. visitor.visitPropertySelection(this);
  37. }
  38. public String toString() {
  39. return "Property selection";
  40. }
  41. @NotNull
  42. @Override
  43. public GroovyResolveResult[] multiResolve(boolean incomplete) {
  44. return GroovyResolveResult.EMPTY_ARRAY;
  45. }
  46. @Override
  47. public String getClassNameText() {
  48. return null;
  49. }
  50. @NotNull
  51. @Override
  52. public PsiElement getDotToken() {
  53. return findNotNullChildByType(TokenSets.DOTS);
  54. }
  55. @NotNull
  56. @Override
  57. public GrExpression getQualifier() {
  58. return findNotNullChildByClass(GrExpression.class);
  59. }
  60. @NotNull
  61. @Override
  62. public PsiElement getReferenceNameElement() {
  63. final PsiElement last = getLastChild();
  64. LOG.assertTrue(last!=null);
  65. return last;
  66. }
  67. @Override
  68. public boolean isFullyQualified() {
  69. return false;
  70. }
  71. }