@Override public Scanner newScanner(CharSequence input) { if (input instanceof CharBuffer) { return new DocCommentScanner(this, (CharBuffer)input); } else { char[] array = input.toString().toCharArray(); return newScanner(array, array.length); } }
DocCommentScanner.Factory.preRegister(context); options.put("save-parameter-names", "save-parameter-names"); reader.saveParameterNames = true;
DocCommentScanner.Factory.preRegister(context); options.put("save-parameter-names", "save-parameter-names"); reader.saveParameterNames = true;
private void prepareCompiler() throws IOException { if (!used.getAndSet(true)) { beginContext(); compilerMain.setOptions(Options.instance(context)); compilerMain.filenames = new ListBuffer<File>(); List<File> filenames = compilerMain.processArgs(CommandLine.parse(args)); if (!filenames.isEmpty()) throw new IllegalArgumentException("Malformed arguments " + filenames.toString(" ")); compiler = JavaCompiler.instance(context); // force the use of the scanner that captures Javadoc comments com.sun.tools.javac.parser.DocCommentScanner.Factory.preRegister(context); compiler.keepComments = true; compiler.genEndPos = true; // NOTE: this value will be updated after annotation processing compiler.initProcessAnnotations(processors); notYetEntered = new HashMap<JavaFileObject, JCCompilationUnit>(); for (JavaFileObject file: fileObjects) notYetEntered.put(file, null); genList = new ListBuffer<Env<AttrContext>>(); // endContext will be called when all classes have been generated // TODO: should handle the case after each phase if errors have occurred args = null; } }
private void prepareCompiler() throws IOException { if (!used.getAndSet(true)) { beginContext(); compilerMain.setOptions(Options.instance(context)); compilerMain.filenames = new ListBuffer<File>(); List<File> filenames = compilerMain.processArgs(CommandLine.parse(args)); if (!filenames.isEmpty()) throw new IllegalArgumentException("Malformed arguments " + filenames.toString(" ")); compiler = JavaCompiler.instance(context); // force the use of the scanner that captures Javadoc comments com.sun.tools.javac.parser.DocCommentScanner.Factory.preRegister(context); compiler.keepComments = true; compiler.genEndPos = true; // NOTE: this value will be updated after annotation processing compiler.initProcessAnnotations(processors); notYetEntered = new HashMap<JavaFileObject, JCCompilationUnit>(); for (JavaFileObject file: fileObjects) notYetEntered.put(file, null); genList = new ListBuffer<Env<AttrContext>>(); // endContext will be called when all classes have been generated // TODO: should handle the case after each phase if errors have occurred args = null; } }
@Override public Scanner newScanner(CharSequence input) { if (input instanceof CharBuffer) { return new DocCommentScanner(this, (CharBuffer)input); } else { char[] array = input.toString().toCharArray(); return newScanner(array, array.length); } }