• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MarkerAnnotationExpr类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



MarkerAnnotationExpr类属于japa.parser.ast.expr包,在下文中一共展示了MarkerAnnotationExpr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAnnotationNodes

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的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);
        final String columnType = fd.getColumnType();
        if (isLob(columnType)) {
            if (isValidFieldType(fc)) {
                return new NodeData(new MarkerAnnotationExpr(new NameExpr(SIMPLE_NAME)),
                        new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false));
            } else {
                LOG.error(ResolverUtil.logMsgForField(enclosingClass, fieldName, mappedClass) + " is not a valid field type for the @Lob annotation, must be one of " + VALID_TYPES_STR);
            }
        }

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


示例2: resolve

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public NodeData resolve(Node node, String mappedClass) {
    if (!(node instanceof ClassOrInterfaceDeclaration)) {
        throw new IllegalArgumentException("this annotation belongs only on ClassOrInterfaceDeclaration");
    }

    final TypeDeclaration dclr = (TypeDeclaration) node;
    if (!(dclr.getParentNode() instanceof CompilationUnit)) {
        //handling nested classes
        return null;
    }

    final String name = dclr.getName();
    final String pckg = ((CompilationUnit) dclr.getParentNode()).getPackage().getName().toString();
    final String enclosingClass = pckg + "." + name;

    final ClassDescriptor cd = OjbUtil.findClassDescriptor(enclosingClass, descriptorRepositories);
    if (cd != null) {
        return new NodeData(new MarkerAnnotationExpr(new NameExpr(SIMPLE_NAME)),
                new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false));
    }

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


