Package com.sun.javadoc

Examples of com.sun.javadoc.ClassDoc


        }
        return false;
    }

    private boolean skipMethod(ExecutableMemberDoc method) {
        ClassDoc clazz = method.containingClass();
        boolean isAbstract = method instanceof MethodDoc && ((MethodDoc) method).isAbstract();
        boolean isInterface = clazz.isInterface() || (clazz.isAbstract() && isAbstract);
        if (INTERFACES_ONLY && !isInterface) {
            return true;
        }
        String name = method.name();
        if (method.isPrivate() || name.equals("finalize")) {
            return true;
        }
        if (method.isConstructor() && method.getRawCommentText().trim().length() == 0) {
            return true;
        }
        if (method.getRawCommentText().trim().startsWith("@deprecated INTERNAL")) {
            return true;
        }
        String firstSentence = getFirstSentence(method.firstSentenceTags());
        String raw = method.getRawCommentText();
        if (firstSentence != null && firstSentence.startsWith("INTERNAL")) {
            return true;
        }
        if ((firstSentence == null || firstSentence.trim().length() == 0) && raw.indexOf("{@inheritDoc}") < 0) {
            if (!doesOverride(method)) {
                boolean setterOrGetter = name.startsWith("set") && method.parameters().length == 1;
                setterOrGetter |= name.startsWith("get") && method.parameters().length == 0;
                Type returnType = getReturnType(method);
                setterOrGetter |= name.startsWith("is") &&
                        method.parameters().length == 0 &&
                        returnType != null &&
                        returnType.toString().equals("boolean");
                if (!setterOrGetter) {
                    addError("Undocumented method " +
                            " (" + clazz.name() + ".java:" + method.position().line() +") " +
                            clazz + "." + name + " " + raw);
                    return true;
                }
            }
        }
View Full Code Here


    private boolean doesOverride(ExecutableMemberDoc method) {
        if (method.isConstructor()) {
            return true;
        }
        ClassDoc clazz = method.containingClass();
        int parameterCount = method.parameters().length;
        return foundMethod(clazz, false, method.name(), parameterCount);
    }
View Full Code Here

    }
    return export;
  }

  private boolean isExportedClosure(MethodDoc md) {
    ClassDoc clz = md.containingClass();
    for (AnnotationDesc a : clz.annotations()) {

      String aname = a.annotationType().name();
      if (aname.equals("ExportClosure")) {
        return true;
      }
View Full Code Here

        }
    }

    private void addRelatedClasses(ClassDoc type) {
        // Generalization
        ClassDoc superType = type.superclass();
        if (superType != null &&
            !superType.qualifiedName().equals("java.lang.Object") &&
            !superType.qualifiedName().equals("java.lang.Annotation") &&
            !superType.qualifiedName().equals("java.lang.Enum")) {
            addNode(superType, false);
            addEdge(new Edge(GENERALIZATION, type, superType));
        }

        // Realization
View Full Code Here

            for (Edge edge: directEdges) {
                if (!useSee && edge.getType() == SEE_ALSO) {
                    continue;
                }

                ClassDoc source = (ClassDoc) edge.getSource();
                ClassDoc target = (ClassDoc) edge.getTarget();

                boolean excluded = false;
                if (forceInherit || cls.tags(TAG_INHERIT).length > 0) {
                    for (Tag t: pkg.tags(TAG_EXCLUDE)) {
                        if (t.text() == null || t.text().trim().length() == 0) {
                            continue;
                        }

                        Pattern p = Pattern.compile(t.text().trim());

                        if (p.matcher(source.qualifiedName()).find()) {
                            excluded = true;
                            break;
                        }
                        if (p.matcher(target.qualifiedName()).find()) {
                            excluded = true;
                            break;
                        }
                    }
                    if (excluded) {
                        continue;
                    }
                }

                for (Tag t: cls.tags(TAG_EXCLUDE)) {
                    if (t.text() == null || t.text().trim().length() == 0) {
                        continue;
                    }

                    Pattern p = Pattern.compile(t.text().trim());

                    if (p.matcher(source.qualifiedName()).find()) {
                        excluded = true;
                        break;
                    }
                    if (p.matcher(target.qualifiedName()).find()) {
                        excluded = true;
                        break;
                    }
                }
                if (excluded) {
                    continue;
                }

                if (!useHidden || !isHidden(source) && !isHidden(target)) {
                    edgesToRender.add(edge);
                }
                if (!useHidden || !isHidden(source)) {
                    nodesToRender.put(source.qualifiedName(), source);
                }
                if (!useHidden || !isHidden(target)) {
                    nodesToRender.put(target.qualifiedName(), target);
                }
            }

            Set<Edge> reversedDirectEdges = reversedEdges.get(cls);
            if (reversedDirectEdges != null) {
                for (Edge edge: reversedDirectEdges) {
                    if (!useSee && edge.getType() == SEE_ALSO) {
                        continue;
                    }

                    if (cls.tags(TAG_EXCLUDE_SUBTYPES).length > 0 &&
                            (edge.getType() == EdgeType.GENERALIZATION ||
                             edge.getType() == EdgeType.REALIZATION)) {
                        continue;
                    }

                    ClassDoc source = (ClassDoc) edge.getSource();
                    ClassDoc target = (ClassDoc) edge.getTarget();

                    boolean excluded = false;
                    if (forceInherit || cls.tags(TAG_INHERIT).length > 0) {
                        for (Tag t: pkg.tags(TAG_EXCLUDE)) {
                            if (t.text() == null || t.text().trim().length() == 0) {
                                continue;
                            }

                            Pattern p = Pattern.compile(t.text().trim());

                            if (p.matcher(source.qualifiedName()).find()) {
                                excluded = true;
                                break;
                            }
                            if (p.matcher(target.qualifiedName()).find()) {
                                excluded = true;
                                break;
                            }
                        }
                        if (excluded) {
                            continue;
                        }
                    }

                    for (Tag t: cls.tags(TAG_EXCLUDE)) {
                        if (t.text() == null || t.text().trim().length() == 0) {
                            continue;
                        }

                        Pattern p = Pattern.compile(t.text().trim());

                        if (p.matcher(source.qualifiedName()).find()) {
                            excluded = true;
                            break;
                        }
                        if (p.matcher(target.qualifiedName()).find()) {
                            excluded = true;
                            break;
                        }
                    }
                    if (excluded) {
                        continue;
                    }

                    if (!useHidden || !isHidden(source) && !isHidden(target)) {
                        edgesToRender.add(edge);
                    }
                    if (!useHidden || !isHidden(source)) {
                        nodesToRender.put(source.qualifiedName(), source);
                    }
                    if (!useHidden || !isHidden(target)) {
                        nodesToRender.put(target.qualifiedName(), target);
                    }
                }
            }
        }
    }
