当前位置: 首页>>代码示例>>Java>>正文


Java PackageDoc类代码示例

本文整理汇总了Java中com.sun.javadoc.PackageDoc的典型用法代码示例。如果您正苦于以下问题:Java PackageDoc类的具体用法?Java PackageDoc怎么用?Java PackageDoc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PackageDoc类属于com.sun.javadoc包,在下文中一共展示了PackageDoc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderPackage

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 * Renders a package documentation to an AsciiDoc file.
 *
 * @param doc the package documentation object
 */
private void renderPackage(PackageDoc doc){
    try {
        PrintWriter writer = getWriter(doc, "package-info");
        writer.println(doc.name());
        if (doc.position() != null) {
            outputText(doc.name(), doc.getRawCommentText(), writer);
        }
        if (doc instanceof AnnotationTypeDoc) {
            for (MemberDoc member : ((AnnotationTypeDoc) doc).elements()) {
                outputText(member.name(), member.getRawCommentText(), writer);
            }
        }
        writer.flush();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
}
 
开发者ID:johncarl81,项目名称:exportdoclet,代码行数:23,代码来源:ExportRenderer.java

示例2: addUsedBy

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 *  @param usedClassToPackagesMap  ClassDoc to (PackageDoc to (UsageType to (Set of Doc)))
 */
private void addUsedBy(Map usedClassToPackagesMap,
                       ClassDoc usedClass, UsageType usageType, Doc user, PackageDoc userPackage)
{
   Map packageToUsageTypeMap = (Map)usedClassToPackagesMap.get(usedClass);
   if (null == packageToUsageTypeMap) {
      packageToUsageTypeMap = new HashMap();
      usedClassToPackagesMap.put(usedClass, packageToUsageTypeMap);
   }

   Map usageTypeToUsersMap = (Map)packageToUsageTypeMap.get(userPackage);
   if (null == usageTypeToUsersMap) {
      usageTypeToUsersMap = new TreeMap();
      packageToUsageTypeMap.put(userPackage, usageTypeToUsersMap);
   }

   Set userSet = (Set)usageTypeToUsersMap.get(usageType);
   if (null == userSet) {
      userSet = new TreeSet(); // FIXME: we need the collator from Main here
      usageTypeToUsersMap.put(usageType, userSet);
   }
   userSet.add(user);
}
 
开发者ID:vilie,项目名称:javify,代码行数:26,代码来源:AbstractDoclet.java

示例3: toPackageNode

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 * Returns the XML node corresponding to the specified ClassDoc.
 *
 * @param doc The package to transform.
 */
private static XMLNode toPackageNode(PackageDoc doc) {
  XMLNode node = new XMLNode("package", doc);

  // Core attributes
  node.attribute("name", doc.name());

  // Comment
  node.child(toComment(doc));

  // Child nodes
  node.child(toAnnotationsNode(doc.annotations()));
  node.child(toStandardTags(doc));
  node.child(toTags(doc));
  node.child(toSeeNodes(doc.seeTags()));

  return node;
}
 
开发者ID:pageseeder,项目名称:xmldoclet,代码行数:23,代码来源:XMLDoclet.java

示例4: getExportedPackage

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
private String getExportedPackage(ClassDoc clz) {
  if (clz == null) {
    return "";
  }

  PackageDoc cpkg = clz.containingPackage();
  String pkg = cpkg == null ? "" : (cpkg.name());

  for (AnnotationDesc a : clz.annotations()) {
    if (a.annotationType().name().equals("ExportPackage")) {
      for (AnnotationDesc.ElementValuePair p : a.elementValues()) {
        pkg = p.value().toString();
        break;
      }
    }
  }
  pkg = pkg.replaceAll("\"", "");
  return pkg;
}
 
开发者ID:codeaudit,项目名称:gwt-chronoscope,代码行数:20,代码来源:ChronoscopeDoclet.java

示例5: getPackages

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
private PackageDoc[] getPackages(PackageDoc[] orig, String... types) {
    List<PackageDoc> wrapped = new ArrayList<PackageDoc>();

    for (PackageDoc p : orig) {
        // wrap the package
        ClassLoader loader = WonderlandDoclet.class.getClassLoader();
        Class<?>[] interfaces = new Class<?>[] { PackageDoc.class };
        InvocationHandler handler = new PackageDocWrapper(p, "ExperimentalAPI");
        PackageDoc pkg =
                (PackageDoc) Proxy.newProxyInstance(loader, interfaces, handler);
        if (pkg.allClasses().length > 0) {
            wrapped.add(pkg);
        }
    }
    
    return wrapped.toArray(new PackageDoc[0]);
}
 
开发者ID:josmas,项目名称:openwonderland,代码行数:18,代码来源:WonderlandDoclet.java

示例6: classLink

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 * Appends to the current document a valid markdown link
 * that aims to be the shortest one, by using the
 * {@link #getPath(String, String)} method. The
 * built URL will start from the given ``source``
 * package to the given ``target`` class.
 *  
 * @param source Source package to start URL from.
 * @param target Target class to reach from this package.
 */
public void classLink(final PackageDoc source, final ClassDoc target) {
	if (target.isIncluded()) {
		final String path = getPath(source.name(), target.containingPackage().name());
		final StringBuffer urlBuilder = new StringBuffer();
		urlBuilder
			.append(path)
			.append(target.simpleTypeName())
			.append(MarkdownDocumentBuilder.LINK_EXTENSION);
		link(target.simpleTypeName(), urlBuilder.toString());
	}
	else {
		// TODO : Process external link here.
		// TODO : Use marklet-directory project when done.
		italic(target.qualifiedName());
	}
}
 
开发者ID:Faylixe,项目名称:marklet,代码行数:27,代码来源:MarkletDocumentBuilder.java

示例7: parameterLinks

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 * Appends to the current document the list of parameters
 * from the given ``type`` if any.
 * 
 * @param source Source package to start URL from.
 * @param type Target type to append parameters from.
 */
private void parameterLinks(final PackageDoc source, final Type type) {
	final ParameterizedType invocation = type.asParameterizedType();
	if (invocation != null) {
		final Type [] types = invocation.typeArguments();
		if (types.length > 0) {
			character('<');
			for (int i = 0; i < types.length; i++) {
				parameterLink(source, types[i]);
				if (i < types.length - 1) {
					text(", ");
				}
			}
			character('>');
		}
	}
}
 
开发者ID:Faylixe,项目名称:marklet,代码行数:24,代码来源:MarkletDocumentBuilder.java

示例8: parameterLink

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 * Appends to the current document the given type parameter
 * as a valid markdown link.
 * 
 * @param source Source package to start URL from.
 * @param type Target type parameter to reach from this package.
 */
private void parameterLink(final PackageDoc source, final Type type) {
	final WildcardType wildcard = type.asWildcardType();
	if (wildcard != null) {
		character('?');
	}
	else {
		final TypeVariable variableType = type.asTypeVariable();
		if (variableType != null) {
			final Type [] bounds = variableType.bounds();
			if (bounds.length > 0) {
				text("? extends ");
				for (int i = 0; i < bounds.length; i++) {
					typeLink(source, bounds[i]);
					if (i < bounds.length - 1) {
						text(" & ");
					}
				}
			}
		}
		else {
			typeLink(source, type);
		}
	}
}
 
开发者ID:Faylixe,项目名称:marklet,代码行数:32,代码来源:MarkletDocumentBuilder.java

示例9: header

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 * Appends to the current document the class
 * header. Consists in the class name with a
 * level 1 header, the class hierarchy, and
 * the comment text.
 */
private void header() {
	title();
	newLine();
	newLine();

	final PackageDoc packageDoc = classDoc.containingPackage();
	final String packageName = packageDoc.name();
	item();
	text(MarkletConstant.PACKAGE);
	character(' ');
	link(packageName, MarkletConstant.README_LINK);
	newLine();
	item();
	classHierarchy();
	interfaceHierarchy();
	newLine();
	newLine();
	description(classDoc);
	newLine();
	newLine();
}
 
开发者ID:Faylixe,项目名称:marklet,代码行数:28,代码来源:ClassPageBuilder.java

示例10: processPackageDoc

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 * @return the full JSON for the given PackageDoc
 */
protected JSONObject processPackageDoc(PackageDoc packageDoc) {

    if (packageDoc == null) {
        return null;
    }

    JSONObject retMe = processDoc(packageDoc);

    retMe.put("annotations", processAnnotationDescs(packageDoc.annotations()));
    retMe.put("annotationTypes", processAnnotationTypeDocStubs(packageDoc.annotationTypes()));
    retMe.put("enums", processClassDocStubs(packageDoc.enums()));
    retMe.put("errors", processClassDocStubs(packageDoc.errors()));
    retMe.put("exceptions", processClassDocStubs(packageDoc.exceptions()));
    retMe.put("interfaces", processClassDocStubs(packageDoc.interfaces()));
    retMe.put("ordinaryClasses", processClassDocStubs(packageDoc.ordinaryClasses()));

    return retMe;
}
 
开发者ID:rob4lderman,项目名称:javadoc-json-doclet,代码行数:22,代码来源:JsonDoclet.java

示例11: doRenderOn

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
@Override
protected void doRenderOn(HtmlCanvas html) throws IOException {
    PackagePage page = PageRenderer.getPage(html);
    PackageDoc packageDoc = page.getPackageDoc();

    html.div(class_("api_header")).p().content("package").h1().content(packageDoc.name())._div();
    if (packageDoc.inlineTags() != null && packageDoc.inlineTags().length > 0) {
        html.h2().content("Overview");
        html.p().render(new InlineTagsRenderer(generator, packageDoc.inlineTags(), packageDoc.position()))._p();
    }
    renderTypes(packageDoc.interfaces(), "Interfaces", page, html);
    renderTypes(packageDoc.ordinaryClasses(), "Classes", page, html);
    renderTypes(packageDoc.errors(), "Exceptions", page, html);
    renderTypes(packageDoc.enums(), "Enums", page, html);
    renderTypes(packageDoc.annotationTypes(), "Annotation Types", page, html);
}
 
开发者ID:nicolaschriste,项目名称:docdown,代码行数:17,代码来源:PackageContentRenderable.java

示例12: containingPackage

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
public PackageDoc containingPackage()
{
   Class outerClass = clazz;
   while (null != outerClass.getDeclaringClass()) {
      outerClass = outerClass.getDeclaringClass();
   }

   String packageName = outerClass.getName();
   int ndx = packageName.lastIndexOf('.');
   if (ndx > 0) {
      packageName = packageName.substring(0, ndx);
   }
   else {
      packageName = "";
   }
   PackageDoc result =  Main.getRootDoc().findOrCreatePackageDoc(packageName);
   return result;
}
 
开发者ID:cfriedt,项目名称:classpath,代码行数:19,代码来源:ClassDocReflectedImpl.java

示例13: set

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
public boolean set(String[] optionArr)
{
   try {
      PackageMatcher packageMatcher = new PackageMatcher();

      StringTokenizer tokenizer = new StringTokenizer(optionArr[2], ":");
      while (tokenizer.hasMoreTokens()) {
         String packageWildcard = tokenizer.nextToken();
         packageMatcher.addWildcard(packageWildcard);
      }

      SortedSet<PackageDoc> groupPackages = packageMatcher.filter(rootDoc.specifiedPackages());

      packageGroups.add(new PackageGroup(optionArr[1], groupPackages));

      return true;
   }
   catch (InvalidPackageWildcardException e) {
      return false;
   }
}
 
开发者ID:cfriedt,项目名称:classpath,代码行数:22,代码来源:AbstractDoclet.java

示例14: addUsedBy

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 *  @param usedClassToPackagesMap  ClassDoc to (PackageDoc to (UsageType to (Set of Doc)))
 */
private void addUsedBy(Map<ClassDoc,Map<PackageDoc,Map<UsageType,Set<Doc>>>> usedClassToPackagesMap,
                       ClassDoc usedClass, UsageType usageType, Doc user, PackageDoc userPackage)
{
   Map<PackageDoc,Map<UsageType,Set<Doc>>> packageToUsageTypeMap = usedClassToPackagesMap.get(usedClass);
   if (null == packageToUsageTypeMap) {
      packageToUsageTypeMap = new HashMap<PackageDoc,Map<UsageType,Set<Doc>>>();
      usedClassToPackagesMap.put(usedClass, packageToUsageTypeMap);
   }

   Map<UsageType,Set<Doc>> usageTypeToUsersMap = packageToUsageTypeMap.get(userPackage);
   if (null == usageTypeToUsersMap) {
     usageTypeToUsersMap = new TreeMap<UsageType,Set<Doc>>();
      packageToUsageTypeMap.put(userPackage, usageTypeToUsersMap);
   }

   Set<Doc> userSet = usageTypeToUsersMap.get(usageType);
   if (null == userSet) {
      userSet = new TreeSet<Doc>(); // FIXME: we need the collator from Main here
      usageTypeToUsersMap.put(usageType, userSet);
   }
   userSet.add(user);
}
 
开发者ID:cfriedt,项目名称:classpath,代码行数:26,代码来源:AbstractDoclet.java

示例15: toPackageNode

import com.sun.javadoc.PackageDoc; //导入依赖的package包/类
/**
 * Returns the XML node corresponding to the specified ClassDoc.
 *
 * @param doc The package to transform.
 */
private static XMLNode toPackageNode(PackageDoc doc) {
  XMLNode node = new XMLNode("package", doc);

  // Core attributes
  node.attribute("name", doc.name());

  // Comments
  node.child(toShortComment(doc));
  node.child(toComment(doc));

  // Child nodes
  node.child(toAnnotationsNode(doc.annotations()));
  node.child(toStandardTags(doc));
  node.child(toTags(doc));
  node.child(toSeeNodes(doc.seeTags()));

  return node;
}
 
开发者ID:bazooka,项目名称:bazooka-wo-xmldoclet,代码行数:24,代码来源:XMLDoclet.java


注:本文中的com.sun.javadoc.PackageDoc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。