Tabnine Logo
Select.astOperand
Code IndexAdd Tabnine to your IDE (free)

How to use
astOperand
method
in
lombok.ast.Select

Best Java code snippets using lombok.ast.Select.astOperand (Showing top 20 results out of 315)

origin: com.android.tools.external.lombok/lombok-ast

@Override public void visitFieldReference(FieldReference node) {
  lombok.ast.Select select = new lombok.ast.Select();
  select.astIdentifier(toIdentifier(node.token, node.nameSourcePosition));
  select.astOperand((lombok.ast.Expression) toTree(node.receiver));
  
  set(node, setPosition(node, select));
}

origin: me.tatarka.retrolambda.projectlombok/lombok.ast

@Override public void visitFieldReference(FieldReference node) {
  lombok.ast.Select select = new lombok.ast.Select();
  select.astIdentifier(toIdentifier(node.token, node.nameSourcePosition));
  select.astOperand((lombok.ast.Expression) toTree(node.receiver));
  
  set(node, setPosition(node, select));
}

origin: org.projectlombok/lombok.ast

@Override public void visitFieldReference(FieldReference node) {
  lombok.ast.Select select = new lombok.ast.Select();
  select.astIdentifier(toIdentifier(node.token, node.nameSourcePosition));
  select.astOperand((lombok.ast.Expression) toTree(node.receiver));
  
  set(node, setPosition(node, select));
}

origin: com.amazon.device.tools.lint/lint-checks

  @Override
  public boolean visitSelect(Select node) {
    // R.type.name
    if (node.astOperand() instanceof Select) {
      Select select = (Select) node.astOperand();
      if (select.astOperand() instanceof VariableReference) {
        VariableReference reference = (VariableReference) select.astOperand();
        if (reference.astIdentifier().astValue().equals(R_CLASS)) {
          String type = select.astIdentifier().astValue();
          if (type.equals(MENU_TYPE)) {
            String name = node.astIdentifier().astValue();
            // Reclassify icons in the given menu as action bar icons
            if (mMenuToIcons != null) {
              Collection<String> icons = mMenuToIcons.get(name);
              if (icons != null) {
                if (mActionBarIcons == null) {
                  mActionBarIcons = Sets.newHashSet();
                }
                mActionBarIcons.addAll(icons);
              }
            }
          }
        }
      }
    }
    return super.visitSelect(node);
  }
}
origin: me.tatarka.retrolambda.projectlombok/lombok.ast

  private List<String> unwrapSelectChain(Select s) {
    List<String> list = Lists.newArrayList();
    while (s != null) {
      list.add(s.astIdentifier().astValue());
      Expression parent = s.astOperand();
      if (parent instanceof Select) {
        s = (Select) parent;
      } else if (parent instanceof Identifier) {
        s = null;
        list.add(((Identifier)parent).astValue());
      } else if (parent == null) {
        break;
      } else {
        throw new ResolutionException(parent, "Identifies expected here, not a " + parent.getClass().getSimpleName());
      }
    }
    
    Collections.reverse(list);
    return list;
  }
}
origin: com.android.tools.external.lombok/lombok-ast

  private List<String> unwrapSelectChain(Select s) {
    List<String> list = Lists.newArrayList();
    while (s != null) {
      list.add(s.astIdentifier().astValue());
      Expression parent = s.astOperand();
      if (parent instanceof Select) {
        s = (Select) parent;
      } else if (parent instanceof Identifier) {
        s = null;
        list.add(((Identifier)parent).astValue());
      } else if (parent == null) {
        break;
      } else {
        throw new ResolutionException(parent, "Identifies expected here, not a " + parent.getClass().getSimpleName());
      }
    }
    
    Collections.reverse(list);
    return list;
  }
}
origin: com.amazon.device.tools.lint/lint-checks

