/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class could be the main entry point for Javadoc when Javadoc is used as a
* component in a larger software system. It provides operations to
* construct a new javadoc processor, and to run it on a set of source
* files.
* @author Neal Gafter
*/
/**
* Construct a new JavaCompiler processor, using appropriately
* extended phases of the underlying compiler.
*/
super(context);
}
/**
* For javadoc, the parser needs to keep comments. Overrides method from JavaCompiler.
*/
protected boolean keepComments() {
return true;
}
/**
* Construct a new javadoc tool.
*/
try {
// force the use of Javadoc's class reader
// force the use of Javadoc's own enter phase
// force the use of Javadoc's own member enter phase
// force the use of Javadoc's own todo phase
// force the use of Messager as a Log
return new JavadocTool(context);
} catch (CompletionFailure ex) {
return null;
}
}
boolean breakiterator,
boolean docClasses,
boolean legacyDoclet,
boolean quiet) throws IOException {
try {
} else if (isValidPackageName(name)) {
} else {
}
}
if (!docClasses) {
// Recursively search given subpackages. If any packages
//are found, add them to the list.
// Parse the packages
// Parse sources ostensibly belonging to package.
}
// Enter symbols for all files
}
return null;
if (docClasses)
else
}
/** Is the given string a valid package name? */
int index;
}
return isValidClassName(s);
}
/**
* search all directories in path for subdirectory name. Add all
* .java files found in such a directory to args.
*/
throws IOException {
return;
}
boolean hasFiles = false;
if (isValidClassName(simpleName)) {
}
}
}
// messager.notice("main.Loading_source_file", fn);
hasFiles = true;
}
if (!hasFiles) {
}
}
/**
* Recursively search all directories in path for subdirectory name.
* Add all packages found in such a directory to packages list.
*/
throws IOException {
for (String p: excludedPackages)
includedPackages.put(p, false);
path,
return packageFiles;
}
throws IOException {
continue;
}
}
}
}
}
}
if (b == null) {
}
return b;
}
/**
* Recursively search all directories in path for subdirectory name.
* Add all packages found in such a directory to packages list.
*/
return;
boolean addedPackage = false;
// if filenames not null, then found directory
if (!addedPackage
&& (isValidJavaSourceFile(filename) ||
addedPackage = true;
} else if (isValidClassName(filename) &&
}
}
}
}
}
/**
* Return true if given file name is a valid class file name.
* @param file the name of the file to check.
* @return true if given file name is a valid class file name
* and false otherwise.
*/
return isValidClassName(clazzName);
}
/**
* Return true if given file name is a valid Java source file name.
* @param file the name of the file to check.
* @return true if given file name is a valid Java source file name
* and false otherwise.
*/
return isValidClassName(clazzName);
}
/** Are surrogates supported?
*/
private static boolean surrogatesSupported() {
try {
return true;
} catch (NoSuchMethodError ex) {
return false;
}
}
/**
* Return true if given file name is a valid class name
* (including "package-info").
* @param clazzname the name of the class to check.
* @return true if given class name is a valid class name
* and false otherwise.
*/
if (s.length() < 1) return false;
if (s.equals("package-info")) return true;
if (surrogatesSupported) {
return false;
cp = s.codePointAt(j);
return false;
}
} else {
return false;
for (int j=1; j<s.length(); j++)
return false;
}
return true;
}
/**
* From a list of top level trees, return the list of contained class definitions
*/
for (JCCompilationUnit t : trees) {
}
}
}
}