当前位置: 首页>>代码示例>>Java>>正文


Java Declaration.getDocComment方法代码示例

本文整理汇总了Java中com.sun.mirror.declaration.Declaration.getDocComment方法的典型用法代码示例。如果您正苦于以下问题:Java Declaration.getDocComment方法的具体用法?Java Declaration.getDocComment怎么用?Java Declaration.getDocComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.mirror.declaration.Declaration的用法示例。


在下文中一共展示了Declaration.getDocComment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ProcessedHttpUrlAnnotation

import com.sun.mirror.declaration.Declaration; //导入方法依赖的package包/类
public ProcessedHttpUrlAnnotation(String typeName, Declaration declaration, String value, int weight) {
    MethodDeclaration methodDeclaration = (MethodDeclaration) declaration;
    String className = methodDeclaration.getDeclaringType().getQualifiedName();
    this.methodName = declaration.getSimpleName();
    this.docComment = declaration.getDocComment();
    this.className = className;
    this.value = value;
    this.weight = weight;
    this.setParams(methodDeclaration.getParameters());
    String typeNameShort = typeName.substring(typeName.lastIndexOf("."));
    SourcePosition positionInCode = declaration.getPosition();
    sourceRef = positionInCode.file().getName() + ":" + positionInCode.line();
    if (!(declaration instanceof MethodDeclaration)) {
        messager.printWarning(positionInCode, "@" + typeNameShort + " declared on a non-method " + positionInCode);
    }
    if (showPositionsOfAnnotations) {
        messager.printNotice(positionInCode, "@" + typeNameShort + " value " + value + " weight " + weight);
    }
}
 
开发者ID:paultuckey,项目名称:urlrewritefilter,代码行数:20,代码来源:HttpUrlAnnotationProcessor.java

示例2: processHttpExceptionHandlerAnnotation

import com.sun.mirror.declaration.Declaration; //导入方法依赖的package包/类
private ProcessedHttpExceptionAnnotation processHttpExceptionHandlerAnnotation(Declaration declaration) {
    SourcePosition position = declaration.getPosition();
    if (!(declaration instanceof MethodDeclaration)) {
        messager.printWarning(declaration.getPosition(), "@HttpExceptionHandler declared on a non-method " + position);
        return null;
    }
    MethodDeclaration methodDeclaration = (MethodDeclaration) declaration;
    HttpExceptionHandler httpExceptionHandler = declaration.getAnnotation(HttpExceptionHandler.class);
    String className = methodDeclaration.getDeclaringType().getQualifiedName();

    ProcessedHttpExceptionAnnotation ea = new ProcessedHttpExceptionAnnotation();
    ea.exceptionName = httpExceptionHandler.value(); //.getName();
    ea.methodName = declaration.getSimpleName();
    ea.docComment = declaration.getDocComment();
    ea.className = className;

    ea.setParams(methodDeclaration.getParameters());

    // out exceptionName might not be set
    if ("[ unassigned ]".equals(ea.exceptionName) && methodDeclaration.getParameters().size() > 0) {
        // use first param
        ea.exceptionName = methodDeclaration.getParameters().iterator().next().getType().toString();
    }

    if (showPositionsOfAnnotations) {
        messager.printNotice(position, "@HttpExceptionHandlerUrl value " + ea.value + " weight " + ea.weight);
    }
    return ea;
}
 
开发者ID:paultuckey,项目名称:urlrewritefilter,代码行数:30,代码来源:HttpUrlAnnotationProcessor.java

示例3: printDocComment

import com.sun.mirror.declaration.Declaration; //导入方法依赖的package包/类
private void printDocComment(Declaration d) {
  if (d.getDocComment() != null)
    out.println(asJavadoc(d.getDocComment()));
}
 
开发者ID:rmcilroy,项目名称:HeraJVM,代码行数:5,代码来源:SysCallProcessor.java


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