Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 28542 Details for
Bug 110172
[plan] API to extract the Javadoc on org.eclipse.jdt.core.IMember
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
API + implementation
patch_110172.txt (text/plain), 3.76 KB, created by
Olivier Thomann
on 2005-10-20 15:33:38 EDT
(
hide
)
Description:
API + implementation
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-10-20 15:33:38 EDT
Size:
3.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/Member.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Member.java,v >retrieving revision 1.40 >diff -u -r1.40 Member.java >--- model/org/eclipse/jdt/internal/core/Member.java 17 Oct 2005 09:10:28 -0000 1.40 >+++ model/org/eclipse/jdt/internal/core/Member.java 20 Oct 2005 19:32:37 -0000 >@@ -15,6 +15,9 @@ > > import org.eclipse.jdt.core.*; > import org.eclipse.jdt.core.compiler.CharOperation; >+import org.eclipse.jdt.core.compiler.IScanner; >+import org.eclipse.jdt.core.compiler.ITerminalSymbols; >+import org.eclipse.jdt.core.compiler.InvalidInputException; > import org.eclipse.jdt.internal.compiler.impl.Constant; > import org.eclipse.jdt.internal.compiler.lookup.TypeIds; > import org.eclipse.jdt.internal.core.util.MementoTokenizer; >@@ -247,6 +250,44 @@ > } > return lastLocalContext; > } >+public ISourceRange getJavadocRange() throws JavaModelException { >+ ISourceRange range= this.getSourceRange(); >+ if (range == null) return null; >+ IBuffer buf= this.isBinary() ? this.getClassFile().getBuffer() : this.getCompilationUnit().getBuffer(); >+ final int start= range.getOffset(); >+ final int length= range.getLength(); >+ if (length > 0 && buf.getChar(start) == '/') { >+ IScanner scanner= ToolFactory.createScanner(true, false, false, false); >+ scanner.setSource(buf.getText(start, length).toCharArray()); >+ try { >+ int docOffset= -1; >+ int docEnd= -1; >+ >+ int terminal= scanner.getNextToken(); >+ loop: while (true) { >+ switch(terminal) { >+ case ITerminalSymbols.TokenNameCOMMENT_JAVADOC : >+ docOffset= scanner.getCurrentTokenStartPosition(); >+ docEnd= scanner.getCurrentTokenEndPosition() + 1; >+ terminal= scanner.getNextToken(); >+ break; >+ case ITerminalSymbols.TokenNameCOMMENT_LINE : >+ case ITerminalSymbols.TokenNameCOMMENT_BLOCK : >+ terminal= scanner.getNextToken(); >+ continue loop; >+ default : >+ break loop; >+ } >+ } >+ if (docOffset != -1) { >+ return new SourceRange(docOffset + start, docEnd - docOffset + 1); >+ } >+ } catch (InvalidInputException ex) { >+ // try if there is inherited Javadoc >+ } >+ } >+ return null; >+} > /** > * @see IMember > */ >Index: model/org/eclipse/jdt/core/IMember.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMember.java,v >retrieving revision 1.18 >diff -u -r1.18 IMember.java >--- model/org/eclipse/jdt/core/IMember.java 13 Oct 2005 09:09:52 -0000 1.18 >+++ model/org/eclipse/jdt/core/IMember.java 20 Oct 2005 19:32:37 -0000 >@@ -72,6 +72,22 @@ > */ > int getFlags() throws JavaModelException; > /** >+ * Returns the Javadoc range if this element is from source or if this element >+ * is a binary element with an attached source, null otherwise. >+ * >+ * <p>If this element is from source, the javadoc range is >+ * extracted from the corresponding source.</p> >+ * <p>If this element is from a binary, the javadoc is extracted from the >+ * attached source if present.</p> >+ * >+ * @exception JavaModelException if this element does not exist or if an >+ * exception occurs while accessing its corresponding resource. >+ * @return a source range corresponding to the javadoc source or <code>null</code> >+ * if no source is available or the element has no javadoc comment. >+ * @since 3.2 >+ */ >+ISourceRange getJavadocRange() throws JavaModelException; >+/** > * Returns the source range of this member's simple name, > * or <code>null</code> if this member does not have a name > * (for example, an initializer), or if this member does not have
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 110172
:
27701
| 28542 |
28544