/*
* 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.
*/
/**
* Class creates, controls and invokes doclets.
* @author Neal Gafter (rewrite)
*/
public class DocletInvoker {
}
return path1;
} else {
}
}
this.docletClassName = docletClassName;
// construct class loader
// do prepends to get correct ordering
if (docletParentClassLoader == null)
else
// attempt to find doclet
try {
} catch (ClassNotFoundException exc) {
}
docletClass = dc;
}
/*
* Returns the delegation class loader to use when creating
* appClassLoader (used to load the doclet). The context class
* loader is the best choice, but legacy behavior was to use the
* default delegation class loader (aka system class loader).
*
* Here we favor using the context class loader. To ensure
* compatibility with existing apps, we revert to legacy
* behavior if either or both of the following conditions hold:
*
* 1) the doclet is loadable from the system class loader but not
* from the context class loader,
*
* 2) this.getClass() is loadable from the system class loader but not
* from the context class loader.
*/
return ctxCL;
return sysCL;
// Condition 1.
try {
try {
} catch (ClassNotFoundException e) {
return sysCL;
}
} catch (ClassNotFoundException e) {
}
// Condition 2.
try {
try {
return sysCL;
} catch (ClassNotFoundException e) {
return sysCL;
}
}
} catch (ClassNotFoundException e) {
}
return ctxCL;
}
/**
* Generate documentation here. Return true on success.
*/
try {
} catch (DocletInvokeException exc) {
return false;
}
} else {
return false;
}
}
/**
* Check for doclet added options here. Zero return means
* option not known. Positive value indicates number of
* arguments to option. Negative value means error occurred.
*/
try {
} catch (DocletInvokeException exc) {
return -1;
}
} else {
return -1;
}
}
/**
* Let doclet check that all options are OK. Returning true means
* options are OK. If method does not exist, assume true.
*/
try {
} catch (DocletInvokeException exc) {
return false;
}
} else {
return false;
}
}
/**
* Return the language version supported by this doclet.
* If the method does not exist in the doclet, assume version 1.1.
*/
try {
try {
} catch (DocletInvokeException exc) {
return JAVA_1_1;
}
if (retVal instanceof LanguageVersion) {
return (LanguageVersion)retVal;
} else {
return JAVA_1_1;
}
return null;
}
}
/**
* Utility method for calling doclet functionality
*/
throws DocletInvokeException {
try {
} catch (NoSuchMethodException exc) {
if (returnValueIfNonExistent == null) {
throw new DocletInvokeException();
} else {
return returnValueIfNonExistent;
}
} catch (SecurityException exc) {
throw new DocletInvokeException();
}
throw new DocletInvokeException();
}
try {
} catch (IllegalArgumentException exc) {
throw new DocletInvokeException();
} catch (IllegalAccessException exc) {
throw new DocletInvokeException();
} catch (NullPointerException exc) {
throw new DocletInvokeException();
} catch (InvocationTargetException exc) {
} else {
}
throw new DocletInvokeException();
} finally {
}
}
}