本文整理汇总了Java中com.sun.javadoc.MethodDoc.annotations方法的典型用法代码示例。如果您正苦于以下问题:Java MethodDoc.annotations方法的具体用法?Java MethodDoc.annotations怎么用?Java MethodDoc.annotations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.javadoc.MethodDoc
的用法示例。
在下文中一共展示了MethodDoc.annotations方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseRequestMapping
import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
@Override
protected RequestMapping parseRequestMapping(MethodDoc method) {
RequestMapping mapping = new RequestMapping();
mapping.setContainerName(method.containingClass().simpleTypeName());
AnnotationDesc[] annotations = method.annotations();
String url = method.toString().replaceFirst(
method.containingClass().qualifiedName() + ".", "");
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].annotationType().name().equals("WebMethod")) {
for (ElementValuePair p : annotations[i].elementValues()) {
if (p.element().name().equals("operationName")) {
url = url.replace(method.name(), p.value().value()
.toString().replace("\"", ""));
}
}
}
}
mapping.setUrl(url);
mapping.setTooltip(method.containingClass().simpleTypeName());
mapping.setContainerName(method.containingClass().simpleTypeName());
return mapping;
}
示例2: build
import com.sun.javadoc.MethodDoc; //导入方法依赖的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;
}
示例3: getOutputParam
import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
@Override
protected APIParameter getOutputParam(MethodDoc method) {
APIParameter apiParameter = null;
if (method.returnType() != null) {
apiParameter = new APIParameter();
AnnotationDesc[] annotations = method.annotations();
boolean isResNameCustomized = false;
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].annotationType().name().equals("WebResult")) {
for (ElementValuePair p : annotations[i].elementValues()) {
if (p.element().name().equals("name")) {
apiParameter.setName(p.value().value().toString());
isResNameCustomized = true;
}
}
}
}
if (!isResNameCustomized) {
apiParameter.setName("return");
}
apiParameter.setParameterOccurs(ParameterOccurs.REQUIRED);
apiParameter.setType(this.getTypeName(method.returnType(), false));
for (Tag tag : method.tags("return")) {
apiParameter.setDescription(tag.text());
}
HashSet<String> processingClasses = new HashSet<String>();
apiParameter.setFields(this.getFields(method.returnType(),
ParameterType.Response, processingClasses));
apiParameter.setHistory(this.getModificationHistory(method
.returnType()));
}
return apiParameter;
}
示例4: getExportedName
import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
private String getExportedName(MethodDoc cd) {
String ename = cd.name();
for (AnnotationDesc a : cd.annotations()) {
if (a.annotationType().name().equals("Export")) {
for (AnnotationDesc.ElementValuePair p : a.elementValues()) {
ename = p.value().toString();
break;
}
}
}
return ename.replaceAll("\"", "");
}
示例5: isExportable
import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
private boolean isExportable(MethodDoc 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;
}