23 * have any questions. |
23 * have any questions. |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.tools.javadoc; |
26 package com.sun.tools.javadoc; |
27 |
27 |
|
28 import java.lang.reflect.Modifier; |
|
29 import java.text.CollationKey; |
|
30 |
28 import com.sun.javadoc.*; |
31 import com.sun.javadoc.*; |
29 |
32 |
|
33 import com.sun.tools.javac.code.Flags; |
|
34 import com.sun.tools.javac.code.Symbol.*; |
|
35 import com.sun.tools.javac.code.Type; |
|
36 import com.sun.tools.javac.tree.JCTree.JCMethodDecl; |
30 import com.sun.tools.javac.util.List; |
37 import com.sun.tools.javac.util.List; |
31 import com.sun.tools.javac.util.ListBuffer; |
38 import com.sun.tools.javac.util.ListBuffer; |
32 import com.sun.tools.javac.util.Position; |
39 import com.sun.tools.javac.util.Position; |
33 import com.sun.tools.javac.code.Flags; |
|
34 import com.sun.tools.javac.code.Type; |
|
35 import com.sun.tools.javac.code.Symbol; |
|
36 import com.sun.tools.javac.code.Symbol.*; |
|
37 import com.sun.tools.javac.tree.JCTree.JCMethodDecl; |
|
38 |
|
39 import java.text.CollationKey; |
|
40 |
|
41 import java.lang.reflect.Modifier; |
|
42 |
40 |
43 /** |
41 /** |
44 * Represents a method or constructor of a java class. |
42 * Represents a method or constructor of a java class. |
45 * |
43 * |
46 * @since 1.2 |
44 * @since 1.2 |
265 * Return the source position of the entity, or null if |
263 * Return the source position of the entity, or null if |
266 * no position is available. |
264 * no position is available. |
267 */ |
265 */ |
268 public SourcePosition position() { |
266 public SourcePosition position() { |
269 if (sym.enclClass().sourcefile == null) return null; |
267 if (sym.enclClass().sourcefile == null) return null; |
270 return SourcePositionImpl.make(sym.enclClass().sourcefile.toString(), |
268 return SourcePositionImpl.make(sym.enclClass().sourcefile, |
271 (tree==null) ? 0 : tree.pos, |
269 (tree==null) ? 0 : tree.pos, |
272 lineMap); |
270 lineMap); |
273 } |
271 } |
274 } |
272 } |