return ""; File f = tag.position().file();
String type = classDoc.qualifiedTypeName(); String comment = filter.filterAndTruncate(classDoc.commentText()); String pathToSourceFile = classDoc.position().file().getCanonicalPath();
private IAlgorithm getAlgorithmAssociatedToTag (Tag tag) { File javaFileObject = tag.holder ().position ().file(); String theClassName = ""; while (!javaFileObject.getName ().equals("net2plan")) { theClassName = javaFileObject.getName () + "." + theClassName; if (javaFileObject.getParentFile() == null) break; else javaFileObject = javaFileObject.getParentFile(); } theClassName = "com.net2plan." + theClassName; theClassName = theClassName.substring(0 , theClassName.length ()-6); //without .java IAlgorithm alg = null; try { Class algorithmClass = Taglet_Description.class.getClassLoader().loadClass(theClassName); if (!IAlgorithm.class.isAssignableFrom(algorithmClass)) return null; // not an algorithm alg = (IAlgorithm) algorithmClass.getConstructor().newInstance(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException ("Unexpected exception trying to load class of '" + theClassName + "'"); } return alg; }
private Object getAlgorithmAssociatedToTag (Tag tag) { File javaFileObject = tag.holder ().position ().file(); String theClassName = ""; while (!javaFileObject.getName ().equals("net2plan")) { theClassName = javaFileObject.getName () + "." + theClassName; if (javaFileObject.getParentFile() == null) break; else javaFileObject = javaFileObject.getParentFile(); } theClassName = "com.net2plan." + theClassName; theClassName = theClassName.substring(0 , theClassName.length ()-6); //without .java Object alg = null; try { Class algorithmClass = Taglet_Description.class.getClassLoader().loadClass(theClassName); if (IAlgorithm.class.isAssignableFrom(algorithmClass)) return (IAlgorithm) algorithmClass.getConstructor().newInstance(); if (IReport.class.isAssignableFrom(algorithmClass)) return (IReport)algorithmClass.getConstructor().newInstance(); if (IEventGenerator.class.isAssignableFrom(algorithmClass)) return (IEventGenerator)algorithmClass.getConstructor().newInstance(); if (IEventProcessor.class.isAssignableFrom(algorithmClass)) return (IEventProcessor)algorithmClass.getConstructor().newInstance(); return null; } catch (Exception e) { e.printStackTrace(); throw new RuntimeException ("Unexpected exception trying to load class of '" + theClassName + "'"); } }
@Override public String toString(Tag tag) { File f = tag.position().file(); String label = tag.text(); if (label == null || label.isEmpty()) label = "Source"; // Locate root directory as the one containing RELEASE-NOTES.txt if (JUNEAU_ROOT == null) { File f2 = f; while (true) { f2 = f2.getParentFile(); if (f2 == null) break; File f3 = new File(f2, "RELEASE-NOTES.txt"); if (f3.exists()) { JUNEAU_ROOT = f2.getAbsolutePath(); break; } } } if (JUNEAU_ROOT == null) return label; String path = f.getAbsolutePath(); String href = GITHUB_LINK + path.substring(JUNEAU_ROOT.length()); return "<a class='doclink' href='" + href + "'>" + label + "</a>"; }
private boolean isUpToDate() { if (outFile == null) return false; final long outFileMillis = outFile.lastModified(); if (outFileMillis == 0L) { return false; } for (final Doc doc: allDocs) { final File docFile = doc.position() == null ? null : doc.position().file(); if (docFile != null && docFile.lastModified() > outFileMillis) { rootDoc.printNotice("At least one item is out of date: " + docFile.getAbsolutePath()); return false; } } return true; }
private void streamXdoc(ClassDoc classDoc, Writer writer) throws Exception { File sourceFile = classDoc.position().file(); // The .xdoc file will be adjacent to the sourceFile String sourceName = sourceFile.getName(); String xdocName = sourceName.replaceAll("\\.java$", ".xdoc"); File xdocFile = new File(sourceFile.getParentFile(), xdocName); if (xdocFile.exists()) { try { // Close the definition list, to avoid unwanted indents. Very, very ugly. new XDocStreamer(xdocFile, writer).writeContent(); // Open a new (empty) definition list, that HtmlDoclet will close. } catch (Exception ex) { System.err.println("Error streaming XDOC content for " + classDoc); throw ex; } } } }
private void streamXdoc(ClassDoc classDoc, Writer writer) throws Exception { File sourceFile = classDoc.position().file(); // The .xdoc file will be adjacent to the sourceFile String sourceName = sourceFile.getName(); String xdocName = sourceName.replaceAll("\\.java$", ".xdoc"); File xdocFile = new File(sourceFile.getParentFile(), xdocName); if (xdocFile.exists()) { try { // Close the definition list, to avoid unwanted indents. Very, very ugly. new XDocStreamer(xdocFile, writer).writeContent(); // Open a new (empty) definition list, that HtmlDoclet will close. } catch (Exception ex) { System.err.println("Error streaming XDOC content for " + classDoc); throw ex; } } } }
: s.substring(0, rparen + 1); File file = new File(holder.position().file().getAbsoluteFile().toURI().normalize());
@Override public String toString(Tag tag) { File f = tag.position().file(); String key = tag.text(); String href = null;
File file = sp.file(); if (file == null) return;
r = fo.openReader(true); } else { File file = sp.file(); if (file == null) return;