String getFileCommentContent(Element e) {
    if (e == null || result.config.limitComments) return null;

    String f = Element.getFileOfAscendency(e);
    if (f == null && e != null && e.getElementLine() >= 0)
      return "<i>native declaration : line " + e.getElementLine() + "</i>";

    return f == null ? null : getFileCommentContent(new File(f), e);
  }
예제 #2
0
  public Element importDetails(Element from, boolean move) {
    if (from == null) return this;

    if (!from.getNameSpace().isEmpty()) setNameSpace(from.getNameSpace());

    if (from.getElementFile() != null) setElementFile(from.getElementFile());
    if (from.getElementLine() >= 0) setElementLine(from.getElementLine());
    if (from.getCommentBefore() != null) addToCommentBefore(from.getCommentBefore());
    if (from.getCommentAfter() != null) setCommentAfter(from.getCommentAfter());

    if (move) from.stripDetails();
    return this;
  }
 String getFileCommentContent(File file, Element e) {
   if (file != null) {
     String path = result.config.relativizeFileForSourceComments(file.getAbsolutePath());
     String inCategoryStr = "";
     if (e instanceof Function) {
       Function fc = (Function) e;
       Struct parent;
       if (fc.getType() == Type.ObjCMethod
           && ((parent = as(fc.getParentElement(), Struct.class)) != null)
           && (parent.getCategoryName() != null)) {
         inCategoryStr = "from " + parent.getCategoryName() + " ";
       }
     }
     return "<i>"
         + inCategoryStr
         + "native declaration : "
         + path
         + (e == null || e.getElementLine() < 0 ? "" : ":" + e.getElementLine())
         + "</i>";
   } else if (e != null && e.getElementLine() >= 0) {
     return "<i>native declaration : <input>:" + e.getElementLine() + "</i>";
   }
   return null;
 }