本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
示例11: visit
import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public Boolean visit(MarkerAnnotationExpr n, Void arg) {
return false;
}
示例12: visit
import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
@Override
public void visit(MarkerAnnotationExpr n, Scope arg) {
super.visit(n, arg);
n.setData(arg);
}
示例13: visit
import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public R visit(MarkerAnnotationExpr n, A arg) {
n.getName().accept(this, arg);
return null;
}
示例14: visit
import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public void visit(MarkerAnnotationExpr n, Object arg) {
printer.print("@");
n.getName().accept(this, arg);
}
示例15: visit
import japa.parser.ast.expr.MarkerAnnotationExpr; //导入依赖的package包/类
public void visit(MarkerAnnotationExpr n, A arg) {
n.getName().accept(this, arg);
}