< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/WorkArounds.java

Print this page




 134         for (String customTag : customTagNames) {
 135             customTags.append(sep);
 136             customTags.append(customTag);
 137             sep = DocLint.SEPARATOR;
 138         }
 139         doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
 140         doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + "html5");
 141 
 142         JavacTask t = BasicJavacTask.instance(toolEnv.context);
 143         doclint = new DocLint();
 144         doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
 145     }
 146 
 147     // TODO: fix this up correctly
 148     public boolean haveDocLint() {
 149         return (doclint == null);
 150     }
 151 
 152     /*
 153      * TODO: This method exists because of a bug in javac which does not
 154      * handle "@deprecated tag in package-info.java", when this issue
 155      * is fixed this method and its uses must be jettisoned.
 156      */
 157     public boolean isDeprecated0(Element e) {
 158         if (!utils.getDeprecatedTrees(e).isEmpty()) {
 159             return true;
 160         }
 161         JavacTypes jctypes = ((DocEnvImpl)configuration.docEnv).toolEnv.typeutils;
 162         TypeMirror deprecatedType = utils.getDeprecatedType();
 163         for (AnnotationMirror anno : e.getAnnotationMirrors()) {
 164             if (jctypes.isSameType(anno.getAnnotationType().asElement().asType(), deprecatedType))
 165                 return true;
 166         }
 167         return false;
 168     }
 169 
 170     // TODO: fix jx.l.m add this method.
 171     public boolean isSynthesized(AnnotationMirror aDesc) {
 172         return ((Attribute)aDesc).isSynthesized();
 173     }
 174 
 175     // TODO: fix the caller
 176     public Object getConstValue(VariableElement ve) {
 177         return ((VarSymbol)ve).getConstValue();
 178     }
 179 
 180     // TODO: DocTrees: Trees.getPath(Element e) is slow a factor 4-5 times.
 181     public Map<Element, TreePath> getElementToTreePath() {
 182         return toolEnv.elementToTreePath;
 183     }
 184 
 185     // TODO: we need ElementUtils.getPackage to cope with input strings
 186     // to return the proper unnamedPackage for all supported releases.
 187     PackageElement getUnnamedPackage() {
 188         return (Feature.MODULES.allowedInSource(toolEnv.source))
 189                 ? toolEnv.syms.unnamedModule.unnamedPackage
 190                 : toolEnv.syms.noModule.unnamedPackage;
 191     }
 192 
 193     // TODO: implement in either jx.l.m API (preferred) or DocletEnvironment.
 194     FileObject getJavaFileObject(PackageElement packageElement) {
 195         return ((PackageSymbol)packageElement).sourcefile;
 196     }
 197 
 198     // TODO: needs to ported to jx.l.m.
 199     public TypeElement searchClass(TypeElement klass, String className) {
 200         TypeElement te;
 201 
 202         // search by qualified name in current module first
 203         ModuleElement me = utils.containingModule(klass);
 204         if (me != null) {
 205             te = configuration.docEnv.getElementUtils().getTypeElement(me, className);
 206             if (te != null) {




 134         for (String customTag : customTagNames) {
 135             customTags.append(sep);
 136             customTags.append(customTag);
 137             sep = DocLint.SEPARATOR;
 138         }
 139         doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
 140         doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + "html5");
 141 
 142         JavacTask t = BasicJavacTask.instance(toolEnv.context);
 143         doclint = new DocLint();
 144         doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
 145     }
 146 
 147     // TODO: fix this up correctly
 148     public boolean haveDocLint() {
 149         return (doclint == null);
 150     }
 151 
 152     /*
 153      * TODO: This method exists because of a bug in javac which does not
 154      *       handle "@deprecated tag in package-info.java", when this issue
 155      *       is fixed this method and its uses must be jettisoned.
 156      */
 157     public boolean isDeprecated0(Element e) {
 158         if (!utils.getDeprecatedTrees(e).isEmpty()) {
 159             return true;
 160         }
 161         JavacTypes jctypes = ((DocEnvImpl)configuration.docEnv).toolEnv.typeutils;
 162         TypeMirror deprecatedType = utils.getDeprecatedType();
 163         for (AnnotationMirror anno : e.getAnnotationMirrors()) {
 164             if (jctypes.isSameType(anno.getAnnotationType().asElement().asType(), deprecatedType))
 165                 return true;
 166         }
 167         return false;
 168     }
 169 
 170     // TODO: fix jx.l.m add this method.
 171     public boolean isSynthesized(AnnotationMirror aDesc) {
 172         return ((Attribute)aDesc).isSynthesized();
 173     }
 174 
 175     // TODO: fix the caller
 176     public Object getConstValue(VariableElement ve) {
 177         return ((VarSymbol)ve).getConstValue();
 178     }
 179 
 180     // TODO: DocTrees: Trees.getPath(Element e) is slow a factor 4-5 times.
 181     public Map<Element, TreePath> getElementToTreePath() {
 182         return toolEnv.elementToTreePath;
 183     }
 184 
 185     // TODO: we need ElementUtils.getPackage to cope with input strings
 186     //       to return the proper unnamedPackage for all supported releases.
 187     PackageElement getUnnamedPackage() {
 188         return (Feature.MODULES.allowedInSource(toolEnv.source))
 189                 ? toolEnv.syms.unnamedModule.unnamedPackage
 190                 : toolEnv.syms.noModule.unnamedPackage;
 191     }
 192 
 193     // TODO: implement in either jx.l.m API (preferred) or DocletEnvironment.
 194     FileObject getJavaFileObject(PackageElement packageElement) {
 195         return ((PackageSymbol)packageElement).sourcefile;
 196     }
 197 
 198     // TODO: needs to ported to jx.l.m.
 199     public TypeElement searchClass(TypeElement klass, String className) {
 200         TypeElement te;
 201 
 202         // search by qualified name in current module first
 203         ModuleElement me = utils.containingModule(klass);
 204         if (me != null) {
 205             te = configuration.docEnv.getElementUtils().getTypeElement(me, className);
 206             if (te != null) {


< prev index next >