|
Lines 24-29
Link Here
|
| 24 |
import org.eclipse.core.runtime.IStatus; |
24 |
import org.eclipse.core.runtime.IStatus; |
| 25 |
import org.eclipse.core.runtime.NullProgressMonitor; |
25 |
import org.eclipse.core.runtime.NullProgressMonitor; |
| 26 |
import org.eclipse.core.runtime.Status; |
26 |
import org.eclipse.core.runtime.Status; |
|
|
27 |
import org.eclipse.jdt.core.ICompilationUnit; |
| 27 |
import org.eclipse.jdt.core.JavaCore; |
28 |
import org.eclipse.jdt.core.JavaCore; |
| 28 |
import org.eclipse.jdt.core.Signature; |
29 |
import org.eclipse.jdt.core.Signature; |
| 29 |
import org.eclipse.jdt.core.dom.AST; |
30 |
import org.eclipse.jdt.core.dom.AST; |
|
Lines 461-467
Link Here
|
| 461 |
private TagScanner() {} |
462 |
private TagScanner() {} |
| 462 |
|
463 |
|
| 463 |
/** |
464 |
/** |
| 464 |
* Scans the specified source {@linkplain CompilationUnit} for contributed API javadoc tags. |
465 |
* Scans the specified source {@linkplain CompilationUnit} for contributed API Javadoc tags. |
| 465 |
* Tags on methods will have unresolved signatures. |
466 |
* Tags on methods will have unresolved signatures. |
| 466 |
* |
467 |
* |
| 467 |
* @param source the source file to scan for tags |
468 |
* @param source the source file to scan for tags |
|
Lines 469-488
Link Here
|
| 469 |
* @throws CoreException |
470 |
* @throws CoreException |
| 470 |
*/ |
471 |
*/ |
| 471 |
public void scan(CompilationUnit source, IApiDescription description) throws CoreException { |
472 |
public void scan(CompilationUnit source, IApiDescription description) throws CoreException { |
| 472 |
scan(source, description, null); |
473 |
scan(source, description, null, null); |
|
|
474 |
} |
| 475 |
|
| 476 |
/** |
| 477 |
* Scans the specified {@link ICompilationUnit} for contributed API Javadoc tags. |
| 478 |
* Tags on methods will have unresolved signatures. |
| 479 |
* @param unit the compilation unit source |
| 480 |
* @param description the API description to annotate with any new tag rules found |
| 481 |
* @param container optional class file container containing the class file for the given source |
| 482 |
* that can be used to resolve method signatures if required (for tags on methods). If |
| 483 |
* not provided (<code>null</code>), method signatures will be unresolved. |
| 484 |
* @throws CoreException |
| 485 |
*/ |
| 486 |
public void scan(ICompilationUnit unit, IApiDescription description, IClassFileContainer container) throws CoreException { |
| 487 |
scan(new CompilationUnit(unit), description, container, unit.getJavaProject().getOptions(true)); |
| 473 |
} |
488 |
} |
| 474 |
|
489 |
|
| 475 |
/** |
490 |
/** |
| 476 |
* Scans the specified source {@linkplain CompilationUnit} for contributed API javadoc tags. |
491 |
* Scans the specified source {@linkplain CompilationUnit} for contributed API javadoc tags. |
|
|
492 |
* Tags on methods will have unresolved signatures. |
| 477 |
* |
493 |
* |
| 478 |
* @param source the source file to scan for tags |
494 |
* @param source the source file to scan for tags |
| 479 |
* @param description the API description to annotate with any new tag rules found |
495 |
* @param description the API description to annotate with any new tag rules found |
| 480 |
* @param container optional class file container containing the class file for the given source |
496 |
* @param container optional class file container containing the class file for the given source |
| 481 |
* that can be used to resolve method signatures if required (for tags on methods). If |
497 |
* that can be used to resolve method signatures if required (for tags on methods). If |
| 482 |
* not provided (<code>null</code>), method signatures will be unresolved. |
498 |
* not provided (<code>null</code>), method signatures will be unresolved. |
|
|
499 |
* @param options a map of Java compiler options to use when creating the AST to scan |
| 500 |
* |
| 483 |
* @throws CoreException |
501 |
* @throws CoreException |
| 484 |
*/ |
502 |
*/ |
| 485 |
public void scan(CompilationUnit source, IApiDescription description, IClassFileContainer container) throws CoreException { |
503 |
public void scan(CompilationUnit source, IApiDescription description, IClassFileContainer container, Map options) throws CoreException { |
| 486 |
ASTParser parser = ASTParser.newParser(AST.JLS3); |
504 |
ASTParser parser = ASTParser.newParser(AST.JLS3); |
| 487 |
InputStream inputStream = null; |
505 |
InputStream inputStream = null; |
| 488 |
try { |
506 |
try { |
|
Lines 506-512
Link Here
|
| 506 |
} |
524 |
} |
| 507 |
} |
525 |
} |
| 508 |
} |
526 |
} |
| 509 |
Map options = JavaCore.getOptions(); |
527 |
if(options == null) { |
|
|
528 |
options = JavaCore.getOptions(); |
| 529 |
} |
| 510 |
options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); |
530 |
options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, JavaCore.ENABLED); |
| 511 |
parser.setCompilerOptions(options); |
531 |
parser.setCompilerOptions(options); |
| 512 |
org.eclipse.jdt.core.dom.CompilationUnit cunit = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(new NullProgressMonitor()); |
532 |
org.eclipse.jdt.core.dom.CompilationUnit cunit = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(new NullProgressMonitor()); |