Java 类com.sun.javadoc.AnnotationTypeDoc 实例源码

项目:exportdoclet    文件:ExportRenderer.java   
/**
 * 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();
    }
}
项目:javaontracks    文件:JOTDocletNavView.java   
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;
}
项目:PrivacyStreams    文件:PSOperatorWrapperDoc.java   
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;
}
项目:PrivacyStreams    文件:PSPipelineDoc.java   
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;
}
项目:PrivacyStreams    文件:PSItemFieldDoc.java   
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;
}
项目:PrivacyStreams    文件:PSItemDoc.java   
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;
}
项目:htmldoclet4jdk8    文件:HtmlDoclet.java   
@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());
        }
    }

}
项目:htmldoclet4jdk7    文件:HtmlDoclet.java   
@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();
        }
    }

}
项目:azuki-doclet-jaxrs    文件:DocletUtility.java   
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;
}
项目:javadoc-json-doclet    文件:JsonDoclet.java   
/**
 * @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;
}
项目:javadoc-json-doclet    文件:JsonDoclet.java   
/**
 * @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;
}
项目:hadoop    文件:RootDocProcessor.java   
@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();
     }
   }
项目:htmldoclet4jdk8    文件:WriterFactoryImpl.java   
public AnnotationTypeWriter getAnnotationTypeWriter(AnnotationTypeDoc arg0,
        Type arg1, Type arg2) throws Exception {
    // TODO Auto-generated method stub
    return null;
}
项目:htmldoclet4jdk7    文件:WriterFactoryImpl.java   
public AnnotationTypeWriter getAnnotationTypeWriter(AnnotationTypeDoc arg0,
        Type arg1, Type arg2) throws Exception {
    // TODO Auto-generated method stub
    return null;
}
项目:ditb    文件:RootDocProcessor.java   
@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();
  }
}
项目:aliyun-oss-hadoop-fs    文件:RootDocProcessor.java   
@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();
  }
}
项目:maxur-ldoc    文件:SubDomain.java   
private static boolean isAnnotatedAsBoundedContext(final AnnotationTypeDoc annotationType) {
    return BusinessDomain.class.getCanonicalName().equals(annotationType.qualifiedTypeName());
}
项目:maxur-ldoc    文件:SubDomain.java   
private static boolean isAnnotatedAsLink(final AnnotationTypeDoc annotationType) {
    return Link.class.getCanonicalName().equals(annotationType.qualifiedTypeName());
}
项目:maxur-ldoc    文件:SubDomain.java   
private static boolean isAnnotatedAsLinks(final AnnotationTypeDoc annotationType) {
    return Links.class.getCanonicalName().equals(annotationType.qualifiedTypeName());
}
项目:maxur-ldoc    文件:SubDomain.java   
private static boolean isAnnotatedAsConcept(final AnnotationTypeDoc annotationType) {
    return Concept.class.getCanonicalName().equals(annotationType.qualifiedTypeName());
}
项目:big-c    文件:RootDocProcessor.java   
@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();
     }
   }
项目:hadoop-2.6.0-cdh5.4.3    文件:RootDocProcessor.java   
@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();
     }
   }
项目:hadoop-plus    文件:RootDocProcessor.java   
@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();
     }
   }
项目:pbase    文件:RootDocProcessor.java   
@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();
  }
}
项目:xml-doclet    文件:Parser.java   
/**
 * 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;
}
项目:hops    文件:RootDocProcessor.java   
@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();
  }
}
项目:hadoop-TCP    文件:RootDocProcessor.java   
@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();
     }
   }
项目:javadoc-json-doclet    文件:JsonDoclet.java   
/**
 * Process the given classDoc along with all its methods, constructors, fields, enumConstants, etc.
 * 
 * @return a list of javadoc models.
 */
protected JSONArray processClass(ClassDoc classDoc) {
    JSONArray retMe = new JSONArray();

    retMe.add( classDoc.isAnnotationType() ? processAnnotationTypeDoc( (AnnotationTypeDoc) classDoc ) : processClassDoc(classDoc) );

    retMe.addAll( processMethodDocs( classDoc.methods() ) );

    retMe.addAll( processConstructorDocs( classDoc.constructors() ) );

    retMe.addAll( processFieldDocs( classDoc.fields() ) );

    retMe.addAll( processFieldDocs( classDoc.enumConstants() ) );

    return retMe;
}
项目:javadoc-json-doclet    文件:JsonDoclet.java   
/**
 * @return a JSON stub for the given AnnotationTypeDoc.
 */
protected JSONObject processAnnotationTypeDocStub(AnnotationTypeDoc annotationTypeDoc) {
    return processClassDocStub(annotationTypeDoc);
}
项目:hardfs    文件:RootDocProcessor.java   
@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();
     }
   }
项目:hadoop-on-lustre2    文件:RootDocProcessor.java   
@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();
     }
   }