• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AnnotationTypeDoc类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: renderPackage

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的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: getAnnotElems

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
public AnnotationTypeElementDoc[] getAnnotElems()
{
    Vector myDocs = new Vector();
    ClassDoc mainDoc = (ClassDoc) getVariables().get("curitem");
    //System.out.println(mainDoc.typeName());
    //System.out.println(mainDoc instanceof AnnotationTypeDoc);
    AnnotationTypeDoc doc = (AnnotationTypeDoc) mainDoc;
    AnnotationTypeElementDoc[] docs = doc.elements();

    for (int i = 0; i != docs.length; i++)
    {
        if (docs[i].isPrivate())
        {
            continue;
        }
        myDocs.add(docs[i]);
    }
    AnnotationTypeElementDoc[] docArray = (AnnotationTypeElementDoc[]) myDocs.toArray(new AnnotationTypeElementDoc[0]);
    Arrays.sort(docArray);
    return docArray;
}
 
开发者ID:tcolar,项目名称:javaontracks,代码行数:22,代码来源:JOTDocletNavView.java


示例3: build

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
public static PSOperatorWrapperDoc build(ClassDoc classDoc) {
    AnnotationDesc[] annotations = classDoc.annotations();
    for (AnnotationDesc annotation : annotations) {
        AnnotationTypeDoc annotationType = annotation.annotationType();
        if (Consts.OPERATOR_WRAPPER_ANNOTATION.equals(annotationType.toString())) {
            return new PSOperatorWrapperDoc(classDoc);
        }
    }
    return null;
}
 
开发者ID:PrivacyStreams,项目名称:PrivacyStreams,代码行数:11,代码来源:PSOperatorWrapperDoc.java


示例4: build

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
public static PSPipelineDoc build(ClassDoc classDoc, MethodDoc methodDoc) {
    AnnotationDesc[] annotations = methodDoc.annotations();
    for (AnnotationDesc annotation : annotations) {
        AnnotationTypeDoc annotationType = annotation.annotationType();
        if (Consts.TRANSFORMATION_ANNOTATION.equals(annotationType.toString())) {
            return new PSPipelineDoc(classDoc, methodDoc, annotation, TYPE_TRANSFORMATION);
        }
        else if (Consts.ACTION_ANNOTATION.equals(annotationType.toString())) {
            return new PSPipelineDoc(classDoc, methodDoc, annotation, TYPE_ACTION);
        }
    }
    return null;
}
 
开发者ID:PrivacyStreams,项目名称:PrivacyStreams,代码行数:14,代码来源:PSPipelineDoc.java


示例5: build

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
public static PSItemFieldDoc build(PSItemDoc psItemDoc, FieldDoc fieldDoc) {
    AnnotationDesc[] annotations = fieldDoc.annotations();
    for (AnnotationDesc annotation : annotations) {
        AnnotationTypeDoc annotationType = annotation.annotationType();
        if (Consts.ITEM_FIELD_ANNOTATION.equals(annotationType.toString())) {
            return new PSItemFieldDoc(psItemDoc, fieldDoc, annotation);
        }
    }
    return null;
}
 
开发者ID:PrivacyStreams,项目名称:PrivacyStreams,代码行数:11,代码来源:PSItemFieldDoc.java


示例6: isValidPSItem

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
public static boolean isValidPSItem(ClassDoc classDoc) {
    AnnotationDesc[] annotations = classDoc.annotations();
    for (AnnotationDesc annotation : annotations) {
        AnnotationTypeDoc annotationType = annotation.annotationType();
        if (Consts.ITEM_ANNOTATION.equals(annotationType.toString())) {
            return true;
        }
    }
    return false;
}
 
开发者ID:PrivacyStreams,项目名称:PrivacyStreams,代码行数:11,代码来源:PSItemDoc.java