@Override
public boolean visitSelect(Select node) {
  if (node.astIdentifier().astValue().equals("layout") //$NON-NLS-1$
      && node.astOperand() instanceof VariableReference
      && ((VariableReference) node.astOperand()).astIdentifier().astValue()
        .equals("R")                             //$NON-NLS-1$
      && node.getParent() instanceof Select) {
    String layout = ((Select) node.getParent()).astIdentifier().astValue();
    registerLayoutActivity(layout, mClassFqn);
  }
  return false;
}
origin: org.projectlombok/lombok.ast

  private List<String> unwrapSelectChain(Select s) {
    List<String> list = Lists.newArrayList();
    while (s != null) {
      list.add(s.astIdentifier().astValue());
      Expression parent = s.astOperand();
      if (parent instanceof Select) {
        s = (Select) parent;
      } else if (parent instanceof Identifier) {
        s = null;
        list.add(((Identifier)parent).astValue());
      } else if (parent == null) {
        break;
      } else {
        throw new ResolutionException(parent, "Identifies expected here, not a " + parent.getClass().getSimpleName());
      }
    }
    
    Collections.reverse(list);
    return list;
  }
}
origin: com.amazon.device.tools.lint/lint-checks

  @Override
  public boolean visitSelect(Select node) {
    String description = node.astIdentifier().astValue();
    boolean isIfRoom = description.equals("SHOW_AS_ACTION_IF_ROOM"); //$NON-NLS-1$
    boolean isAlways = description.equals("SHOW_AS_ACTION_ALWAYS");  //$NON-NLS-1$
    if ((isIfRoom || isAlways)
        && node.astOperand().toString().equals("MenuItem")) { //$NON-NLS-1$
      if (isAlways) {
        if (mContext.getDriver().isSuppressed(mContext, ISSUE, node)) {
          return super.visitSelect(node);
        }
        if (mAlwaysFields == null) {
          mAlwaysFields = new ArrayList<Location>();
        }
        mAlwaysFields.add(mContext.getLocation(node));
      } else {
        mHasIfRoomRefs = true;
      }
    }
    return super.visitSelect(node);
  }
}
origin: com.amazon.device.tools.lint/lint-checks

  @Override
  public boolean visitBinaryExpression(BinaryExpression node) {
    BinaryOperator operator = node.astOperator();
    if (operator == BinaryOperator.ASSIGN || operator == BinaryOperator.OR_ASSIGN) {
      Expression left = node.astLeft();
      String variable;
      if (left instanceof Select && ((Select) left).astOperand() instanceof This) {
        variable = ((Select) left).astIdentifier().astValue();
      } else {
        variable = left.toString();
      }
      mVariables.add(variable);
    }
    return super.visitBinaryExpression(node);
  }
}
origin: com.android.tools.external.lombok/lombok-ast

private lombok.ast.Expression toSelect(char[][] tokens, long[] positions) {
  if (tokens.length < 2) return null;
  if (tokens.length != positions.length) throw new IllegalStateException("bug");
  
  lombok.ast.Identifier current0 = toIdentifier(tokens[0], positions[0]);
  lombok.ast.Expression current = new lombok.ast.VariableReference().astIdentifier(current0);
  current.setPosition(current0.getPosition());
  
  for (int i = 1; i < tokens.length; i++) {
    lombok.ast.Select select = new lombok.ast.Select().astIdentifier(toIdentifier(tokens[i], positions[i]));
    select.astOperand(current);
    current = select;
  }
  
  return current;
}

origin: me.tatarka.retrolambda.projectlombok/lombok.ast

private lombok.ast.Expression toSelect(char[][] tokens, long[] positions) {
  if (tokens.length < 2) return null;
  if (tokens.length != positions.length) throw new IllegalStateException("bug");
  
  lombok.ast.Identifier current0 = toIdentifier(tokens[0], positions[0]);
  lombok.ast.Expression current = new lombok.ast.VariableReference().astIdentifier(current0);
  current.setPosition(current0.getPosition());
  
  for (int i = 1; i < tokens.length; i++) {
    lombok.ast.Select select = new lombok.ast.Select().astIdentifier(toIdentifier(tokens[i], positions[i]));
    select.astOperand(current);
    current = select;
  }
  
  return current;
}

origin: org.projectlombok/lombok.ast

private lombok.ast.Expression toSelect(char[][] tokens, long[] positions) {
  if (tokens.length < 2) return null;
  if (tokens.length != positions.length) throw new IllegalStateException("bug");
  
  lombok.ast.Identifier current0 = toIdentifier(tokens[0], positions[0]);
  lombok.ast.Expression current = new lombok.ast.VariableReference().astIdentifier(current0);
  current.setPosition(current0.getPosition());
  
  for (int i = 1; i < tokens.length; i++) {
    lombok.ast.Select select = new lombok.ast.Select().astIdentifier(toIdentifier(tokens[i], positions[i]));
    select.astOperand(current);
    current = select;
  }
  
  return current;
}

origin: com.android.tools.external.lombok/lombok-ast

@Override
public boolean visitSelect(Select node) {
  int start = posOfStructure(node.astIdentifier(), ".", true);
  int end = node.getPosition().getEnd();
  return set(node, setPos(start, end,
      treeMaker.Select(toExpression(node.astOperand()), toName(node.astIdentifier()))));
}

origin: me.tatarka.retrolambda.projectlombok/lombok.ast

@Override
public boolean visitSelect(Select node) {
  int start = posOfStructure(node.astIdentifier(), ".", true);
  int end = node.getPosition().getEnd();
  return set(node, setPos(start, end,
      treeMaker.Select(toExpression(node.astOperand()), toName(node.astIdentifier()))));
}

origin: org.projectlombok/lombok.ast

@Override
public boolean visitSelect(Select node) {
  int start = posOfStructure(node.astIdentifier(), ".", true);
  int end = node.getPosition().getEnd();
  return set(node, setPos(start, end,
      treeMaker.Select(toExpression(node.astOperand()), toName(node.astIdentifier()))));
}

origin: org.projectlombok/lombok.ast

private void updateRestrictionFlags(lombok.ast.Node node, NameReference ref) {
  ref.bits &= ~ASTNode.RestrictiveFlagMASK;
  ref.bits |= Binding.VARIABLE;
  
  if (node.getParent() instanceof lombok.ast.MethodInvocation) {
    if (((lombok.ast.MethodInvocation)node.getParent()).astOperand() == node) {
      ref.bits |= Binding.TYPE;
    }
  }
  
  if (node.getParent() instanceof lombok.ast.Select) {
    if (((lombok.ast.Select)node.getParent()).astOperand() == node) {
      ref.bits |= Binding.TYPE;
    }
  }
}

origin: com.android.tools.external.lombok/lombok-ast

private void updateRestrictionFlags(lombok.ast.Node node, NameReference ref) {
  ref.bits &= ~ASTNode.RestrictiveFlagMASK;
  ref.bits |= Binding.VARIABLE;
  
  if (node.getParent() instanceof lombok.ast.MethodInvocation) {
    if (((lombok.ast.MethodInvocation)node.getParent()).astOperand() == node) {
      ref.bits |= Binding.TYPE;
    }
  }
  
  if (node.getParent() instanceof lombok.ast.Select) {
    if (((lombok.ast.Select)node.getParent()).astOperand() == node) {
      ref.bits |= Binding.TYPE;
    }
  }
}

origin: me.tatarka.retrolambda.projectlombok/lombok.ast

private void updateRestrictionFlags(lombok.ast.Node node, NameReference ref) {
  ref.bits &= ~ASTNode.RestrictiveFlagMASK;
  ref.bits |= Binding.VARIABLE;
  
  if (node.getParent() instanceof lombok.ast.MethodInvocation) {
    if (((lombok.ast.MethodInvocation)node.getParent()).astOperand() == node) {
      ref.bits |= Binding.TYPE;
    }
  }
  
  if (node.getParent() instanceof lombok.ast.Select) {
    if (((lombok.ast.Select)node.getParent()).astOperand() == node) {
      ref.bits |= Binding.TYPE;
    }
  }
}

origin: com.amazon.device.tools.lint/lint-checks

/** Adds any variables referenced in the given expression into the given list */
private static void addReferencedVariables(Collection<String> variables,
    Expression expression) {
  if (expression instanceof BinaryExpression) {
    BinaryExpression binary = (BinaryExpression) expression;
    addReferencedVariables(variables, binary.astLeft());
    addReferencedVariables(variables, binary.astRight());
  } else if (expression instanceof UnaryExpression) {
    UnaryExpression unary = (UnaryExpression) expression;
    addReferencedVariables(variables, unary.astOperand());
  } else if (expression instanceof VariableReference) {
    VariableReference reference = (VariableReference) expression;
    variables.add(reference.astIdentifier().astValue());
  } else if (expression instanceof Select) {
    Select select = (Select) expression;
    if (select.astOperand() instanceof This) {
      variables.add(select.astIdentifier().astValue());
    }
  }
}
lombok.astSelectastOperand

Popular methods of Select

  • astIdentifier
  • <init>
  • getPosition
  • rawOperand
  • getParent
  • toString

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now