public T finish() { node.accept(visitor); return node; } }
public T finish() { node.accept(visitor); return node; } }
private ASTNode toTree(lombok.ast.Node node) { if (node == null) return null; EcjTreeBuilder newBuilder = create(); node.accept(newBuilder.visitor); bubblingFlags.addAll(newBuilder.bubblingFlags); try { return newBuilder.get(); } catch (RuntimeException e) { System.err.printf("Node '%s' (%s) did not produce any results\n", node, node.getClass().getSimpleName()); throw e; } }
private ASTNode toTree(lombok.ast.Node node) { if (node == null) return null; EcjTreeBuilder newBuilder = create(); node.accept(newBuilder.visitor); bubblingFlags.addAll(newBuilder.bubblingFlags); try { return newBuilder.get(); } catch (RuntimeException e) { System.err.printf("Node '%s' (%s) did not produce any results\n", node, node.getClass().getSimpleName()); throw e; } }
private <T extends ASTNode> List<T> toList(Class<T> type, lombok.ast.Node node) { if (node == null) return Lists.newArrayList(); EcjTreeBuilder newBuilder = create(); node.accept(newBuilder.visitor); bubblingFlags.addAll(newBuilder.bubblingFlags); @SuppressWarnings("unchecked") List<T> all = (List<T>)newBuilder.getAll(); return Lists.newArrayList(all); }
private JCTree toTree(Node node) { if (node == null) return null; JcTreeBuilder builder = create(); node.accept(builder.visitor); try { return builder.get(); } catch (RuntimeException e) { System.err.printf("Node '%s' (%s) did not produce any results\n", node, node.getClass().getSimpleName()); throw e; } }
private <T extends ASTNode> List<T> toList(Class<T> type, lombok.ast.Node node) { if (node == null) return Lists.newArrayList(); EcjTreeBuilder newBuilder = create(); node.accept(newBuilder.visitor); bubblingFlags.addAll(newBuilder.bubblingFlags); @SuppressWarnings("unchecked") List<T> all = (List<T>)newBuilder.getAll(); return Lists.newArrayList(all); }
private JCTree toTree(Node node) { if (node == null) return null; JcTreeBuilder builder = create(); node.accept(builder.visitor); try { return builder.get(); } catch (RuntimeException e) { System.err.printf("Node '%s' (%s) did not produce any results\n", node, node.getClass().getSimpleName()); throw e; } }
private <T extends ASTNode> List<T> toList(Class<T> type, lombok.ast.Node node) { if (node == null) return Lists.newArrayList(); EcjTreeBuilder newBuilder = create(); node.accept(newBuilder.visitor); bubblingFlags.addAll(newBuilder.bubblingFlags); @SuppressWarnings("unchecked") List<T> all = (List<T>)newBuilder.getAll(); return Lists.newArrayList(all); }
/** Returns the resource name corresponding to the first argument in the given call */ @Nullable public static String getResourceForFirstArg( @NonNull lombok.ast.Node method, @NonNull lombok.ast.Node call) { assert call instanceof MethodInvocation || call instanceof ConstructorInvocation; StringTracker tracker = new StringTracker(null, method, call, 0); method.accept(tracker); return tracker.getFormatStringName(); }
private <T extends JCTree> List<T> toList(Class<T> type, Node node) { if (node == null) return List.nil(); JcTreeBuilder builder = create(); node.accept(builder.visitor); @SuppressWarnings("unchecked") List<T> all = (List<T>)builder.getAll(); return List.<T>nil().appendList(all); }
private <T extends JCTree> List<T> toList(Class<T> type, Node node) { if (node == null) return List.nil(); JcTreeBuilder builder = create(); node.accept(builder.visitor); @SuppressWarnings("unchecked") List<T> all = (List<T>)builder.getAll(); return List.<T>nil().appendList(all); }
@Override public String process(Source source, Node in) throws ConversionProblem { SourceFormatter formatter = new TextFormatter(); in.accept(new SourcePrinter(formatter)); for (ParseProblem x : source.getProblems()) { formatter.addError(x.getPosition().getStart(), x.getPosition().getEnd(), x.getMessage()); } return formatter.finish(); } };
@Override public String process(Source source, Node in) throws ConversionProblem { SourceFormatter formatter = new TextFormatter(); in.accept(new SourcePrinter(formatter)); for (ParseProblem x : source.getProblems()) { formatter.addError(x.getPosition().getStart(), x.getPosition().getEnd(), x.getMessage()); } return formatter.finish(); } };
@Override public String process(Source source, Node in) throws ConversionProblem { SourceFormatter formatter = new TextFormatter(); in.accept(new SourcePrinter(formatter)); for (ParseProblem x : source.getProblems()) { formatter.addError(x.getPosition().getStart(), x.getPosition().getEnd(), x.getMessage()); } return formatter.finish(); } };
@Override public String process(Source source, Node in) throws ConversionProblem { SourceFormatter formatter = new HtmlFormatter(source.getRawInput()); in.accept(new SourcePrinter(formatter)); for (ParseProblem x : source.getProblems()) { formatter.addError(x.getPosition().getStart(), x.getPosition().getEnd(), x.getMessage()); } return formatter.finish(); } };
@Override public String process(Source source, Node in) throws ConversionProblem { SourceFormatter formatter = new HtmlFormatter(source.getRawInput()); in.accept(new SourcePrinter(formatter)); for (ParseProblem x : source.getProblems()) { formatter.addError(x.getPosition().getStart(), x.getPosition().getEnd(), x.getMessage()); } return formatter.finish(); } };
@Override public String process(Source source, Node in) throws ConversionProblem { SourceFormatter formatter = positions ? StructureFormatter.formatterWithPositions() : StructureFormatter.formatterWithoutPositions(); in.accept(new SourcePrinter(formatter)); for (ParseProblem x : source.getProblems()) { formatter.addError(x.getPosition().getStart(), x.getPosition().getEnd(), x.getMessage()); } return formatter.finish(); } };
@Override public String process(Source source, Node in) throws ConversionProblem { SourceFormatter formatter = new HtmlFormatter(source.getRawInput()); in.accept(new SourcePrinter(formatter)); for (ParseProblem x : source.getProblems()) { formatter.addError(x.getPosition().getStart(), x.getPosition().getEnd(), x.getMessage()); } return formatter.finish(); } };
@Override public String process(Source source, Node in) throws ConversionProblem { SourceFormatter formatter = positions ? StructureFormatter.formatterWithPositions() : StructureFormatter.formatterWithoutPositions(); in.accept(new SourcePrinter(formatter)); for (ParseProblem x : source.getProblems()) { formatter.addError(x.getPosition().getStart(), x.getPosition().getEnd(), x.getMessage()); } return formatter.finish(); } };