View Full Code Here

  }

  private void emitJRELink(ClassDoc enclosing, Doc doc) {
    String jreLink = "http://java.sun.com/j2se/1.5.0/docs/api/";
    if (doc instanceof ClassDoc) {
      ClassDoc classDoc = (ClassDoc) doc;
      String pkg = classDoc.containingPackage().name();
      if (!pkg.startsWith("java.")) {
        return;
      }
      String clazz = classDoc.name();

      jreLink += pkg.replace('.', '/') + "/";
      jreLink += clazz;
      jreLink += ".html";
    } else if (doc instanceof ExecutableMemberDoc) {
View Full Code Here

    if (doc instanceof MemberDoc) {
      MemberDoc memberDoc = (MemberDoc) doc;
      myId = getId(memberDoc);
      myTitle = memberDoc.name();
    } else if (doc instanceof ClassDoc) {
      ClassDoc classDoc = (ClassDoc) doc;
      myId = getId(classDoc);
      myTitle = classDoc.name();
    } else if (doc instanceof PackageDoc) {
      PackageDoc pkgDoc = (PackageDoc) doc;
      myId = getId(pkgDoc);
      myTitle = pkgDoc.name();
    } else if (doc instanceof RootDoc) {
View Full Code Here

    processTags(tags);
    endln();
  }

  private void emitType(Type type) {
    ClassDoc typeAsClass = type.asClassDoc();

    if (typeAsClass != null) {
      begin("type", "ref", getId(typeAsClass));
    } else {
      begin("type");
View Full Code Here

      MethodDoc methodDoc) {
    if (interfaces != null) {
      // Look through the methods on superInterface for a matching methodDoc.
      //
      for (int intfIndex = 0; intfIndex < interfaces.length; ++intfIndex) {
        ClassDoc currentIntfDoc = interfaces[intfIndex];
        MethodDoc[] intfMethodDocs = currentIntfDoc.methods();
        for (int methodIndex = 0; methodIndex < intfMethodDocs.length; ++methodIndex) {
          MethodDoc intfMethodDoc = intfMethodDocs[methodIndex];
          String methodDocName = methodDoc.name();
          String intfMethodDocName = intfMethodDoc.name();
          if (methodDocName.equals(intfMethodDocName)) {
            if (methodDoc.signature().equals(intfMethodDoc.signature())) {
              // It's a match!
              //
              return intfMethodDoc;
            }
          }
        }

        // Try the superinterfaces of this interface.
        //
        MethodDoc foundMethodDoc = findMatchingInterfaceMethodDoc(
            currentIntfDoc.interfaces(), methodDoc);
        if (foundMethodDoc != null) {
          return foundMethodDoc;
        }
      }
    }
View Full Code Here

  private Doc getParentDoc(Doc doc) {
    if (doc instanceof MemberDoc) {
      MemberDoc memberDoc = (MemberDoc) doc;
      return memberDoc.containingClass();
    } else if (doc instanceof ClassDoc) {
      ClassDoc classDoc = (ClassDoc) doc;
      Doc enclosingClass = classDoc.containingClass();
      if (enclosingClass != null) {
        return enclosingClass;
      } else {
        return classDoc.containingPackage();
      }
    } else if (doc instanceof PackageDoc) {
      return initialRootDoc;
    } else if (doc instanceof RootDoc) {
      return null;
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.