本文整理匯總了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;
}