Example #1
0
 /**
  * Given a PackageDoc, return the source path for that package.
  *
  * @param configuration The Configuration for the current Doclet.
  * @param pkgDoc The package to seach the path for.
  * @return A string representing the path to the given package.
  */
 public static String getPackageSourcePath(Configuration configuration, PackageDoc pkgDoc) {
   try {
     String pkgPath = DirectoryManager.getDirectoryPath(pkgDoc);
     String completePath =
         new SourcePath(configuration.sourcepath).getDirectory(pkgPath)
             + DirectoryManager.URL_FILE_SEPERATOR;
     // Make sure that both paths are using the same seperators.
     completePath =
         Util.replaceText(completePath, File.separator, DirectoryManager.URL_FILE_SEPERATOR);
     pkgPath = Util.replaceText(pkgPath, File.separator, DirectoryManager.URL_FILE_SEPERATOR);
     return completePath.substring(0, completePath.indexOf(pkgPath));
   } catch (Exception e) {
     return "";
   }
 }
Example #2
0
 /**
  * Given a string, escape all special html characters and return the result.
  *
  * @param s The string to check.
  * @return the original string with all of the HTML characters escaped.
  * @see #HTML_ESCAPE_CHARS
  */
 public static String escapeHtmlChars(String s) {
   String result = s;
   for (int i = 0; i < HTML_ESCAPE_CHARS.length; i++) {
     result = Util.replaceText(result, HTML_ESCAPE_CHARS[i][0], HTML_ESCAPE_CHARS[i][1]);
   }
   return result;
 }
 /**
  * Build the signature of the current annotation type.
  *
  * @param node the XML element that specifies which components to document
  * @param annotationInfoTree the content tree to which the documentation will be added
  */
 public void buildAnnotationTypeSignature(XMLNode node, Content annotationInfoTree) {
   StringBuffer modifiers = new StringBuffer(annotationTypeDoc.modifiers() + " ");
   writer.addAnnotationTypeSignature(
       Util.replaceText(modifiers.toString(), "interface", "@interface"), annotationInfoTree);
 }