本文整理汇总了Java中org.walkmod.javalang.ast.body.ConstructorDeclaration.getModifiers方法的典型用法代码示例。如果您正苦于以下问题:Java ConstructorDeclaration.getModifiers方法的具体用法?Java ConstructorDeclaration.getModifiers怎么用?Java ConstructorDeclaration.getModifiers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.walkmod.javalang.ast.body.ConstructorDeclaration
的用法示例。
在下文中一共展示了ConstructorDeclaration.getModifiers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.walkmod.javalang.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
public Boolean visit(ConstructorDeclaration n1, Node arg) {
ConstructorDeclaration n2 = (ConstructorDeclaration) arg;
if (n1.getModifiers() != n2.getModifiers()) {
return Boolean.FALSE;
}
if (!objEquals(n1.getName(), n2.getName())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getAnnotations(), n2.getAnnotations())) {
return Boolean.FALSE;
}
if (!nodeEquals(n1.getBlock(), n2.getBlock())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getParameters(), n2.getParameters())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getThrows(), n2.getThrows())) {
return Boolean.FALSE;
}
if (!nodesEquals(n1.getTypeParameters(), n2.getTypeParameters())) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
示例2: visit
import org.walkmod.javalang.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override
public Node visit(ConstructorDeclaration _n, Object _arg) {
JavadocComment javaDoc = cloneNodes(_n.getJavaDoc(), _arg);
List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
List<Parameter> parameters = visit(_n.getParameters(), _arg);
List<ClassOrInterfaceType> throws_ = visit(_n.getThrows(), _arg);
BlockStmt block = cloneNodes(_n.getBlock(), _arg);
ConstructorDeclaration r = new ConstructorDeclaration(_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(),
_n.getEndColumn(), javaDoc, _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters,
throws_, block);
return r;
}
示例3: visit
import org.walkmod.javalang.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
public void visit(ConstructorDeclaration n, VisitorContext ctx) {
Object o = ctx.get(NODE_TO_COMPARE_KEY);
if (o != null && o instanceof ConstructorDeclaration) {
boolean backup = isUpdated();
setIsUpdated(false);
ConstructorDeclaration aux = (ConstructorDeclaration) o;
boolean equals = n.getName().equals(aux.getName()) && n.getModifiers() == aux.getModifiers();
Position pos = popPosition();
pushPosition(aux);
inferASTChanges(n.getJavaDoc(), aux.getJavaDoc());
inferASTChanges(n.getAnnotations(), aux.getAnnotations());
inferASTChanges(n.getTypeParameters(), aux.getTypeParameters());
inferASTChanges(n.getParameters(), aux.getParameters());
inferASTChanges(n.getThrows(), aux.getThrows());
popPosition();
pushPosition(pos);
inferASTChanges(n.getBlock(), aux.getBlock());
if (!equals) {
applyUpdate(n, (Node) o);
}
if (!isUpdated()) {
if (equals) {
increaseUnmodifiedNodes(ConstructorDeclaration.class);
} else {
increaseUpdatedNodes(ConstructorDeclaration.class);
}
} else {
applyUpdate(n, aux, n.getTypeParameters(), aux.getTypeParameters());
applyUpdate(n, aux, n.getParameters(), aux.getParameters());
increaseUpdatedNodes(ConstructorDeclaration.class);
}
setIsUpdated(backup || isUpdated());
} else if (o != null) {
setIsUpdated(true);
applyUpdate(n, (Node) o);
}
}