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


Java ConstructorDeclaration.getModifiers方法代码示例

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


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

示例1: visit

import com.github.javaparser.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<NameExpr> throws_ = visit(_n.getThrows(), _arg);
	BlockStmt block = cloneNodes(_n.getBlock(), _arg);
	Comment comment = cloneNodes(_n.getComment(), _arg);

	ConstructorDeclaration r = new ConstructorDeclaration(
			_n.getBeginLine(), _n.getBeginColumn(), _n.getEndLine(), _n.getEndColumn(),
			 _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters, throws_, block
	);
	r.setComment(comment);
	return r;
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:18,代码来源:CloneVisitor.java

示例2: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override
public Node visit(ConstructorDeclaration _n, Object _arg) {
	List<AnnotationExpr> annotations = visit(_n.getAnnotations(), _arg);
	List<TypeParameter> typeParameters = visit(_n.getTypeParameters(), _arg);
	List<Parameter> parameters = visit(_n.getParameters(), _arg);
	List<ReferenceType> throws_ = visit(_n.getThrows(), _arg);
	BlockStmt block = cloneNodes(_n.getBody(), _arg);
	Comment comment = cloneNodes(_n.getComment(), _arg);

	ConstructorDeclaration r = new ConstructorDeclaration(
			_n.getRange(),
			 _n.getModifiers(), annotations, typeParameters, _n.getName(), parameters, throws_, block
	);
	r.setComment(comment);
	return r;
}
 
开发者ID:javaparser,项目名称:javasymbolsolver,代码行数:17,代码来源:CloneVisitor.java

示例3: visit

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
@Override public Boolean visit(final ConstructorDeclaration n1, final Node arg) {
	final ConstructorDeclaration n2 = (ConstructorDeclaration) arg;

	// javadoc are checked at CompilationUnit

	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;
}
 
开发者ID:plum-umd,项目名称:java-sketch,代码行数:36,代码来源:EqualsVisitor.java

示例4: buildConstructorAST

import com.github.javaparser.ast.body.ConstructorDeclaration; //导入方法依赖的package包/类
public void buildConstructorAST(ConstructorDeclaration constDec){
	try{
        
        this.text = printAndExtractText(constDec);
        
        // Get all thrown Exceptions
        for(ReferenceType type: constDec.getThrows()){
        	this.exceptions.add(type.toString());
        }
        
        this.name = constDec.getName();
        Node parent = constDec.getParentNode();
        if (parent instanceof ClassOrInterfaceDeclaration){
            this.className = ((ClassOrInterfaceDeclaration) parent).getName();
        }
        this.modifier = constDec.getModifiers();
        this.returnType = this.className;

        this.paramTypes = getParamTypes(constDec);            
        // Get Annotations
        for(AnnotationExpr annotExpr: constDec.getAnnotations()){
        	this.annotations.add(annotExpr.getName().toString());
        }
        
        // If JavaDocs present, extract them
        if (constDec.getJavaDoc() != null){
            this.javaDoc = cleanDocumentation(constDec.getJavaDoc().getContent());
        }
        
        this.comments = extractContainedComments(constDec);
        
        // These are in-line comments just before the method definitition
        if (constDec.getComment() != null){
        	if (this.comments == null){
        		this.comments = "";
        	}
        	this.comments += constDec.getComment().getContent(); 
        }
        
        // Recursively loop through child nodes and make a dictionary
        this.parseBody(constDec.getBlock());
        
        this.extractHighLevelConcepts();

    } catch (Exception ex){
        ex.printStackTrace();
    }

}
 
开发者ID:shashanksingh28,项目名称:code-similarity,代码行数:50,代码来源:ASTEnhanced.java


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