langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java
equal
deleted
inserted
replaced
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package jdk.javadoc.internal.doclets.toolkit.util; |
26 package jdk.javadoc.internal.doclets.toolkit.util; |
27 |
27 |
28 import java.io.IOException; |
|
29 import java.lang.annotation.Documented; |
28 import java.lang.annotation.Documented; |
30 import java.lang.ref.SoftReference; |
29 import java.lang.ref.SoftReference; |
31 import java.text.CollationKey; |
30 import java.text.CollationKey; |
32 import java.text.Collator; |
31 import java.text.Collator; |
33 import java.util.*; |
32 import java.util.*; |
75 import com.sun.source.util.DocSourcePositions; |
74 import com.sun.source.util.DocSourcePositions; |
76 import com.sun.source.util.DocTrees; |
75 import com.sun.source.util.DocTrees; |
77 import com.sun.source.util.TreePath; |
76 import com.sun.source.util.TreePath; |
78 import jdk.javadoc.internal.doclets.toolkit.CommentUtils.DocCommentDuo; |
77 import jdk.javadoc.internal.doclets.toolkit.CommentUtils.DocCommentDuo; |
79 import jdk.javadoc.internal.doclets.toolkit.Configuration; |
78 import jdk.javadoc.internal.doclets.toolkit.Configuration; |
80 import jdk.javadoc.internal.doclets.toolkit.DocletException; |
|
81 import jdk.javadoc.internal.doclets.toolkit.Messages; |
79 import jdk.javadoc.internal.doclets.toolkit.Messages; |
82 import jdk.javadoc.internal.doclets.toolkit.Resources; |
|
83 import jdk.javadoc.internal.doclets.toolkit.WorkArounds; |
80 import jdk.javadoc.internal.doclets.toolkit.WorkArounds; |
84 |
81 |
85 import static javax.lang.model.element.ElementKind.*; |
82 import static javax.lang.model.element.ElementKind.*; |
86 import static javax.lang.model.element.Modifier.*; |
83 import static javax.lang.model.element.Modifier.*; |
87 import static javax.lang.model.type.TypeKind.*; |
84 import static javax.lang.model.type.TypeKind.*; |
254 * <cite>The Java™ Language Specification</cite>, |
251 * <cite>The Java™ Language Specification</cite>, |
255 * all the outer classes and static inner classes are core classes. |
252 * all the outer classes and static inner classes are core classes. |
256 */ |
253 */ |
257 public boolean isCoreClass(TypeElement e) { |
254 public boolean isCoreClass(TypeElement e) { |
258 return getEnclosingTypeElement(e) == null || isStatic(e); |
255 return getEnclosingTypeElement(e) == null || isStatic(e); |
259 } |
|
260 |
|
261 public boolean matches(Element e1, Element e2) { |
|
262 if (isExecutableElement(e1) && isExecutableElement(e1)) { |
|
263 return executableMembersEqual((ExecutableElement)e1, (ExecutableElement)e2); |
|
264 } else { |
|
265 return e1.getSimpleName().equals(e2.getSimpleName()); |
|
266 } |
|
267 } |
256 } |
268 |
257 |
269 /** |
258 /** |
270 * Copy doc-files directory and its contents from the source |
259 * Copy doc-files directory and its contents from the source |
271 * package directory to the generated documentation directory. |
260 * package directory to the generated documentation directory. |
2157 return convertToExecutableElement(getItems(e, true, METHOD)); |
2146 return convertToExecutableElement(getItems(e, true, METHOD)); |
2158 } |
2147 } |
2159 |
2148 |
2160 List<ExecutableElement> getMethodsUnfiltered(Element e) { |
2149 List<ExecutableElement> getMethodsUnfiltered(Element e) { |
2161 return convertToExecutableElement(getItems(e, false, METHOD)); |
2150 return convertToExecutableElement(getItems(e, false, METHOD)); |
|
2151 } |
|
2152 |
|
2153 public int getOrdinalValue(VariableElement member) { |
|
2154 if (member == null || member.getKind() != ENUM_CONSTANT) { |
|
2155 throw new IllegalArgumentException("must be an enum constant: " + member); |
|
2156 } |
|
2157 return member.getEnclosingElement().getEnclosedElements().indexOf(member); |
2162 } |
2158 } |
2163 |
2159 |
2164 public long getLineNumber(Element e) { |
2160 public long getLineNumber(Element e) { |
2165 TreePath path = getTreePath(e); |
2161 TreePath path = getTreePath(e); |
2166 if (path == null) { // maybe null if synthesized |
2162 if (path == null) { // maybe null if synthesized |