Package com.sun.javadoc

Examples of com.sun.javadoc.ClassDoc


        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

    int nocomment = 0;
    StringBuilder nocomments = new StringBuilder();

    for (int i = 0; i < classes.length; i++) {
      if (!isEntity(classes[i])) continue;
      ClassDoc classDoc = classes[i];

      String className = getEntityName(classDoc);
      // find table comment
      String comments = processComment(classDoc.commentText());
      if (null != comments) {
        enOut.write("\nentity." + className + "=" + StrUtils.unCamel(StringUtils.capitalize(className), ' ',false) + "\n");
        zhOut.write("\nentity." + className + "=" + comments + "\n");
      } else {
        nocomments.append(classDoc.qualifiedName()).append('\n');
        nocomment++;
      }

      // process classDoc and it's superClassDoc
      while (null != classDoc) {
        if (classDoc.simpleTypeName().equals("Object")) break;
        FieldDoc[] fields = classDoc.fields(false);
        for (int j = 0; j < fields.length; j++) {
          FieldDoc field = fields[j];
          if (field.isTransient() || field.isStatic() || field.isEnum()) continue;
          String columnComment = processComment(fields[j].commentText());

          if (null != columnComment) {
            String columnName = StrUtils.unCamel(StringUtils.capitalize(fields[j].name()), ' ', false);
            enOut.write(className + "." + fields[j].name() + "=" + columnName + "\n");
            zhOut.write(className + "." + fields[j].name() + "=" + columnComment + "\n");
          } else {
            if (null != fields[j].position() && fields[j].position().column() > 0) {
              nocomments.append(classDoc.qualifiedName()).append('.').append(fields[j].name())
                  .append('\n');
              nocomment++;
            }
          }
        }
        classDoc = (null == classDoc.superclassType()) ? null : classDoc.superclassType()
            .asClassDoc();
      }
    }

    // summary
View Full Code Here

    int nocomment = 0;
    StringBuilder nocomments = new StringBuilder();

    for (int i = 0; i < classes.length; i++) {
      if (!isEntity(classes[i])) continue;
      ClassDoc classDoc = classes[i];

      // generate table name
      String tableName = getTableName(classDoc);
      if (null == tableName) {
        System.out.println("Cannot find tablenam for " + classDoc.qualifiedName());
        continue;
      }
      // find table comment
      String tableComment = processComment(classDoc.commentText());
      if (null != tableComment) {
        out.write("\ncomment on table " + tableName + " is '" + tableComment + "';\n");
      } else {
        nocomments.append(classDoc.qualifiedName()).append('\n');
        nocomment++;
      }

      // process classDoc and it's superClassDoc
      while (null != classDoc) {
        if (classDoc.simpleTypeName().equals("Object")) break;
        FieldDoc[] fields = classDoc.fields(false);
        for (int j = 0; j < fields.length; j++) {
          FieldDoc field = fields[j];
          if (field.isTransient() || field.isStatic() || field.isEnum()) continue;
          String simpleTypeName = field.type().simpleTypeName();

          String columnComment = processComment(fields[j].commentText());
          if (null != columnComment) {
            if (collectionTypes.contains(simpleTypeName)) {
              String joinTable = collectionTable(classDoc, tableName, field);
              if (null != joinTable) {
                out.write("\ncomment on table " + joinTable + " is '" + tableComment + "-"
                    + columnComment + "';\n");
              }
            } else {
              String columnName = getColumnName(fields[j]);
              if (isEntity(field)) {
                columnName = columnName + "_id";
                columnComment = columnComment + "ID";
              }
              out.write("comment on column " + tableName + "." + columnName + " is '"
                  + columnComment + "';\n");
            }
          } else {
            if (null != fields[j].position() && fields[j].position().column() > 0) {
              nocomments.append(classDoc.qualifiedName()).append('.').append(fields[j].name())
                  .append('\n');
              nocomment++;
            }
          }
        }
        classDoc = (null == classDoc.superclassType()) ? null : classDoc.superclassType()
            .asClassDoc();
      }
    }

    // summary
