Java Code Examples for org.eclipse.jdt.core.dom.AST#newAnnotationTypeMemberDeclaration()

The following examples show how to use org.eclipse.jdt.core.dom.AST#newAnnotationTypeMemberDeclaration() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NewAnnotationMemberProposal.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private AnnotationTypeMemberDeclaration getStub(ASTRewrite rewrite, AnnotationTypeDeclaration targetTypeDecl) {
	AST ast= targetTypeDecl.getAST();

	AnnotationTypeMemberDeclaration decl= ast.newAnnotationTypeMemberDeclaration();

	SimpleName newNameNode= getNewName(rewrite);

	decl.modifiers().addAll(ASTNodeFactory.newModifiers(ast, evaluateModifiers(targetTypeDecl)));

	ModifierCorrectionSubProcessor.installLinkedVisibilityProposals(getLinkedProposalModel(), rewrite, decl.modifiers(), true);

	decl.setName(newNameNode);

	Type returnType= getNewType(rewrite);
	decl.setType(returnType);
	return decl;
}
 
Example 2
Source File: NewAnnotationMemberProposal.java    From eclipse.jdt.ls with Eclipse Public License 2.0 3 votes vote down vote up
private AnnotationTypeMemberDeclaration getStub(ASTRewrite rewrite, AnnotationTypeDeclaration targetTypeDecl) {
	AST ast= targetTypeDecl.getAST();

	AnnotationTypeMemberDeclaration decl= ast.newAnnotationTypeMemberDeclaration();

	SimpleName newNameNode= getNewName(rewrite);

	decl.modifiers().addAll(ASTNodeFactory.newModifiers(ast, evaluateModifiers(targetTypeDecl)));

	decl.setName(newNameNode);

	Type returnType= getNewType(rewrite);
	decl.setType(returnType);
	return decl;
}