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


Java MarkerAnnotationExpr类代码示例

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


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


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