@Override public Void visitIndexerExpression(final IndexerExpression node, final Void data) { parenthesizeIfRequired(node.getTarget(), PRIMARY); if (node.getTarget() instanceof ArrayCreationExpression) { final ArrayCreationExpression arrayCreation = (ArrayCreationExpression) node.getTarget(); if (_insertParenthesesForReadability || arrayCreation.getInitializer().isNull()) { // require parentheses for "(new int[1])[0]" parenthesize(arrayCreation); } } return super.visitIndexerExpression(node, data); }
@Override public Void visitIndexerExpression(final IndexerExpression node, final Void data) { parenthesizeIfRequired(node.getTarget(), PRIMARY); if (node.getTarget() instanceof ArrayCreationExpression) { final ArrayCreationExpression arrayCreation = (ArrayCreationExpression) node.getTarget(); if (_insertParenthesesForReadability || arrayCreation.getInitializer().isNull()) { // require parentheses for "(new int[1])[0]" parenthesize(arrayCreation); } } return super.visitIndexerExpression(node, data); }
@Override public Void visitIndexerExpression(final IndexerExpression node, final Void data) { parenthesizeIfRequired(node.getTarget(), PRIMARY); if (node.getTarget() instanceof ArrayCreationExpression) { final ArrayCreationExpression arrayCreation = (ArrayCreationExpression) node.getTarget(); if (_insertParenthesesForReadability || arrayCreation.getInitializer().isNull()) { // require parentheses for "(new int[1])[0]" parenthesize(arrayCreation); } } return super.visitIndexerExpression(node, data); }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof IndexerExpression) { final IndexerExpression otherIndexer = (IndexerExpression) other; return !otherIndexer.isNull() && getTarget().matches(otherIndexer.getTarget(), match) && getArgument().matches(otherIndexer.getArgument(), match); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof IndexerExpression) { final IndexerExpression otherIndexer = (IndexerExpression) other; return !otherIndexer.isNull() && getTarget().matches(otherIndexer.getTarget(), match) && getArgument().matches(otherIndexer.getArgument(), match); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof IndexerExpression) { final IndexerExpression otherIndexer = (IndexerExpression) other; return !otherIndexer.isNull() && getTarget().matches(otherIndexer.getTarget(), match) && getArgument().matches(otherIndexer.getArgument(), match); } return false; } }
@Override public ResolveResult visitIndexerExpression(final IndexerExpression node, final Void data) { final ResolveResult childResult = node.getTarget().acceptVisitor(this, data); if (childResult == null || childResult.getType() == null || !childResult.getType().isArray()) { return null; } final TypeReference elementType = childResult.getType().getElementType(); if (elementType == null) { return null; } return new ResolveResult(elementType); }
@Override public ResolveResult visitIndexerExpression(final IndexerExpression node, final Void data) { final ResolveResult childResult = node.getTarget().acceptVisitor(this, data); if (childResult == null || childResult.getType() == null || !childResult.getType().isArray()) { return null; } final TypeReference elementType = childResult.getType().getElementType(); if (elementType == null) { return null; } return new ResolveResult(elementType); }
@Override public ResolveResult visitIndexerExpression(final IndexerExpression node, final Void data) { final ResolveResult childResult = node.getTarget().acceptVisitor(this, data); if (childResult == null || childResult.getType() == null || !childResult.getType().isArray()) { return null; } final TypeReference elementType = childResult.getType().getElementType(); if (elementType == null) { return null; } return new ResolveResult(elementType); }
@Override public Void visitIndexerExpression(final IndexerExpression node, final Void ignored) { startNode(node); node.getTarget().acceptVisitor(this, ignored); space(policy.SpaceBeforeMethodCallParentheses); writeToken(Roles.LEFT_BRACKET); node.getArgument().acceptVisitor(this, ignored); writeToken(Roles.RIGHT_BRACKET); endNode(node); return null; }
@Override public Void visitIndexerExpression(final IndexerExpression node, final Void ignored) { startNode(node); node.getTarget().acceptVisitor(this, ignored); space(policy.SpaceBeforeMethodCallParentheses); writeToken(Roles.LEFT_BRACKET); node.getArgument().acceptVisitor(this, ignored); writeToken(Roles.RIGHT_BRACKET); endNode(node); return null; }
@Override public Void visitIndexerExpression(final IndexerExpression node, final Void ignored) { startNode(node); node.getTarget().acceptVisitor(this, ignored); space(policy.SpaceBeforeMethodCallParentheses); writeToken(Roles.LEFT_BRACKET); node.getArgument().acceptVisitor(this, ignored); writeToken(Roles.RIGHT_BRACKET); endNode(node); return null; }
final Expression array = indexer.getTarget(); final Expression argument = indexer.getArgument();
final Expression array = indexer.getTarget(); final Expression argument = indexer.getArgument();
final Expression array = indexer.getTarget(); final Expression argument = indexer.getArgument();
final Expression array = ((IndexerExpression) left).getTarget(); final Expression argument = ((IndexerExpression) left).getArgument();
final Expression array = ((IndexerExpression) left).getTarget(); final Expression argument = ((IndexerExpression) left).getArgument();
final Expression array = ((IndexerExpression) left).getTarget(); final Expression argument = ((IndexerExpression) left).getArgument();