本文整理汇总了Java中com.sun.javadoc.AnnotationTypeDoc类的典型用法代码示例。如果您正苦于以下问题:Java AnnotationTypeDoc类的具体用法?Java AnnotationTypeDoc怎么用?Java AnnotationTypeDoc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnnotationTypeDoc类属于com.sun.javadoc包,在下文中一共展示了AnnotationTypeDoc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
}
}
示例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();
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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();
}
}