Package com.sun.javadoc

Examples of com.sun.javadoc.ClassDoc


          packageName.append(doc.containingPackage().name()).append(".");
        }

        classname = packageName + classname;
       
        ClassDoc classDoc = DocBoostUtils.findClassDoc(root, classname);
       
        String see = classDoc.qualifiedName();
       
        ProgramElementDoc classOrMethod = classDoc;
        if (methodname != null){
          List<MethodDoc> methodDocs = DocBoostUtils.findMethodDocs(
              classDoc, methodname);
          if (methodDocs == null || methodDocs.isEmpty()) {
            throw new IllegalStateException(
                "Did not find method doc of "
                    + classDoc.qualifiedName()
+ "."
                    + methodname + " It is needed by "
                    + doc.name());
          }
          classOrMethod = methodDocs.get(0);
View Full Code Here


          StringBuilder builder = new StringBuilder();
          for (String part: extraction)
            builder.append(part).append("\n");
          extract = builder.toString();
        }
        ClassDoc clasz = null;
        String simpleClassname = null;
//        String classname = null;
        String method = null;
        String id = null;
        String nature = null;
       
        for (ElementValuePair pair: annotation.elementValues()){
          //getLog().info(pair.element().name() + ": " + pair.value().value());
          if ("clasz".equals(pair.element().name())){
            //classname = pair.value().value().toString();
            clasz = (ClassDoc) pair.value().value();
            simpleClassname = clasz.name();
          }
          if ("method".equals(pair.element().name()))
            method = pair.value().value().toString();

          if ("id".equals(pair.element().name()))
View Full Code Here

    escapeHtml(methodDoc);
  }
 
  private void parameterRun(ExecutableMemberDoc methodDoc) throws Exception{
    if (runNumber == METHOD_PARAMETER_RUN && ! isOverride(methodDoc)){
        ClassDoc fullClassDoc = DocUtils.getFullClassDoc(methodDoc.containingClass())
     
          for (Parameter parameter: DocUtils.parametersWithoutComment(methodDoc)){
            getLog().info("trying to fix " + methodDoc.containingClass().name() +"."+ methodDoc.name() + " " + parameter);
           
            //first try to find corresponding fields which text can be copied.
View Full Code Here

          packageName.append(doc.containingPackage().name()).append(".");
        }

        classname = packageName + classname;
       
        ClassDoc classDoc = DocUtils.findClassDoc(root, classname);
       
        String see = classDoc.qualifiedName();
       
        ProgramElementDoc classOrMethod = classDoc;
        if (methodname != null){
          classOrMethod = DocUtils.findMethodDocs(classDoc, methodname).get(0);
          see = see + "." + methodname;
View Full Code Here

          StringBuilder builder = new StringBuilder();
          for (String part: extraction)
            builder.append(part).append("\n");
          extract = builder.toString();
        }
        ClassDoc clasz = null;
        String simpleClassname = null;
//        String classname = null;
        String method = null;
       
        for (ElementValuePair pair: annotation.elementValues()){
          //getLog().info(pair.element().name() + ": " + pair.value().value());
          if ("clasz".equals(pair.element().name())){
            //classname = pair.value().value().toString();
            clasz = (ClassDoc) pair.value().value();
            simpleClassname = clasz.name();
          }
          if ("method".equals(pair.element().name()))
            method = pair.value().value().toString();

        }
View Full Code Here

   */
  public String getSourcecode(MethodDoc method) throws Exception{
    //TODO improvement: There is a tree field in the doc with the code in it. May be that can be used.
    //Be aware that when no constructor is declared a default constructor is created including source code 
    SourcePosition start = method.position();
    ClassDoc classDoc = method.containingClass();
   
    int startline = start.line();
    int endline = -1;
    boolean foundMethod = false;
    for (MethodDoc methoddoc: classDoc.methods()){
      if (foundMethod){
        endline = methoddoc.position().line();
        break;
      }
     
View Full Code Here

    Check.notNull(doc, "doc");
    File sourcefile = new ClassDocDelegate(doc).getSourcefile();
    Check.isTrue(sourcefile.exists(), "The file does not exist ", sourcefile);
    RootDoc fullRootDoc = DocUtils.createJavadocOfFile(sourcefile);
    Check.notNull(fullRootDoc, "fullRootDoc", "should be created from file " + sourcefile);
    ClassDoc fullClassDoc = fullRootDoc.classNamed(doc.qualifiedName());
    return fullClassDoc;
  }
View Full Code Here

    if (createRelativeLinksToJavadoc) {
      String linkWithDots = null;
      if (doc instanceof PackageDoc) {
        linkWithDots = result + ".package-frame";
      } else if (doc instanceof ClassDoc) {
        ClassDoc classDoc = (ClassDoc) doc;
        while (classDoc.containingClass() != null)
          classDoc = classDoc.containingClass();

        linkWithDots = classDoc.qualifiedName();
      }

      if (linkWithDots != null) {
        linkWithDots = linkWithDots.replace('.', '/');
View Full Code Here

    //Be aware that when no constructor is declared a default constructor is created including source code 
    SourcePosition start = method.position();
    // Be aware that the position of the method does not include comments
    // and Annotations.

    ClassDoc classDoc = method.containingClass();
   
    int startline = start.line();
    int endline = -1;
    boolean foundMethod = false;
    for (MethodDoc methoddoc: classDoc.methods()){
      if (foundMethod){
        endline = methoddoc.position().line();
        break;
      }
     
View Full Code Here

  public static String getIdentifier(Doc doc) {
    String id = null;
    if (doc instanceof PackageDoc) {
      id = ((PackageDoc) doc).name();
    } else if (doc instanceof ClassDoc) {
      ClassDoc cdoc = (ClassDoc) doc;
      id = getIdentifier(cdoc.containingPackage()) + "." + cdoc.name();
    } else if (doc instanceof ConstructorDoc) {
      ConstructorDoc cdoc = (ConstructorDoc) doc;
      id = getIdentifier(cdoc.containingClass()) + "." + cdoc.name();
    } else if (doc instanceof MethodDoc) {
      MethodDoc cdoc = (MethodDoc) doc;
      id = getIdentifier(cdoc.containingClass()) + "." + cdoc.name();
    } else if (doc instanceof FieldDoc) {
      FieldDoc cdoc = (FieldDoc) doc;
      id = getIdentifier(cdoc.containingClass()) + "." + cdoc.name();
    } else {
      id = "hash " + doc.hashCode();
    }
 
    return id;
View Full Code Here

TOP

Related Classes of com.sun.javadoc.ClassDoc

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.