View Full Code Here

      getLogger().verbose("trying to build '"+packageName+"' '"+className+"'");
    }
    String loadme = (packageName.trim().length() > 0) ?
      (packageName + '.'  + className) :
      className;
    ClassDoc cd = mRootDoc.classNamed(loadme);
    if (cd == null) {
      if (getLogger().isVerbose(this)) {
        getLogger().verbose("no ClassDoc for "+loadme);
      }
      return null;
    }
    List importSpecs = null;
    {
      ClassDoc[] imported = cd.importedClasses();
      if (imported != null) {
        importSpecs = new ArrayList();
        for(int i=0; i<imported.length; i++) {
          importSpecs.add(getFdFor(imported[i]));
        }
      }
    }
    {
      PackageDoc[] imported = cd.importedPackages();
      if (imported != null) {
        if (importSpecs == null) importSpecs = new ArrayList();
        for(int i=0; i<imported.length; i++) {
          importSpecs.add(imported[i].name()+".*");
        }
View Full Code Here

  // JamClassPopulator implementation

  public void populate(MClass dest) {
    if (dest == null) throw new IllegalArgumentException("null dest");
    assertInitialized();
    ClassDoc src = (ClassDoc)dest.getArtifact();
    if (src == null) throw new IllegalStateException("null artifact");
    dest.setModifiers(src.modifierSpecifier());
    dest.setIsInterface(src.isInterface());
    if (mTigerDelegate != null) dest.setIsEnumType(mTigerDelegate.isEnum(src));
    // set the superclass
    ClassDoc s = src.superclass();
    if (s != null) dest.setSuperclass(getFdFor(s));
    // set the interfaces
    ClassDoc[] ints = src.interfaces();
    for(int i=0; i<ints.length; i++) {
      dest.addInterface(getFdFor(ints[i]));
View Full Code Here

   */
  public static String getFdFor(Type t) {
    if (t == null) throw new IllegalArgumentException("null type");
    String dim = t.dimension();
    if (dim == null || dim.length() == 0) {
      ClassDoc cd = t.asClassDoc();
      if (cd != null) {
        ClassDoc outer = cd.containingClass();
        if (outer == null) return cd.qualifiedName();
        String simpleName = cd.name();
        simpleName = simpleName.substring(simpleName.lastIndexOf('.')+1);
        return outer.qualifiedName()+'$'+simpleName;
      } else {
        return t.qualifiedTypeName();
      }
    } else {
      StringWriter out = new StringWriter();
View Full Code Here

            return null;
        }

        /* Get referenced example bean
         */
        final ClassDoc containingClass = referencedMember.containingClass();
        final Object object;
        try {
            Field declaredField = Class.forName(containingClass.qualifiedName(), false, Thread.currentThread()
                    .getContextClassLoader()).getDeclaredField(referencedMember.name());
            if (referencedMember.isFinal()) {
                declaredField.setAccessible(true);
            }
            object = declaredField.get(null);
View Full Code Here

        Arrays.sort(classDocs, new ClassDocByCheckNameComparator());

        for (int i = 0; i < classDocs.length; i++) {

            final ClassDoc classDoc = classDocs[i];

            // TODO: introduce a "CheckstyleModule" interface
            // so we can do better in the next line...
            if (classDoc.typeName().endsWith("Check")
                    && !classDoc.isAbstract())
            {
                String pageName = getPageName(classDoc);

                // allow checks to override pageName when
                // java package hierarchy is not reflected in doc structure
                final Tag[] docPageTags = classDoc.tags("checkstyle-docpage");
                if ((docPageTags != null) && (docPageTags.length > 0)) {
                    pageName = docPageTags[0].text();
                }

                final String descr = getDescription(classDoc);
View Full Code Here

    private static class ClassDocByCheckNameComparator implements Comparator
    {
        /** {@inheritDoc} */
        public int compare(Object aObject1, Object aObject2)
        {
            final ClassDoc classDoc1 = (ClassDoc) aObject1;
            final ClassDoc classDoc2 = (ClassDoc) aObject2;
            final String checkName1 = getCheckName(classDoc1);
            final String checkName2 = getCheckName(classDoc2);
            return checkName1.compareTo(checkName2);
        }
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.