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


Java AnnotationExpr.setComment方法代码示例

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


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

示例1: getAnnotationNodes

import japa.parser.ast.expr.AnnotationExpr; //导入方法依赖的package包/类
@Override
protected NodeData getAnnotationNodes(String enclosingClass, String fieldName, String mappedClass) {
    final FieldDescriptor fd = OjbUtil.findFieldDescriptor(mappedClass, fieldName, descriptorRepositories);

    if (fd != null) {
        final Class<?> fc = ResolverUtil.getType(enclosingClass, fieldName);

        if (isEnum(fc)) {
            final Comment fixme = new BlockComment("\nFIXME:\n" +
                    "Enums must be annotated with the @Enumerated annotation.\n " +
                    "The @Enumerated annotation should set the EnumType.\n" +
                    "If the EnumType is not set, then the Enumerated annotation is defaulted to EnumType.ORDINAL.\n" +
                    "This conversion program cannot tell whether EnumType.ORDINAL is the appropriate EnumType.");
            AnnotationExpr enumerated = new NormalAnnotationExpr(new NameExpr(SIMPLE_NAME), Collections.singletonList(new MemberValuePair("value", new NameExpr("EnumType."))));
            enumerated.setComment(fixme);
            return new NodeData(enumerated, new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false),
                Collections.singletonList(new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), "TemporalType"), false, false)));
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:EnumeratedResolver.java

示例2: getAnnotationNodes

import japa.parser.ast.expr.AnnotationExpr; //导入方法依赖的package包/类
@Override
protected NodeData getAnnotationNodes(String enclosingClass, String fieldName, String mappedClass) {
    final List<Expression> joinColumns = getJoinColumns(enclosingClass, fieldName, mappedClass);
    if (joinColumns != null && joinColumns.size() > 1) {
        final Comment fixme = new BlockComment("\nFIXME: JPA_CONVERSION\n"
                + "For compound primary keys, make sure the join columns are in the correct order.\n");
        AnnotationExpr
                annotation = new SingleMemberAnnotationExpr(new NameExpr(SIMPLE_NAME), new ArrayInitializerExpr(joinColumns));
        annotation.setComment(fixme);
        return new NodeData(annotation,
                new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false),
                Arrays.asList(
                          new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PrimaryKeyJoinColumnResolver.PACKAGE),PrimaryKeyJoinColumnResolver.SIMPLE_NAME), false, false)
                        , new ImportDeclaration(new QualifiedNameExpr(new NameExpr(JoinColumnResolver.PACKAGE),JoinColumnResolver.SIMPLE_NAME), false, false)
                        ));
    }

    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:JoinColumnsResolver.java

示例3: getAnnotationNodes

import japa.parser.ast.expr.AnnotationExpr; //导入方法依赖的package包/类
@Override
protected NodeData getAnnotationNodes(String enclosingClass, String fieldName, String mappedClass) {
    final List<Expression> joinColumns = getJoinColumns(enclosingClass, fieldName, mappedClass);
    if (joinColumns != null && joinColumns.size() > 1) {
        final Comment fixme = new BlockComment("\nFIXME: JPA_CONVERSION\n"
                + "For compound primary keys, make sure the join columns are in the correct order.\n");
        AnnotationExpr annotation = new SingleMemberAnnotationExpr(new NameExpr(SIMPLE_NAME), new ArrayInitializerExpr(joinColumns));
        annotation.setComment(fixme);
        return new NodeData(annotation,
                new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false),
                Collections.singletonList(new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), "PrimaryKeyJoinColumn"), false, false)));
    }

    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:PrimaryKeyJoinColumnsResolver.java


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