示例3: resolve

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public NodeData resolve(Node node, String mappedClass) {
    if (!(node instanceof ClassOrInterfaceDeclaration)) {
        throw new IllegalArgumentException("this annotation belongs only on ClassOrInterfaceDeclaration");
    }

    final TypeDeclaration dclr = (TypeDeclaration) node;
    if (!(dclr.getParentNode() instanceof CompilationUnit)) {
        //handling nested classes
        return null;
    }

    final String name = dclr.getName();
    final String pckg = ((CompilationUnit) dclr.getParentNode()).getPackage().getName().toString();
    final String enclosingClass = pckg + "." + name;
    if (!enclosingClass.equals(mappedClass)) {
        return new NodeData(new MarkerAnnotationExpr(new NameExpr(SIMPLE_NAME)),
            new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false));
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:MappedSuperClassResolver.java


示例4: resolve

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public NodeData resolve(Node node, String mappedClass) {
    if (!(node instanceof FieldDeclaration)) {
        throw new IllegalArgumentException("this annotation belongs only on FieldDeclaration");
    }

    final FieldDeclaration field = (FieldDeclaration) node;

    if (ResolverUtil.canFieldBeAnnotated(field)) {
        final boolean mappedColumn = OjbUtil.isMappedColumn(mappedClass, ParserUtil.getFieldName(field),
                descriptorRepositories);
        if (!mappedColumn) {
            return new NodeData(new MarkerAnnotationExpr(new NameExpr(SIMPLE_NAME)),
                    new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false));
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:TransientResolver.java


示例5: addAttachSkeleton

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
private void addAttachSkeleton() {
	List<Parameter> params = Collections.emptyList();
	MethodDeclaration method = new MethodDeclaration(
			ModifierSet.PUBLIC, new VoidType(), "attach", params);
	AnnotationExpr override = new MarkerAnnotationExpr(new NameExpr("Override"));
	method.setAnnotations(Collections.singletonList(override));
	
	BlockStmt block = new BlockStmt();
	Expression e = new MethodCallExpr(new SuperExpr(), "attach");
	List<Statement> sts = Collections.singletonList((Statement)new ExpressionStmt(e));
	block.setStmts(sts);
	method.setBody(block);
	
	if (getType().getMembers()==null) {
		getType().setMembers(new LinkedList<BodyDeclaration>());
	}
	getType().getMembers().add(method);
}
 
开发者ID:ahn,项目名称:mideaas,代码行数:19,代码来源:ControllerCode.java


示例6: addOnBecomingVisibleMethod

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@SuppressWarnings("unused")
private void addOnBecomingVisibleMethod() {
	List<Parameter> params = Collections.emptyList();
	MethodDeclaration method = new MethodDeclaration(
			ModifierSet.PUBLIC, new VoidType(), "onBecomingVisible", params);
	AnnotationExpr override = new MarkerAnnotationExpr(new NameExpr("Override"));
	method.setAnnotations(Collections.singletonList(override));
	
	BlockStmt block = new BlockStmt();
	Expression e = new MethodCallExpr(new SuperExpr(), "onBecomingVisible");
	List<Statement> sts = Collections.singletonList((Statement)new ExpressionStmt(e));
	block.setStmts(sts);
	method.setBody(block);
	
	if (getType().getMembers()==null) {
		getType().setMembers(new LinkedList<BodyDeclaration>());
	}
	getType().getMembers().add(method);
}
 
开发者ID:ahn,项目名称:mideaas,代码行数:20,代码来源:ControllerCode.java


示例7: getAnnotationNodes

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
protected NodeData getAnnotationNodes(String enclosingClass, String fieldName, String mappedClass) {
    final boolean pk = isPrimaryKeyColumn(mappedClass, fieldName);
    if (pk) {
        return new NodeData(new MarkerAnnotationExpr(new NameExpr(SIMPLE_NAME)),
                new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false));
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:IdResolver.java


示例8: getAnnotationNodes

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

    if (fd != null) {
        if (fd.isLocking()) {
            return new NodeData(new MarkerAnnotationExpr(new NameExpr(SIMPLE_NAME)),
                    new ImportDeclaration(new QualifiedNameExpr(new NameExpr(PACKAGE), SIMPLE_NAME), false, false));
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:VersionResolver.java


示例9: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public Boolean visit(MarkerAnnotationExpr n1, Node arg) {
    MarkerAnnotationExpr n2 = (MarkerAnnotationExpr) arg;

    if (!nodeEquals(n1.getName(), n2.getName())) {
        return Boolean.FALSE;
    }

    return Boolean.TRUE;
}
 
开发者ID:rfw,项目名称:genja,代码行数:10,代码来源:EqualsVisitor.java


示例10: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public void visit(MarkerAnnotationExpr n, Generator arg) {
    throw new TransformException("don't know how to linearize");
}
 
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:LinearizeTransform.java


示例11: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public Boolean visit(MarkerAnnotationExpr n, Void arg) {
    return false;
}
 
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:NodeAnnotator.java


示例12: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public void visit(MarkerAnnotationExpr n, Scope arg) {
    super.visit(n, arg);
    n.setData(arg);
}
 
开发者ID:rfw,项目名称:genja,代码行数:6,代码来源:ScopeCollector.java


示例13: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public R visit(MarkerAnnotationExpr n, A arg) {
    n.getName().accept(this, arg);
    return null;
}
 
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:GenericVisitorAdapter.java


示例14: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public void visit(MarkerAnnotationExpr n, Object arg) {
    printer.print("@");
    n.getName().accept(this, arg);
}
 
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:DumpVisitor.java


示例15: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public void visit(MarkerAnnotationExpr n, A arg) {
    n.getName().accept(this, arg);
}
 
开发者ID:rfw,项目名称:genja,代码行数:4,代码来源:VoidVisitorAdapter.java


示例16: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public Node visit(MarkerAnnotationExpr n, A arg) {
    n.setName((NameExpr) n.getName().accept(this, arg));
    return n;
}
 
开发者ID:rfw,项目名称:genja,代码行数:5,代码来源:ModifierVisitorAdapter.java


示例17: visit

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public void visit(MarkerAnnotationExpr n, Object arg) {
    doTest(source, n);
    super.visit(n, arg);
}
 
开发者ID:rfw,项目名称:genja,代码行数:6,代码来源:TestNodePositions.java


示例18: createAutogeneratedAnnotation

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@SuppressWarnings("unused")
private AnnotationExpr createAutogeneratedAnnotation() {
	return new MarkerAnnotationExpr(new NameExpr("AutoGenerated"));
}
 
开发者ID:ahn,项目名称:mideaas,代码行数:5,代码来源:ControllerCode.java


示例19: visitPre

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public void visitPre(MarkerAnnotationExpr n, A arg) {
    
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:VoidVisitorHelperBase.java


示例20: visitPost

import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public void visitPost(MarkerAnnotationExpr n, A arg) {
    
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:5,代码来源:VoidVisitorHelperBase.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MirroredTypesException类代码示例发布时间:2022-05-22
下一篇:
Java InterpreterCompletion类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap