Path: blob/master/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/DocletEnvironment.java
41159 views
/*1* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package jdk.javadoc.doclet;2627import java.util.Set;2829import javax.lang.model.SourceVersion;30import javax.lang.model.element.Element;31import javax.lang.model.element.TypeElement;32import javax.lang.model.util.Elements;33import javax.lang.model.util.Types;34import javax.tools.JavaFileManager;35import javax.tools.JavaFileObject.Kind;3637import com.sun.source.util.DocTrees;3839/**40* Represents the operating environment of a single invocation41* of the doclet. This object can be used to access the program42* structures, various utilities and the user specified elements43* on the command line.44*45* @since 946*/47public interface DocletEnvironment {4849/**50* Returns the elements <a href="package-summary.html#specified">specified</a>51* when the tool is invoked.52*53* @return the set of specified elements54*/55Set<? extends Element> getSpecifiedElements();5657/**58* Returns the module, package and type elements that should be59* <a href="package-summary.html#included">included</a> in the60* documentation.61*62* @return the set of included elements63*/64Set<? extends Element> getIncludedElements();6566/**67* Returns an instance of the {@code DocTrees} utility class.68* This class provides methods to access {@code TreePath}s, {@code DocCommentTree}s69* and so on.70*71* @return a utility class to operate on doc trees72*/73DocTrees getDocTrees();7475/**76* Returns an instance of the {@code Elements} utility class.77* This class provides methods for operating on78* {@link javax.lang.model.element.Element elements}.79*80* @return a utility class to operate on elements81*/82Elements getElementUtils();8384/**85* Returns an instance of the {@code Types} utility class.86* This class provides methods for operating on87* {@link javax.lang.model.type.TypeMirror type mirrors}.88*89* @return a utility class to operate on type mirrors90*/91Types getTypeUtils();9293/**94* Returns true if an element should be95* <a href="package-summary.html#included">included</a> in the96* documentation.97*98* @param e the element99* @return true if included, false otherwise100*/101boolean isIncluded(Element e);102103/**104* Returns true if the element is <a href="package-summary.html#selected">selected</a>.105*106* @param e the element107* @return true if selected, false otherwise108*/109boolean isSelected(Element e);110111/**112* Returns the file manager used to read and write files.113*114* @return the file manager used to read and write files115*/116JavaFileManager getJavaFileManager();117118/**119* Returns the source version of the source files that were read.120*121* @return the source version122*/123SourceVersion getSourceVersion();124125/**126* Returns the required level of module documentation.127*128* @return the required level of module documentation129*/130ModuleMode getModuleMode();131132/**133* Returns the file kind of a type element.134*135* @param type the type element136* @return the file kind137*/138Kind getFileKind(TypeElement type);139140/**141* The mode specifying the level of detail of module documentation.142*/143enum ModuleMode {144/** Indicate API level documentation is required */145API,146/** Indicate Detailed documentation is required */147ALL148}149}150151152