Examples of GrExpression


Examples of org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression

  @Nullable
  public static GrReferenceExpression getCucumberStepRef(final GrMethodCall stepDefinition) {
    return ApplicationManager.getApplication().runReadAction(new NullableComputable<GrReferenceExpression>() {
      @Override
      public GrReferenceExpression compute() {
        final GrExpression ref = stepDefinition.getInvokedExpression();
        if (!(ref instanceof GrReferenceExpression)) return null;

        final PsiMethod method = stepDefinition.resolveMethod();
        if (method == null) return null;
View Full Code Here

Examples of org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression

        if (arguments.length == 0 || arguments.length > 2) return null;

        GroovyPsiElement arg = arguments[0];
        if (!(arg instanceof GrUnaryExpression && ((GrUnaryExpression)arg).getOperationTokenType() == GroovyTokenTypes.mBNOT)) return null;

        GrExpression operand = ((GrUnaryExpression)arg).getOperand();
        if (!(operand instanceof GrLiteral)) return null;

        Object value = ((GrLiteral)operand).getValue();
        return value instanceof String ? ((GrLiteral)operand) : null;
      }
View Full Code Here

Examples of org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression

    final GrClosableBlock[] closures = methodCall.getClosureArguments();
    if (closures.length == 1) return closures[0];
    if (closures.length > 1) return null;
    final GrExpression[] args = methodCall.getExpressionArguments();
    if (args.length == 0) return null;
    final GrExpression last = DefaultGroovyMethods.last(args);
    if (last instanceof GrClosableBlock) {
      return (GrClosableBlock)last;
    }

    return null;
View Full Code Here

Examples of org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression

    return null;
  }

  private static boolean isWorldDeclaration(@NotNull GrMethodCall methodCall) {
    final GrExpression invoked = methodCall.getInvokedExpression();
    if (invoked instanceof GrReferenceExpression) {
      final PsiMethod method = methodCall.resolveMethod();
      final PsiClass clazz = method == null ? null : method.getContainingClass();
      final String qname = clazz == null ? null : clazz.getQualifiedName();
      return method!= null && "World".equals(method.getName()) && GrCucumberCommonClassNames.isHookClassName(qname);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.