Package com.sun.javadoc

Examples of com.sun.javadoc.ClassDoc


      while (true) {
         Field f = null;
         try {
            f = c.getDeclaredField(fieldName);
         } catch (NoSuchFieldException e) {
            ClassDoc classDoc = rootDoc.classNamed(c.getName());
            for (FieldDoc fd : classDoc.fields()) {
               for (Tag t : fd.tags(CONFIG_REF)) {
                  Map<String, String> m = parseTag(t.text().trim());
                  String field = m.get("name");
                  if (field != null && field.startsWith(fieldName)) {
                     fieldName = fd.name();
View Full Code Here


      }
   }

   private FieldDoc findFieldDocRecursively(Class<?> c, String fieldName, String tagName) {
      while (true) {
         ClassDoc classDoc = rootDoc.classNamed(c.getName());
         for (FieldDoc fd : classDoc.fields()) {
            if (fd.name().equalsIgnoreCase(fieldName)) {
               return fd;
            }
            for (Tag t : fd.tags(tagName)) {
               Map<String, String> m = parseTag(t.text().trim());
View Full Code Here

         return null;
      }
   }

   private FieldDoc fieldDocWithTag(Class<?> c, String tagName) {
      ClassDoc classDoc = rootDoc.classNamed(c.getName());
      for (FieldDoc fd : classDoc.fields()) {
         if (fd.tags(tagName).length > 0)
            return fd;

      }
      if (c.getSuperclass() != null)
View Full Code Here

        if (result == null)
        {
            // System.err.printf("*** Search for CD %s ...\n", className);

            ClassDoc cd = firstSeen.findClass(className);

            // System.err.printf("CD %s ... %s\n", className, cd == null ? "NOT found" : "found");

            result = cd == null ? new ClassDescription() : new ClassDescription(cd, this);

View Full Code Here

        try
        {
            StringWriter writer = new StringWriter(5000);

            ClassDoc classDoc = (ClassDoc) tag.holder();

            if (firstSeen == null)
                firstSeen = classDoc;

            ClassDescription cd = getDescription(classDoc.qualifiedName());

            writeClassDescription(cd, writer);

            streamXdoc(classDoc, writer);
View Full Code Here

      String typeInfo = "";

      if (isRelevantType(type)) {

         ClassDoc typeDoc = type.asClassDoc();
         typeInfo = processedTypes.get(type.toString());
         if (typeInfo != null) {
            LOG.debug("Found cached typedoc for " + type.typeName() + " - "
               + typeInfo);
         }
         if (typeInfo == null && typeDoc != null) {

            typeInfo = "";

            // if this is a generic type then recurse with the first type argument
            if (isParameterisedType(type)) {

               LOG.debug("Parameterised type");
               if (type.asClassDoc() != null) {
                  typeInfo =
                     getTypeDoc(
                        type.asParameterizedType().typeArguments()[type
                                                                   .asParameterizedType().typeArguments().length - 1],
                                                                   processedTypes, true);
               }

            } else {

               logType(type);

               // put placeholder to stop recursion for self-referential types
               LOG.debug("Starting to cache: " + type.typeName());
               processedTypes.put(type.toString(), "");

               LOG.debug(typeDoc.commentText() + "  " + leafType);
               if (leafType && !typeDoc.commentText().isEmpty()) {
                  typeInfo +=
                     "<tr><span class=\"javadoc-header\">"
                        + typeDoc.commentText() + "</span></tr>";
                  LOG.debug(typeInfo);
               }

               if (typeDoc.isEnum()) {

                  LOG.debug("Enum type");
                  typeInfo += getEnumDoc(type);

               } else { // class

                  LOG.debug("Class");
                  // first do base class
                  if (typeDoc.superclass() != null) {

                     LOG.debug("base type = "
                        + typeDoc.superclass().qualifiedName());

                     String baseTypeDoc =
                        getTypeDoc(type.asClassDoc().superclassType(),
                           processedTypes, false);
                     if (!baseTypeDoc.isEmpty()) {
                        LOG.debug("base type DOC = " + baseTypeDoc);
                        typeInfo += baseTypeDoc;
                     }
                  }

                  typeInfo += getPublicConstantDoc(type);

                  Collection<String> getterNames = getGetterNames(type);

                  for (MethodDoc method : typeDoc.methods()) {

                     if (method.isPublic()
                        && getterNames.contains(method.name())
                        && !ignore(method)) {
View Full Code Here

   public static MethodDoc findMethodDocumentation(final MethodDoc methodDoc) {

      // Look in parent class for javadoc
      if (methodDoc.commentText().contains("@inheritDoc")) {

         ClassDoc containingClass = methodDoc.containingClass();
         ClassDoc superClass = containingClass.superclass().asClassDoc();
         for (MethodDoc md : superClass.methods()) {
            if (md.name().equalsIgnoreCase(methodDoc.name())
               && md.signature().equalsIgnoreCase(methodDoc.signature())) {

               return md;
            }
View Full Code Here

            Method parsedMethod = methodParser.parse();
            if (parsedMethod == null) {
                continue;
            }
            if (parsedMethod.isSubResource()) {
                ClassDoc subResourceClassDoc = lookUpClassDoc(method.returnType());
                if (subResourceClassDoc != null) {
                    // delete class from the dictionary to handle recursive sub-resources
                    Collection<ClassDoc> shrunkClasses = new ArrayList<ClassDoc>(classes);
                    shrunkClasses.remove(classDoc);
                    // recursively parse the sub-resource class
View Full Code Here

  @Override
   public boolean evaluate(DocSpecification docSpecification)
   {
    try
    {
     ClassDoc classDoc = docSpecification.getClassDoc();
     MethodDoc methodDoc = docSpecification.getMethodDoc();
     JCClassDecl classImplementation = docSpecification.getClassImplementation();
     JavaFileParser parser = docSpecification.getParser();
    
     String methodName = methodDoc.name();
     Parameter[] parameters = methodDoc.parameters();
     String[] parameterClassnames = new String[parameters.length];
     for (int i = 0;i< parameters.length; i++)
       parameterClassnames[i] = parameters[i].typeName();
    
     //handle only methods that are defined in the source code and not generated by the compiler.
     if ( !(
           methodDoc.isAbstract() ||
           methodDoc.isSynthetic() ||
           (classDoc.isEnum() && "values".equals(methodName) ) ||
           (classDoc.enumConstants() != null && (classDoc.enumConstants().length > 0) && "values".equals(methodName) )
         ))
     {
       /*
        System.out.println("class modifiers "+ classDoc.modifiers());
        System.out.println("class "+ classDoc.name()+" is enum:"  + classDoc.isEnum());
View Full Code Here

   *            the method to inspect
   */
  private void parameterRun(ExecutableMemberDoc methodDoc) throws Exception{
    if (runNumber == METHOD_PARAMETER_RUN
        && !DocBoostUtils.isOverride(methodDoc)) {
        ClassDoc fullClassDoc = DocBoostUtils.getFullClassDoc(methodDoc.containingClass())
     
          for (Parameter parameter: DocBoostUtils.parametersWithoutComment(methodDoc)){
        getLog().debug(
            "trying to fix " + methodDoc.containingClass().name()
                + "." + methodDoc.name() + " " + parameter);
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.