Java Code Examples for javax.tools.JavaFileManager#hasLocation()
The following examples show how to use
javax.tools.JavaFileManager#hasLocation() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JavacProcessingEnvironment.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private void initProcessorClassLoader() { JavaFileManager fileManager = context.get(JavaFileManager.class); try { // If processorpath is not explicitly set, use the classpath. processorClassLoader = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? fileManager.getClassLoader(ANNOTATION_PROCESSOR_PATH) : fileManager.getClassLoader(CLASS_PATH); if (processorClassLoader != null && processorClassLoader instanceof Closeable) { JavaCompiler compiler = JavaCompiler.instance(context); compiler.closeables = compiler.closeables.prepend((Closeable) processorClassLoader); } } catch (SecurityException e) { processorClassLoaderException = e; } }
Example 2
Source File: JavacProcessingEnvironment.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void initProcessorClassLoader() { JavaFileManager fileManager = context.get(JavaFileManager.class); try { // If processorpath is not explicitly set, use the classpath. processorClassLoader = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? fileManager.getClassLoader(ANNOTATION_PROCESSOR_PATH) : fileManager.getClassLoader(CLASS_PATH); if (processorClassLoader != null && processorClassLoader instanceof Closeable) { JavaCompiler compiler = JavaCompiler.instance(context); compiler.closeables = compiler.closeables.prepend((Closeable) processorClassLoader); } } catch (SecurityException e) { processorClassLoaderException = e; } }
Example 3
Source File: JavacProcessingEnvironment.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private void initProcessorClassLoader() { JavaFileManager fileManager = context.get(JavaFileManager.class); try { // If processorpath is not explicitly set, use the classpath. processorClassLoader = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? fileManager.getClassLoader(ANNOTATION_PROCESSOR_PATH) : fileManager.getClassLoader(CLASS_PATH); if (processorClassLoader != null && processorClassLoader instanceof Closeable) { JavaCompiler compiler = JavaCompiler.instance(context); compiler.closeables = compiler.closeables.prepend((Closeable) processorClassLoader); } } catch (SecurityException e) { processorClassLoaderException = e; } }
Example 4
Source File: JavacProcessingEnvironment.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * Returns an empty processor iterator if no processors are on the * relevant path, otherwise if processors are present, logs an * error. Called when a service loader is unavailable for some * reason, either because a service loader class cannot be found * or because a security policy prevents class loaders from being * created. * * @param key The resource key to use to log an error message * @param e If non-null, pass this exception to Abort */ private Iterator<Processor> handleServiceLoaderUnavailability(String key, Exception e) { JavaFileManager fileManager = context.get(JavaFileManager.class); if (fileManager instanceof JavacFileManager) { StandardJavaFileManager standardFileManager = (JavacFileManager) fileManager; Iterable<? extends File> workingPath = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? standardFileManager.getLocation(ANNOTATION_PROCESSOR_PATH) : standardFileManager.getLocation(CLASS_PATH); if (needClassLoader(options.get(PROCESSOR), workingPath) ) handleException(key, e); } else { handleException(key, e); } java.util.List<Processor> pl = Collections.emptyList(); return pl.iterator(); }
Example 5
Source File: JavacProcessingEnvironment.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private void initProcessorClassLoader() { JavaFileManager fileManager = context.get(JavaFileManager.class); try { // If processorpath is not explicitly set, use the classpath. processorClassLoader = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? fileManager.getClassLoader(ANNOTATION_PROCESSOR_PATH) : fileManager.getClassLoader(CLASS_PATH); if (processorClassLoader != null && processorClassLoader instanceof Closeable) { JavaCompiler compiler = JavaCompiler.instance(context); compiler.closeables = compiler.closeables.prepend((Closeable) processorClassLoader); } } catch (SecurityException e) { processorClassLoaderException = e; } }
Example 6
Source File: JavacProcessingEnvironment.java From java-n-IDE-for-Android with Apache License 2.0 | 6 votes |
/** * Returns an empty processor iterator if no processors are on the * relevant path, otherwise if processors are present, logs an * error. Called when a service loader is unavailable for some * reason, either because a service loader class cannot be found * or because a security policy prevents class loaders from being * created. * * @param key The resource key to use to log an error message * @param e If non-null, pass this exception to Abort */ private Iterator<Processor> handleServiceLoaderUnavailability(String key, Exception e) { JavaFileManager fileManager = context.get(JavaFileManager.class); if (fileManager instanceof JavacFileManager) { StandardJavaFileManager standardFileManager = (JavacFileManager) fileManager; Iterable<? extends File> workingPath = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? standardFileManager.getLocation(ANNOTATION_PROCESSOR_PATH) : standardFileManager.getLocation(CLASS_PATH); if (needClassLoader(options.get(PROCESSOR), workingPath) ) handleException(key, e); } else { handleException(key, e); } java.util.List<Processor> pl = Collections.emptyList(); return pl.iterator(); }
Example 7
Source File: JavacProcessingEnvironment.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void initProcessorClassLoader() { JavaFileManager fileManager = context.get(JavaFileManager.class); try { // If processorpath is not explicitly set, use the classpath. processorClassLoader = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? fileManager.getClassLoader(ANNOTATION_PROCESSOR_PATH) : fileManager.getClassLoader(CLASS_PATH); if (processorClassLoader != null && processorClassLoader instanceof Closeable) { JavaCompiler compiler = JavaCompiler.instance(context); compiler.closeables = compiler.closeables.prepend((Closeable) processorClassLoader); } } catch (SecurityException e) { processorClassLoaderException = e; } }
Example 8
Source File: JavacProcessingEnvironment.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Returns an empty processor iterator if no processors are on the * relevant path, otherwise if processors are present, logs an * error. Called when a service loader is unavailable for some * reason, either because a service loader class cannot be found * or because a security policy prevents class loaders from being * created. * * @param key The resource key to use to log an error message * @param e If non-null, pass this exception to Abort */ private Iterator<Processor> handleServiceLoaderUnavailability(String key, Exception e) { JavaFileManager fileManager = context.get(JavaFileManager.class); if (fileManager instanceof JavacFileManager) { StandardJavaFileManager standardFileManager = (JavacFileManager) fileManager; Iterable<? extends File> workingPath = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? standardFileManager.getLocation(ANNOTATION_PROCESSOR_PATH) : standardFileManager.getLocation(CLASS_PATH); if (needClassLoader(options.get(PROCESSOR), workingPath) ) handleException(key, e); } else { handleException(key, e); } java.util.List<Processor> pl = Collections.emptyList(); return pl.iterator(); }
Example 9
Source File: JavacProcessingEnvironment.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private void initProcessorClassLoader() { JavaFileManager fileManager = context.get(JavaFileManager.class); try { // If processorpath is not explicitly set, use the classpath. processorClassLoader = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? fileManager.getClassLoader(ANNOTATION_PROCESSOR_PATH) : fileManager.getClassLoader(CLASS_PATH); if (processorClassLoader != null && processorClassLoader instanceof Closeable) { JavaCompiler compiler = JavaCompiler.instance(context); compiler.closeables = compiler.closeables.prepend((Closeable) processorClassLoader); } } catch (SecurityException e) { processorClassLoaderException = e; } }
Example 10
Source File: JavacProcessingEnvironment.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * Returns an empty processor iterator if no processors are on the * relevant path, otherwise if processors are present, logs an * error. Called when a service loader is unavailable for some * reason, either because a service loader class cannot be found * or because a security policy prevents class loaders from being * created. * * @param key The resource key to use to log an error message * @param e If non-null, pass this exception to Abort */ private Iterator<Processor> handleServiceLoaderUnavailability(String key, Exception e) { JavaFileManager fileManager = context.get(JavaFileManager.class); if (fileManager instanceof JavacFileManager) { StandardJavaFileManager standardFileManager = (JavacFileManager) fileManager; Iterable<? extends File> workingPath = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? standardFileManager.getLocation(ANNOTATION_PROCESSOR_PATH) : standardFileManager.getLocation(CLASS_PATH); if (needClassLoader(options.get(PROCESSOR), workingPath) ) handleException(key, e); } else { handleException(key, e); } java.util.List<Processor> pl = Collections.emptyList(); return pl.iterator(); }
Example 11
Source File: JavacProcessingEnvironment.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * Returns an empty processor iterator if no processors are on the * relevant path, otherwise if processors are present, logs an * error. Called when a service loader is unavailable for some * reason, either because a service loader class cannot be found * or because a security policy prevents class loaders from being * created. * * @param key The resource key to use to log an error message * @param e If non-null, pass this exception to Abort */ private Iterator<Processor> handleServiceLoaderUnavailability(String key, Exception e) { JavaFileManager fileManager = context.get(JavaFileManager.class); if (fileManager instanceof JavacFileManager) { StandardJavaFileManager standardFileManager = (JavacFileManager) fileManager; Iterable<? extends File> workingPath = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? standardFileManager.getLocation(ANNOTATION_PROCESSOR_PATH) : standardFileManager.getLocation(CLASS_PATH); if (needClassLoader(options.get(PROCESSOR), workingPath) ) handleException(key, e); } else { handleException(key, e); } java.util.List<Processor> pl = Collections.emptyList(); return pl.iterator(); }
Example 12
Source File: TagletManager.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Add a new <code>Taglet</code>. Print a message to indicate whether or not * the Taglet was registered properly. * @param classname the name of the class representing the custom tag. * @param fileManager the filemanager to load classes and resources. * @param tagletPath the path to the class representing the custom tag. */ public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { try { ClassLoader tagClassLoader; if (!fileManager.hasLocation(TAGLET_PATH)) { List<File> paths = new ArrayList<>(); if (tagletPath != null) { for (String pathname : tagletPath.split(File.pathSeparator)) { paths.add(new File(pathname)); } } if (fileManager instanceof StandardJavaFileManager) { ((StandardJavaFileManager) fileManager).setLocation(TAGLET_PATH, paths); } } tagClassLoader = fileManager.getClassLoader(TAGLET_PATH); Class<? extends jdk.javadoc.doclet.Taglet> customTagClass = tagClassLoader.loadClass(classname).asSubclass(jdk.javadoc.doclet.Taglet.class); jdk.javadoc.doclet.Taglet instance = customTagClass.getConstructor().newInstance(); instance.init(docEnv, doclet); Taglet newLegacy = new UserTaglet(instance); String tname = newLegacy.getName(); Taglet t = customTags.get(tname); if (t != null) { customTags.remove(tname); } customTags.put(tname, newLegacy); messages.notice("doclet.Notice_taglet_registered", classname); } catch (Exception exc) { messages.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname); } }
Example 13
Source File: TagletManager.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * Add a new <code>Taglet</code>. Print a message to indicate whether or not * the Taglet was registered properly. * @param classname the name of the class representing the custom tag. * @param tagletPath the path to the class representing the custom tag. */ public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { try { Class<?> customTagClass = null; // construct class loader String cpString = null; // make sure env.class.path defaults to dot ClassLoader tagClassLoader; if (fileManager != null && fileManager.hasLocation(DocumentationTool.Location.TAGLET_PATH)) { tagClassLoader = fileManager.getClassLoader(DocumentationTool.Location.TAGLET_PATH); } else { // do prepends to get correct ordering cpString = appendPath(System.getProperty("env.class.path"), cpString); cpString = appendPath(System.getProperty("java.class.path"), cpString); cpString = appendPath(tagletPath, cpString); tagClassLoader = new URLClassLoader(pathToURLs(cpString)); } customTagClass = tagClassLoader.loadClass(classname); Method meth = customTagClass.getMethod("register", new Class<?>[] {java.util.Map.class}); Object[] list = customTags.values().toArray(); Taglet lastTag = (list != null && list.length > 0) ? (Taglet) list[list.length-1] : null; meth.invoke(null, new Object[] {customTags}); list = customTags.values().toArray(); Object newLastTag = (list != null&& list.length > 0) ? list[list.length-1] : null; if (lastTag != newLastTag) { //New taglets must always be added to the end of the LinkedHashMap. //If the current and previous last taglet are not equal, that //means a new Taglet has been added. message.notice("doclet.Notice_taglet_registered", classname); if (newLastTag != null) { checkTaglet(newLastTag); } } } catch (Exception exc) { message.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname); } }
Example 14
Source File: TagletManager.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Add a new <code>Taglet</code>. Print a message to indicate whether or not * the Taglet was registered properly. * @param classname the name of the class representing the custom tag. * @param tagletPath the path to the class representing the custom tag. */ public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { try { Class<?> customTagClass = null; // construct class loader String cpString = null; // make sure env.class.path defaults to dot ClassLoader tagClassLoader; if (fileManager != null && fileManager.hasLocation(DocumentationTool.Location.TAGLET_PATH)) { tagClassLoader = fileManager.getClassLoader(DocumentationTool.Location.TAGLET_PATH); } else { // do prepends to get correct ordering cpString = appendPath(System.getProperty("env.class.path"), cpString); cpString = appendPath(System.getProperty("java.class.path"), cpString); cpString = appendPath(tagletPath, cpString); tagClassLoader = new URLClassLoader(pathToURLs(cpString)); } if (exportInternalAPI) { exportInternalAPI(tagClassLoader); } customTagClass = tagClassLoader.loadClass(classname); Method meth = customTagClass.getMethod("register", Map.class); Object[] list = customTags.values().toArray(); Taglet lastTag = (list != null && list.length > 0) ? (Taglet) list[list.length-1] : null; meth.invoke(null, customTags); list = customTags.values().toArray(); Object newLastTag = (list != null&& list.length > 0) ? list[list.length-1] : null; if (lastTag != newLastTag) { //New taglets must always be added to the end of the LinkedHashMap. //If the current and previous last taglet are not equal, that //means a new Taglet has been added. message.notice("doclet.Notice_taglet_registered", classname); if (newLastTag != null) { checkTaglet(newLastTag); } } } catch (Exception exc) { exc.printStackTrace(); message.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname); } }
Example 15
Source File: Utils.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private Location defaultLocation() { JavaFileManager fm = configuration.docEnv.getJavaFileManager(); return fm.hasLocation(StandardLocation.SOURCE_PATH) ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH; }
Example 16
Source File: JavacProcessingEnvironment.java From javaide with GNU General Public License v3.0 | 4 votes |
private void initProcessorIterator(Context context, Iterable<? extends Processor> processors) { Log log = Log.instance(context); Iterator<? extends Processor> processorIterator; if (options.isSet(XPRINT)) { try { Processor processor = PrintingProcessor.class.newInstance(); processorIterator = List.of(processor).iterator(); } catch (Throwable t) { AssertionError assertError = new AssertionError("Problem instantiating PrintingProcessor."); assertError.initCause(t); throw assertError; } } else if (processors != null) { processorIterator = processors.iterator(); } else { String processorNames = options.get(PROCESSOR); JavaFileManager fileManager = context.get(JavaFileManager.class); try { // If processorpath is not explicitly set, use the classpath. processorClassLoader = fileManager.hasLocation(ANNOTATION_PROCESSOR_PATH) ? fileManager.getClassLoader(ANNOTATION_PROCESSOR_PATH) : fileManager.getClassLoader(CLASS_PATH); /* * If the "-processor" option is used, search the appropriate * path for the named class. Otherwise, use a service * provider mechanism to create the processor iterator. */ if (processorNames != null) { processorIterator = new NameProcessIterator(processorNames, processorClassLoader, log); } else { processorIterator = new ServiceIterator(processorClassLoader, log); } } catch (SecurityException e) { /* * A security exception will occur if we can't create a classloader. * Ignore the exception if, with hindsight, we didn't need it anyway * (i.e. no processor was specified either explicitly, or implicitly, * in service configuration file.) Otherwise, we cannot continue. */ processorIterator = handleServiceLoaderUnavailability("proc.cant.create.loader", e); } } discoveredProcs = new DiscoveredProcessors(processorIterator); }
Example 17
Source File: TagletManager.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Add a new <code>Taglet</code>. Print a message to indicate whether or not * the Taglet was registered properly. * @param classname the name of the class representing the custom tag. * @param tagletPath the path to the class representing the custom tag. */ public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { try { Class<?> customTagClass = null; // construct class loader String cpString = null; // make sure env.class.path defaults to dot ClassLoader tagClassLoader; if (fileManager != null && fileManager.hasLocation(DocumentationTool.Location.TAGLET_PATH)) { tagClassLoader = fileManager.getClassLoader(DocumentationTool.Location.TAGLET_PATH); } else { // do prepends to get correct ordering cpString = appendPath(System.getProperty("env.class.path"), cpString); cpString = appendPath(System.getProperty("java.class.path"), cpString); cpString = appendPath(tagletPath, cpString); tagClassLoader = new URLClassLoader(pathToURLs(cpString)); } customTagClass = tagClassLoader.loadClass(classname); Method meth = customTagClass.getMethod("register", new Class<?>[] {java.util.Map.class}); Object[] list = customTags.values().toArray(); Taglet lastTag = (list != null && list.length > 0) ? (Taglet) list[list.length-1] : null; meth.invoke(null, new Object[] {customTags}); list = customTags.values().toArray(); Object newLastTag = (list != null&& list.length > 0) ? list[list.length-1] : null; if (lastTag != newLastTag) { //New taglets must always be added to the end of the LinkedHashMap. //If the current and previous last taglet are not equal, that //means a new Taglet has been added. message.notice("doclet.Notice_taglet_registered", classname); if (newLastTag != null) { checkTaglet(newLastTag); } } } catch (Exception exc) { message.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname); } }
Example 18
Source File: TagletManager.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * Add a new <code>Taglet</code>. Print a message to indicate whether or not * the Taglet was registered properly. * @param classname the name of the class representing the custom tag. * @param tagletPath the path to the class representing the custom tag. */ public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { try { Class<?> customTagClass = null; // construct class loader String cpString = null; // make sure env.class.path defaults to dot ClassLoader tagClassLoader; if (fileManager != null && fileManager.hasLocation(DocumentationTool.Location.TAGLET_PATH)) { tagClassLoader = fileManager.getClassLoader(DocumentationTool.Location.TAGLET_PATH); } else { // do prepends to get correct ordering cpString = appendPath(System.getProperty("env.class.path"), cpString); cpString = appendPath(System.getProperty("java.class.path"), cpString); cpString = appendPath(tagletPath, cpString); tagClassLoader = new URLClassLoader(pathToURLs(cpString)); } customTagClass = tagClassLoader.loadClass(classname); Method meth = customTagClass.getMethod("register", new Class<?>[] {java.util.Map.class}); Object[] list = customTags.values().toArray(); Taglet lastTag = (list != null && list.length > 0) ? (Taglet) list[list.length-1] : null; meth.invoke(null, new Object[] {customTags}); list = customTags.values().toArray(); Object newLastTag = (list != null&& list.length > 0) ? list[list.length-1] : null; if (lastTag != newLastTag) { //New taglets must always be added to the end of the LinkedHashMap. //If the current and previous last taglet are not equal, that //means a new Taglet has been added. message.notice("doclet.Notice_taglet_registered", classname); if (newLastTag != null) { checkTaglet(newLastTag); } } } catch (Exception exc) { message.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname); } }
Example 19
Source File: TagletManager.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Add a new <code>Taglet</code>. Print a message to indicate whether or not * the Taglet was registered properly. * @param classname the name of the class representing the custom tag. * @param tagletPath the path to the class representing the custom tag. */ public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { try { Class<?> customTagClass = null; // construct class loader String cpString = null; // make sure env.class.path defaults to dot ClassLoader tagClassLoader; if (fileManager != null && fileManager.hasLocation(DocumentationTool.Location.TAGLET_PATH)) { tagClassLoader = fileManager.getClassLoader(DocumentationTool.Location.TAGLET_PATH); } else { // do prepends to get correct ordering cpString = appendPath(System.getProperty("env.class.path"), cpString); cpString = appendPath(System.getProperty("java.class.path"), cpString); cpString = appendPath(tagletPath, cpString); tagClassLoader = new URLClassLoader(pathToURLs(cpString)); } customTagClass = tagClassLoader.loadClass(classname); Method meth = customTagClass.getMethod("register", new Class<?>[] {java.util.Map.class}); Object[] list = customTags.values().toArray(); Taglet lastTag = (list != null && list.length > 0) ? (Taglet) list[list.length-1] : null; meth.invoke(null, new Object[] {customTags}); list = customTags.values().toArray(); Object newLastTag = (list != null&& list.length > 0) ? list[list.length-1] : null; if (lastTag != newLastTag) { //New taglets must always be added to the end of the LinkedHashMap. //If the current and previous last taglet are not equal, that //means a new Taglet has been added. message.notice("doclet.Notice_taglet_registered", classname); if (newLastTag != null) { checkTaglet(newLastTag); } } } catch (Exception exc) { message.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname); } }
Example 20
Source File: TagletManager.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Add a new <code>Taglet</code>. Print a message to indicate whether or not * the Taglet was registered properly. * @param classname the name of the class representing the custom tag. * @param tagletPath the path to the class representing the custom tag. */ public void addCustomTag(String classname, JavaFileManager fileManager, String tagletPath) { try { Class<?> customTagClass = null; // construct class loader String cpString = null; // make sure env.class.path defaults to dot ClassLoader tagClassLoader; if (fileManager != null && fileManager.hasLocation(DocumentationTool.Location.TAGLET_PATH)) { tagClassLoader = fileManager.getClassLoader(DocumentationTool.Location.TAGLET_PATH); } else { // do prepends to get correct ordering cpString = appendPath(System.getProperty("env.class.path"), cpString); cpString = appendPath(System.getProperty("java.class.path"), cpString); cpString = appendPath(tagletPath, cpString); tagClassLoader = new URLClassLoader(pathToURLs(cpString)); } customTagClass = tagClassLoader.loadClass(classname); Method meth = customTagClass.getMethod("register", new Class<?>[] {java.util.Map.class}); Object[] list = customTags.values().toArray(); Taglet lastTag = (list != null && list.length > 0) ? (Taglet) list[list.length-1] : null; meth.invoke(null, new Object[] {customTags}); list = customTags.values().toArray(); Object newLastTag = (list != null&& list.length > 0) ? list[list.length-1] : null; if (lastTag != newLastTag) { //New taglets must always be added to the end of the LinkedHashMap. //If the current and previous last taglet are not equal, that //means a new Taglet has been added. message.notice("doclet.Notice_taglet_registered", classname); if (newLastTag != null) { checkTaglet(newLastTag); } } } catch (Exception exc) { message.error("doclet.Error_taglet_not_registered", exc.getClass().getName(), classname); } }