示例7: generateClassFiles

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
@Override
protected void generateClassFiles(ClassDoc[] arr, ClassTree classtree) {

	Arrays.sort(arr);
	for (int i = 0; i < arr.length; i++) {
		if (!(configurationEx.isGeneratedDoc(arr[i]) && arr[i].isIncluded())) {
			continue;
		}
		ClassDoc prev = (i == 0) ? null : arr[i - 1];
		ClassDoc curr = arr[i];
		ClassDoc next = (i + 1 == arr.length) ? null : arr[i + 1];
		try {
			if (curr.isAnnotationType()) {
				AbstractBuilder annotationTypeBuilder = configurationEx
						.getBuilderFactory().getAnnotationTypeBuilder(
								(AnnotationTypeDoc) curr, prev, next);
				annotationTypeBuilder.build();
			} else {
				AbstractBuilder classBuilder = configurationEx
						.getBuilderFactory().getClassBuilder(curr, prev,
								next, classtree);
				classBuilder.build();
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw new DocletAbortException(e.getMessage());
		}
	}

}
 
开发者ID:WinRoad-NET,项目名称:htmldoclet4jdk8,代码行数:31,代码来源:HtmlDoclet.java


示例8: generateClassFiles

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
@Override
protected void generateClassFiles(ClassDoc[] arr, ClassTree classtree) {

	Arrays.sort(arr);
	for (int i = 0; i < arr.length; i++) {
		if (!(configurationEx.isGeneratedDoc(arr[i]) && arr[i].isIncluded())) {
			continue;
		}
		ClassDoc prev = (i == 0) ? null : arr[i - 1];
		ClassDoc curr = arr[i];
		ClassDoc next = (i + 1 == arr.length) ? null : arr[i + 1];
		try {
			if (curr.isAnnotationType()) {
				AbstractBuilder annotationTypeBuilder = configurationEx
						.getBuilderFactory().getAnnotationTypeBuilder(
								(AnnotationTypeDoc) curr, prev, next);
				annotationTypeBuilder.build();
			} else {
				AbstractBuilder classBuilder = configurationEx
						.getBuilderFactory().getClassBuilder(curr, prev,
								next, classtree);
				classBuilder.build();
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw new DocletAbortException();
		}
	}

}
 
开发者ID:WinRoad-NET,项目名称:htmldoclet4jdk7,代码行数:31,代码来源:HtmlDoclet.java


示例9: findAnnotation

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
public static AnnotationDesc findAnnotation(final AnnotationDesc[] annotations, final Class<?>... classes) {
	if (null != annotations && null != classes) {
		for (final AnnotationDesc annotation : annotations) {
			AnnotationTypeDoc docAnnotation = annotation.annotationType();
			for (final Class<?> clazz : classes) {
				if (docAnnotation.qualifiedName().equals(clazz.getName())) {
					return annotation;
				}
			}
		}
	}
	return null;
}
 
开发者ID:azuki-framework,项目名称:azuki-doclet-jaxrs,代码行数:14,代码来源:DocletUtility.java


示例10: processAnnotationTypeDoc

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
/**
 * @return the full JSON for the given annotation type
 */
protected JSONObject processAnnotationTypeDoc(AnnotationTypeDoc annoTypeDoc) {
    JSONObject retMe = processClassDoc(annoTypeDoc);
    
    retMe.put( "elements", processAnnotationTypeElementDocs( annoTypeDoc.elements() ) );
    
    return retMe;
}
 
开发者ID:rob4lderman,项目名称:javadoc-json-doclet,代码行数:11,代码来源:JsonDoclet.java


示例11: processAnnotationTypeDocStubs

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
/**
 * @return JSON stubs for the given AnnotationTypeDoc[].
 *
 *
 */
protected JSONArray processAnnotationTypeDocStubs(AnnotationTypeDoc[] annotationTypeDocs) {
    JSONArray retMe = new JSONArray();
    for (AnnotationTypeDoc annotationTypeDoc : annotationTypeDocs) {
        retMe.add( processAnnotationTypeDocStub(annotationTypeDoc) );
    }
    return retMe;
}
 
开发者ID:rob4lderman,项目名称:javadoc-json-doclet,代码行数:13,代码来源:JsonDoclet.java


示例12: invoke

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的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


示例13: getAnnotationTypeWriter

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
public AnnotationTypeWriter getAnnotationTypeWriter(AnnotationTypeDoc arg0,
		Type arg1, Type arg2) throws Exception {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:WinRoad-NET,项目名称:htmldoclet4jdk8,代码行数:6,代码来源:WriterFactoryImpl.java


示例14: invoke

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的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


示例15: invoke

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的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


示例16: isAnnotatedAsBoundedContext

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
private static boolean isAnnotatedAsBoundedContext(final AnnotationTypeDoc annotationType) {
    return BusinessDomain.class.getCanonicalName().equals(annotationType.qualifiedTypeName());
}
 
开发者ID:myunusov,项目名称:maxur-ldoc,代码行数:4,代码来源:SubDomain.java


示例17: isAnnotatedAsLink

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
private static boolean isAnnotatedAsLink(final AnnotationTypeDoc annotationType) {
    return Link.class.getCanonicalName().equals(annotationType.qualifiedTypeName());
}
 
开发者ID:myunusov,项目名称:maxur-ldoc,代码行数:4,代码来源:SubDomain.java


示例18: isAnnotatedAsLinks

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
private static boolean isAnnotatedAsLinks(final AnnotationTypeDoc annotationType) {
    return Links.class.getCanonicalName().equals(annotationType.qualifiedTypeName());
}
 
开发者ID:myunusov,项目名称:maxur-ldoc,代码行数:4,代码来源:SubDomain.java


示例19: isAnnotatedAsConcept

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
private static boolean isAnnotatedAsConcept(final AnnotationTypeDoc annotationType) {
    return Concept.class.getCanonicalName().equals(annotationType.qualifiedTypeName());
}
 
开发者ID:myunusov,项目名称:maxur-ldoc,代码行数:4,代码来源:SubDomain.java


示例20: parseAnnotationTypeDoc

import com.sun.javadoc.AnnotationTypeDoc; //导入依赖的package包/类
/**
 * Parse an annotation.
 * 
 * @param annotationTypeDoc
 *            A AnnotationTypeDoc instance
 * @return the annotation node
 */
protected Annotation parseAnnotationTypeDoc(ClassDoc classDoc) {
  Annotation annotationNode = objectFactory.createAnnotation();
  annotationNode.setName(classDoc.name());
  annotationNode.setDisplayName(classDoc.simpleTypeName());
  annotationNode.setIdentifier(parseIdentifier((Doc) classDoc));
  annotationNode.setFull(classDoc.qualifiedName());
  annotationNode.setComment(parseComment(classDoc));
  annotationNode.setScope(parseScope(classDoc));

  Tag[] tags;
  SeeTag[] seeTags;

  tags = classDoc.tags("@deprecated");
  if (tags.length > 0) {
    annotationNode.setDeprecated(parseComment(tags[0]));
  }

  tags = classDoc.tags("@since");
  if (tags.length > 0) {
    annotationNode.setSince(tags[0].text());
  }

  tags = classDoc.tags("@version");
  if (tags.length > 0) {
    annotationNode.setVersion(tags[0].text());
  }

  tags = classDoc.tags("@author");
  for (int i = 0; i < tags.length; i++) {
    annotationNode.getAuthor().add(tags[i].text());
  }

  seeTags = classDoc.seeTags();

  for (int i = 0; i < seeTags.length; i++) {
    annotationNode.getLink().add(parseLink(seeTags[i]));
  }

  for (AnnotationTypeElementDoc annotationTypeElementDoc : ((AnnotationTypeDoc) classDoc).elements()) {
    annotationNode.getElement().add(parseAnnotationTypeElementDoc(annotationTypeElementDoc));
  }

  return annotationNode;
}
 
开发者ID:riptano,项目名称:xml-doclet,代码行数:52,代码来源:Parser.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WorkspaceUndoUtil类代码示例发布时间:2022-05-21
下一篇:
Java OpenedRegionHandler类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap