本文整理汇总了Java中com.sun.javadoc.ConstructorDoc类的典型用法代码示例。如果您正苦于以下问题:Java ConstructorDoc类的具体用法?Java ConstructorDoc怎么用?Java ConstructorDoc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConstructorDoc类属于com.sun.javadoc包,在下文中一共展示了ConstructorDoc类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toConstructorsNode
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
/**
* Returns the .
*
* @param constructors The constructors.
* @param node The node to add the XML to.
*/
private static XMLNode toConstructorsNode(ConstructorDoc[] constructors) {
if (constructors.length < 1) return null;
// Create the <constructors> node
XMLNode node = new XMLNode("constructors");
// Add the <constructor> nodes
for (ConstructorDoc constructor : constructors) {
XMLNode c = new XMLNode("constructor");
updateExecutableMemberNode(constructor, c);
node.child(c);
}
return node;
}
开发者ID:pageseeder,项目名称:xmldoclet,代码行数:22,代码来源:XMLDoclet.java
示例2: parseIdentifier
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
private String parseIdentifier(Doc doc) {
if (doc instanceof ClassDoc) {
ClassDoc classDoc = (ClassDoc) doc;
return parseIdentifier((Doc) classDoc.containingPackage()) + classDoc.name() + "/";
} else if (doc instanceof AnnotationTypeElementDoc) {
AnnotationTypeElementDoc annotationTypeElementDoc = (AnnotationTypeElementDoc) doc;
return parseIdentifier((Doc) annotationTypeElementDoc.containingClass()) + "#" + annotationTypeElementDoc.name();
} else if (doc instanceof FieldDoc) {
FieldDoc fieldDoc = (FieldDoc) doc;
return parseIdentifier((Doc) fieldDoc.containingClass()) + "#" + fieldDoc.name();
} else if (doc instanceof ConstructorDoc) {
ConstructorDoc constructorDoc = (ConstructorDoc) doc;
return parseIdentifier((Doc) constructorDoc.containingClass()) + "#" + constructorDoc.name() + URLEncoder.encode(constructorDoc.flatSignature());
} else if (doc instanceof MethodDoc) {
MethodDoc methodDoc = (MethodDoc) doc;
return parseIdentifier((Doc) methodDoc.containingClass()) + "#" + methodDoc.name() + URLEncoder.encode(methodDoc.flatSignature());
} else {
return "/" + doc.name() + "/";
}
}
开发者ID:riptano,项目名称:xml-doclet,代码行数:22,代码来源:Parser.java
示例3: toConstructorsNode
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
/**
* Returns the .
*
* @param constructors The constructors.
* @param node The node to add the XML to.
*/
private static XMLNode toConstructorsNode(ConstructorDoc[] constructors) {
if (constructors.length < 1) return null;
// Create the <constructors> node
XMLNode node = new XMLNode("constructors");
// Add the <constructor> nodes
for (ConstructorDoc constructor : constructors) {
XMLNode c = new XMLNode("constructor");
updateExecutableMemberNode(constructor, c);
// standard block tags
c.child(toStandardTags(constructor));
// deprecated
toDeprecated(constructor, c);
node.child(c);
}
return node;
}
开发者ID:bazooka,项目名称:bazooka-wo-xmldoclet,代码行数:26,代码来源:XMLDoclet.java
示例4: constructorInfo
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
private SignatureInformation constructorInfo(ExecutableElement method) {
Optional<ConstructorDoc> doc = docs.constructorDoc(docs.methodKey(method));
Optional<String> docText =
doc.flatMap(constructor -> Optional.ofNullable(constructor.commentText()))
.map(Javadocs::htmlToMarkdown)
.map(Javadocs::firstSentence);
return new SignatureInformation(
Hovers.methodSignature(method, false, true),
docText.orElse(null),
paramInfo(method));
}
开发者ID:georgewfraser,项目名称:vscode-javac,代码行数:13,代码来源:Signatures.java
示例5: getSortedConstructors
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
protected ConstructorDoc[] getSortedConstructors(ClassDoc classDoc)
{
ConstructorDoc[] result = (ConstructorDoc[])sortedConstructorMap.get(classDoc);
if (null == result) {
ConstructorDoc[] constructors = classDoc.constructors();
result = (ConstructorDoc[])constructors.clone();
Arrays.sort(result);
return result;
}
return result;
}
开发者ID:vilie,项目名称:javify,代码行数:12,代码来源:AbstractDoclet.java
示例6: hasMethods
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
private boolean hasMethods(ClassDoc clz) {
int countExportedMethods = 0;
for (ConstructorDoc cd : clz.constructors()) {
if (isExportable(cd)) {
countExportedMethods++;
}
}
for (MethodDoc md : clz.methods()) {
if (isExportable(md)) {
countExportedMethods++;
}
}
return countExportedMethods > 0;
}
开发者ID:codeaudit,项目名称:gwt-chronoscope,代码行数:15,代码来源:ChronoscopeDoclet.java
示例7: isExportable
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
private boolean isExportable(ConstructorDoc cd) {
boolean export = isExported(cd.containingClass());
for (AnnotationDesc a : cd.annotations()) {
if (a.annotationType().name().equals("Export")) {
export = true;
}
if (a.annotationType().name().equals("NoExport")) {
export = false;
}
}
return export;
}
开发者ID:codeaudit,项目名称:gwt-chronoscope,代码行数:13,代码来源:ChronoscopeDoclet.java
示例8: processConstructorDocs
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
/**
* @return full JSON objects for the given ConstructorDoc[]
*/
protected JSONArray processConstructorDocs(ConstructorDoc[] constructorDocs) {
JSONArray retMe = new JSONArray();
for (ConstructorDoc constructorDoc: constructorDocs) {
retMe.add( processConstructorDoc( constructorDoc ) );
}
return retMe;
}
开发者ID:rob4lderman,项目名称:javadoc-json-doclet,代码行数:11,代码来源:JsonDoclet.java
示例9: processConstructorDocStubs
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
/**
* @return JSON stubs for the given ConstructorDoc[].
*/
protected JSONArray processConstructorDocStubs(ConstructorDoc[] constructorDocs) {
JSONArray retMe = new JSONArray();
for (ConstructorDoc constructorDoc: constructorDocs) {
retMe.add( processConstructorDocStub( constructorDoc ) );
}
return retMe;
}
开发者ID:rob4lderman,项目名称:javadoc-json-doclet,代码行数:11,代码来源:JsonDoclet.java
示例10: process
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
int process(Parser parser, char[] source, int startIndex, int endIndex) throws IOException, ParseException {
//ctx.fieldList.add(FieldDocImpl.createFromSource(source, startIndex, endIndex));
//System.out.println("function match '"+new String(source,startIndex,endIndex-startIndex)+"'");
ExecutableMemberDocImpl execDoc=MethodDocImpl.createFromSource(parser.ctx.classDoc,
parser.ctx.classDoc.containingPackage(),
source, startIndex, endIndex);
if (parser.getAddComments())
execDoc.setRawCommentText(parser.getLastComment());
parser.setLastComment(null);
if (execDoc.isMethod()) {
MethodDoc methDoc = (MethodDoc) execDoc;
parser.ctx.methodList.add(methDoc);
if (methDoc.isIncluded()) {
parser.ctx.filteredMethodList.add(methDoc);
}
if (methDoc.name().equals("readObject")
|| methDoc.name().equals("writeObject")
|| methDoc.name().equals("readExternal")
|| methDoc.name().equals("writeExternal")
|| methDoc.name().equals("readResolve")) {
// FIXME: add readExternal here?
parser.ctx.maybeSerMethodList.add(methDoc);
}
} else {
ConstructorDoc constDoc = (ConstructorDoc) execDoc;
parser.ctx.constructorList.add(constDoc);
if (constDoc.isIncluded()) {
parser.ctx.filteredConstructorList.add(constDoc);
}
}
return endIndex;
}
开发者ID:cfriedt,项目名称:classpath,代码行数:40,代码来源:Parser.java
示例11: classClosed
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
void classClosed() throws ParseException, IOException {
ctx.classDoc.setFields(toArray(ctx.fieldList,new FieldDoc[ctx.fieldList.size()]));
ctx.classDoc.setFilteredFields(toArray(ctx.filteredFieldList,new FieldDoc[ctx.filteredFieldList.size()]));
ctx.classDoc.setSerializableFields(toArray(ctx.sfieldList, new FieldDoc[ctx.sfieldList.size()]));
ctx.classDoc.setMethods(toArray(ctx.methodList, new MethodDoc[ctx.methodList.size()]));
ctx.classDoc.setFilteredMethods(toArray(ctx.filteredMethodList, new MethodDoc[ctx.filteredMethodList.size()]));
ctx.classDoc.setMaybeSerMethodList(ctx.maybeSerMethodList);
ctx.classDoc.setConstructors(toArray(ctx.constructorList, new ConstructorDoc[ctx.constructorList.size()]));
ctx.classDoc.setFilteredConstructors(toArray(ctx.filteredConstructorList,
new ConstructorDoc[ctx.filteredConstructorList.size()]));
ctx.classDoc.setInnerClasses(toArray(ctx.innerClassesList, new ClassDocImpl[ctx.innerClassesList.size()]));
ctx.classDoc.setFilteredInnerClasses(toArray(ctx.filteredInnerClassesList,
new ClassDocImpl[ctx.filteredInnerClassesList.size()]));
ctx.classDoc.setBoilerplateComment(boilerplateComment);
Main.getRootDoc().addClassDoc(ctx.classDoc);
if (Main.DESCEND_INTERFACES) {
for (int i=0; i<ctx.classDoc.interfaces().length; ++i) {
Main.getRootDoc().scheduleClass(ctx.classDoc, ctx.classDoc.interfaces()[i].qualifiedName());
}
}
Debug.log(1,"classClosed: "+ctx.classDoc);
ctx=(Context)contextStack.pop();
Debug.log(1, "Popping " + ctx);
ClassDoc[] referencedClasses=(ClassDoc[])referencedClassesList.toArray(new ClassDoc[0]);
if (Main.DESCEND_SUPERCLASS) {
for (int i=0; i<referencedClasses.length; ++i) {
Main.getRootDoc().scheduleClass(currentClass, referencedClasses[i].qualifiedName());
}
}
}
开发者ID:cfriedt,项目名称:classpath,代码行数:36,代码来源:Parser.java
示例12: getSignature
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
public String getSignature(Doc doc)
{
if (doc instanceof MethodDoc)
{
return doc.name() + ((MethodDoc) doc).signature();
} else if (doc instanceof FieldDoc)
{
return doc.name();
} else if (doc instanceof ConstructorDoc)
{
return doc.name() + ((ConstructorDoc) doc).signature();
}
return doc.name();
}
开发者ID:tcolar,项目名称:javaontracks,代码行数:15,代码来源:JOTDocletIndexWriter.java
示例13: getSignature
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
public String getSignature(Doc doc)
{
if (doc instanceof MethodDoc)
{
return doc.name() + ((MethodDoc) doc).signature();
} else if (doc instanceof FieldDoc)
{
return doc.name();
} else if (doc instanceof ConstructorDoc)
{
return doc.name() + ((ConstructorDoc) doc).signature();
}
return "";
}
开发者ID:tcolar,项目名称:javaontracks,代码行数:15,代码来源:JOTDocletNavView.java
示例14: getConstructors
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
public ConstructorDoc[] getConstructors()
{
ClassDoc doc = (ClassDoc) getVariables().get("curitem");
ConstructorDoc[] docs = doc.constructors(false);
// constructors are not inherited.
// we show private constructors as this is useful info.
Arrays.sort(docs);
return docs;
}
开发者ID:tcolar,项目名称:javaontracks,代码行数:10,代码来源:JOTDocletNavView.java
示例15: getParamString
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
public String getParamString(ConstructorDoc doc)
{
String str = "(";
Parameter[] params = doc.parameters();
str = str + processParams(params);
str += ")";
return str;
}
开发者ID:tcolar,项目名称:javaontracks,代码行数:9,代码来源:JOTDocletNavView.java
示例16: invoke
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
@Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
String methodName = method.getName();
if (target instanceof Doc) {
if (methodName.equals("isIncluded")) {
Doc doc = (Doc) target;
return !exclude(doc) && doc.isIncluded();
}
if (target instanceof RootDoc) {
if (methodName.equals("classes")) {
return filter(((RootDoc) target).classes(), ClassDoc.class);
} else if (methodName.equals("specifiedClasses")) {
return filter(((RootDoc) target).specifiedClasses(), ClassDoc.class);
} else if (methodName.equals("specifiedPackages")) {
return filter(((RootDoc) target).specifiedPackages(), PackageDoc.class);
}
} else if (target instanceof ClassDoc) {
if (isFiltered(args)) {
if (methodName.equals("methods")) {
return filter(((ClassDoc) target).methods(true), MethodDoc.class);
} else if (methodName.equals("fields")) {
return filter(((ClassDoc) target).fields(true), FieldDoc.class);
} else if (methodName.equals("innerClasses")) {
return filter(((ClassDoc) target).innerClasses(true),
ClassDoc.class);
} else if (methodName.equals("constructors")) {
return filter(((ClassDoc) target).constructors(true),
ConstructorDoc.class);
}
}
} else if (target instanceof PackageDoc) {
if (methodName.equals("allClasses")) {
if (isFiltered(args)) {
return filter(((PackageDoc) target).allClasses(true),
ClassDoc.class);
} else {
return filter(((PackageDoc) target).allClasses(), ClassDoc.class);
}
} else if (methodName.equals("annotationTypes")) {
return filter(((PackageDoc) target).annotationTypes(),
AnnotationTypeDoc.class);
} else if (methodName.equals("enums")) {
return filter(((PackageDoc) target).enums(),
ClassDoc.class);
} else if (methodName.equals("errors")) {
return filter(((PackageDoc) target).errors(),
ClassDoc.class);
} else if (methodName.equals("exceptions")) {
return filter(((PackageDoc) target).exceptions(),
ClassDoc.class);
} else if (methodName.equals("interfaces")) {
return filter(((PackageDoc) target).interfaces(),
ClassDoc.class);
} else if (methodName.equals("ordinaryClasses")) {
return filter(((PackageDoc) target).ordinaryClasses(),
ClassDoc.class);
}
}
}
if (args != null) {
if (methodName.equals("compareTo") || methodName.equals("equals")
|| methodName.equals("overrides")
|| methodName.equals("subclassOf")) {
args[0] = unwrap(args[0]);
}
}
try {
return process(method.invoke(target, args), method.getReturnType());
} catch (InvocationTargetException e) {
throw e.getTargetException();
}
}
开发者ID:naver,项目名称:hadoop,代码行数:75,代码来源:RootDocProcessor.java
示例17: invoke
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
String methodName = method.getName();
if (target instanceof Doc) {
if (methodName.equals("isIncluded")) {
Doc doc = (Doc) target;
return !exclude(doc) && doc.isIncluded();
}
if (target instanceof RootDoc) {
if (methodName.equals("classes")) {
return filter(((RootDoc) target).classes(), ClassDoc.class);
} else if (methodName.equals("specifiedClasses")) {
return filter(((RootDoc) target).specifiedClasses(), ClassDoc.class);
} else if (methodName.equals("specifiedPackages")) {
return filter(((RootDoc) target).specifiedPackages(), PackageDoc.class);
}
} else if (target instanceof ClassDoc) {
if (isFiltered(args)) {
if (methodName.equals("methods")) {
return filter(((ClassDoc) target).methods(true), MethodDoc.class);
} else if (methodName.equals("fields")) {
return filter(((ClassDoc) target).fields(true), FieldDoc.class);
} else if (methodName.equals("innerClasses")) {
return filter(((ClassDoc) target).innerClasses(true), ClassDoc.class);
} else if (methodName.equals("constructors")) {
return filter(((ClassDoc) target).constructors(true), ConstructorDoc.class);
}
}
} else if (target instanceof PackageDoc) {
if (methodName.equals("allClasses")) {
if (isFiltered(args)) {
return filter(((PackageDoc) target).allClasses(true), ClassDoc.class);
} else {
return filter(((PackageDoc) target).allClasses(), ClassDoc.class);
}
} else if (methodName.equals("annotationTypes")) {
return filter(((PackageDoc) target).annotationTypes(), AnnotationTypeDoc.class);
} else if (methodName.equals("enums")) {
return filter(((PackageDoc) target).enums(), ClassDoc.class);
} else if (methodName.equals("errors")) {
return filter(((PackageDoc) target).errors(), ClassDoc.class);
} else if (methodName.equals("exceptions")) {
return filter(((PackageDoc) target).exceptions(), ClassDoc.class);
} else if (methodName.equals("interfaces")) {
return filter(((PackageDoc) target).interfaces(), ClassDoc.class);
} else if (methodName.equals("ordinaryClasses")) {
return filter(((PackageDoc) target).ordinaryClasses(), ClassDoc.class);
}
}
}
if (args != null) {
if (methodName.equals("compareTo") || methodName.equals("equals")
|| methodName.equals("overrides") || methodName.equals("subclassOf")) {
args[0] = unwrap(args[0]);
}
}
try {
return process(method.invoke(target, args), method.getReturnType());
} catch (InvocationTargetException e) {
throw e.getTargetException();
}
}
开发者ID:fengchen8086,项目名称:ditb,代码行数:64,代码来源:RootDocProcessor.java
示例18: invoke
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
@Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
String methodName = method.getName();
if (target instanceof Doc) {
if (methodName.equals("isIncluded")) {
Doc doc = (Doc) target;
return !exclude(doc) && doc.isIncluded();
}
if (target instanceof RootDoc) {
if (methodName.equals("classes")) {
return filter(((RootDoc) target).classes(), ClassDoc.class);
} else if (methodName.equals("specifiedClasses")) {
return filter(((RootDoc) target).specifiedClasses(), ClassDoc.class);
} else if (methodName.equals("specifiedPackages")) {
return filter(((RootDoc) target).specifiedPackages(), PackageDoc.class);
}
} else if (target instanceof ClassDoc) {
if (isFiltered(args)) {
if (methodName.equals("methods")) {
return filter(((ClassDoc) target).methods(true), MethodDoc.class);
} else if (methodName.equals("fields")) {
return filter(((ClassDoc) target).fields(true), FieldDoc.class);
} else if (methodName.equals("innerClasses")) {
return filter(((ClassDoc) target).innerClasses(true),
ClassDoc.class);
} else if (methodName.equals("constructors")) {
return filter(((ClassDoc) target).constructors(true),
ConstructorDoc.class);
}
}
} else if (target instanceof PackageDoc) {
if (methodName.equals("allClasses")) {
if (isFiltered(args)) {
return filter(((PackageDoc) target).allClasses(true),
ClassDoc.class);
} else {
return filter(((PackageDoc) target).allClasses(), ClassDoc.class);
}
} else if (methodName.equals("annotationTypes")) {
return filter(((PackageDoc) target).annotationTypes(),
AnnotationTypeDoc.class);
} else if (methodName.equals("enums")) {
return filter(((PackageDoc) target).enums(),
ClassDoc.class);
} else if (methodName.equals("errors")) {
return filter(((PackageDoc) target).errors(),
ClassDoc.class);
} else if (methodName.equals("exceptions")) {
return filter(((PackageDoc) target).exceptions(),
ClassDoc.class);
} else if (methodName.equals("interfaces")) {
return filter(((PackageDoc) target).interfaces(),
ClassDoc.class);
} else if (methodName.equals("ordinaryClasses")) {
return filter(((PackageDoc) target).ordinaryClasses(),
ClassDoc.class);
}
}
}
if (args != null) {
if (methodName.equals("compareTo") || methodName.equals("equals")
|| methodName.equals("overrides")
|| methodName.equals("subclassOf")) {
args[0] = unwrap(args[0]);
}
}
try {
return process(method.invoke(target, args), method.getReturnType());
} catch (InvocationTargetException e) {
throw e.getTargetException();
}
}
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:75,代码来源:RootDocProcessor.java
示例19: parseClass
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
protected Class parseClass(ClassDoc classDoc) {
Class classNode = objectFactory.createClass();
classNode.setName(classDoc.name());
classNode.setDisplayName(classDoc.simpleTypeName());
classNode.setIdentifier(parseIdentifier((Doc) classDoc));
classNode.setFull(classDoc.qualifiedName());
classNode.setComment(parseComment(classDoc));
classNode.setAbstract(classDoc.isAbstract());
classNode.setError(classDoc.isError());
classNode.setException(classDoc.isException());
classNode.setExternalizable(classDoc.isExternalizable());
classNode.setSerializable(classDoc.isSerializable());
classNode.setScope(parseScope(classDoc));
for (TypeVariable typeVariable : classDoc.typeParameters()) {
classNode.getGeneric().add(parseGeneric(typeVariable));
}
Type superClassType = classDoc.superclassType();
if (superClassType != null) {
classNode.setClazz(parseTypeInfo(superClassType));
}
for (Type interfaceType : classDoc.interfaceTypes()) {
classNode.getInterface().add(parseTypeInfo(interfaceType));
}
for (MethodDoc method : classDoc.methods()) {
classNode.getMethod().add(parseMethod(method));
}
for (ConstructorDoc constructor : classDoc.constructors()) {
classNode.getConstructor().add(parseConstructor(constructor));
}
for (FieldDoc field : classDoc.fields()) {
classNode.getField().add(parseField(field));
}
Tag[] tags;
SeeTag[] seeTags;
tags = classDoc.tags("@deprecated");
if (tags.length > 0) {
classNode.setDeprecated(parseComment(tags[0]));
}
tags = classDoc.tags("@since");
if (tags.length > 0) {
classNode.setSince(tags[0].text());
}
tags = classDoc.tags("@version");
if (tags.length > 0) {
classNode.setVersion(tags[0].text());
}
tags = classDoc.tags("@author");
for (int i = 0; i < tags.length; i++) {
classNode.getAuthor().add(tags[i].text());
}
seeTags = classDoc.seeTags();
for (int i = 0; i < seeTags.length; i++) {
classNode.getLink().add(parseLink(seeTags[i]));
}
return classNode;
}
开发者ID:riptano,项目名称:xml-doclet,代码行数:71,代码来源:Parser.java
示例20: invoke
import com.sun.javadoc.ConstructorDoc; //导入依赖的package包/类
@Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
String methodName = method.getName();
if (target instanceof Doc) {
if (methodName.equals("isIncluded")) {
Doc doc = (Doc) target;
return !exclude(doc) && doc.isIncluded();
}
if (target instanceof RootDoc) {
if (methodName.equals("classes")) {
return filter(((RootDoc) target).classes(), ClassDoc.class);
} else if (methodName.equals("specifiedClasses")) {
return filter(((RootDoc) target).specifiedClasses(), ClassDoc.class);
} else if (methodName.equals("specifiedPackages")) {
return filter(((RootDoc) target).specifiedPackages(), PackageDoc.class);
}
} else if (target instanceof ClassDoc) {
if (isFiltered(args)) {
if (methodName.equals("methods")) {
return filter(((ClassDoc) target).methods(true), MethodDoc.class);
} else if (methodName.equals("fields")) {
return filter(((ClassDoc) target).fields(true), FieldDoc.class);
} else if (methodName.equals("innerClasses")) {
return filter(((ClassDoc) target).innerClasses(true),
ClassDoc.class);
} else if (methodName.equals("constructors")) {
return filter(((ClassDoc) target).constructors(true),
ConstructorDoc.class);
}
} else {
if (methodName.equals("methods")) {
return filter(((ClassDoc) target).methods(true), MethodDoc.class);
}
}
} else if (target instanceof PackageDoc) {
if (methodName.equals("allClasses")) {
if (isFiltered(args)) {
return filter(((PackageDoc) target).allClasses(true),
ClassDoc.class);
} else {
return filter(((PackageDoc) target).allClasses(), ClassDoc.class);
}
} else if (methodName.equals("annotationTypes")) {
return filter(((PackageDoc) target).annotationTypes(),
AnnotationTypeDoc.class);
} else if (methodName.equals("enums")) {
return filter(((PackageDoc) target).enums(),
ClassDoc.class);
} else if (methodName.equals("errors")) {
return filter(((PackageDoc) target).errors(),
ClassDoc.class);
} else if (methodName.equals("exceptions")) {
return filter(((PackageDoc) target).exceptions(),
ClassDoc.class);
} else if (methodName.equals("interfaces")) {
return filter(((PackageDoc) target).interfaces(),
ClassDoc.class);
} else if (methodName.equals("ordinaryClasses")) {
return filter(((PackageDoc) target).ordinaryClasses(),
ClassDoc.class);
}
}
}
if (args != null) {
if (methodName.equals("compareTo") || methodName.equals("equals")
|| methodName.equals("overrides")
|| methodName.equals("subclassOf")) {
args[0] = unwrap(args[0]);
}
}
try {
return process(method.invoke(target, args), method.getReturnType());
} catch (InvocationTargetException e) {
throw e.getTargetException();
}
}
开发者ID:hopshadoop,项目名称:hops,代码行数:79,代码来源:RootDocProcessor.java
注:本文中的com.sun.javadoc.ConstructorDoc类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论