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


Java SingleMemberAnnotation类代码示例

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


SingleMemberAnnotation类属于org.eclipse.jdt.internal.compiler.ast包,在下文中一共展示了SingleMemberAnnotation类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSuppressWarningsAll

import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
public static Annotation[] createSuppressWarningsAll(ASTNode source, Annotation[] originalAnnotationArray) {
	int pS = source.sourceStart, pE = source.sourceEnd;
	long p = (long)pS << 32 | pE;
	long[] poss = new long[3];
	Arrays.fill(poss, p);
	QualifiedTypeReference suppressWarningsType = new QualifiedTypeReference(TypeConstants.JAVA_LANG_SUPPRESSWARNINGS, poss);
	setGeneratedBy(suppressWarningsType, source);
	SingleMemberAnnotation ann = new SingleMemberAnnotation(suppressWarningsType, pS);
	ann.declarationSourceEnd = pE;
	ann.memberValue = new StringLiteral(ALL, pS, pE, 0);
	setGeneratedBy(ann, source);
	setGeneratedBy(ann.memberValue, source);
	if (originalAnnotationArray == null) return new Annotation[] { ann };
	Annotation[] newAnnotationArray = new Annotation[originalAnnotationArray.length + 1];
	System.arraycopy(originalAnnotationArray, 0, newAnnotationArray, 0, originalAnnotationArray.length);
	newAnnotationArray[originalAnnotationArray.length] = ann;
	return newAnnotationArray;
}
 
开发者ID:redundent,项目名称:lombok,代码行数:19,代码来源:EclipseHandlerUtil.java

示例2: createConstructorProperties

import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
public static Annotation[] createConstructorProperties(ASTNode source, Collection<EclipseNode> fields) {
	if (fields.isEmpty()) return null;
	
	int pS = source.sourceStart, pE = source.sourceEnd;
	long p = (long) pS << 32 | pE;
	long[] poss = new long[3];
	Arrays.fill(poss, p);
	QualifiedTypeReference constructorPropertiesType = new QualifiedTypeReference(JAVA_BEANS_CONSTRUCTORPROPERTIES, poss);
	setGeneratedBy(constructorPropertiesType, source);
	SingleMemberAnnotation ann = new SingleMemberAnnotation(constructorPropertiesType, pS);
	ann.declarationSourceEnd = pE;
	
	ArrayInitializer fieldNames = new ArrayInitializer();
	fieldNames.sourceStart = pS;
	fieldNames.sourceEnd = pE;
	fieldNames.expressions = new Expression[fields.size()];
	
	int ctr = 0;
	for (EclipseNode field : fields) {
		char[] fieldName = removePrefixFromField(field);
		fieldNames.expressions[ctr] = new StringLiteral(fieldName, pS, pE, 0);
		setGeneratedBy(fieldNames.expressions[ctr], source);
		ctr++;
	}
	
	ann.memberValue = fieldNames;
	setGeneratedBy(ann, source);
	setGeneratedBy(ann.memberValue, source);
	return new Annotation[] { ann };
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:31,代码来源:HandleConstructor.java

示例3: createConstructorProperties

import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
public static Annotation[] createConstructorProperties(ASTNode source, Collection<EclipseNode> fields) {
	if (fields.isEmpty()) return null;
	
	int pS = source.sourceStart, pE = source.sourceEnd;
	long p = (long)pS << 32 | pE;
	long[] poss = new long[3];
	Arrays.fill(poss, p);
	QualifiedTypeReference constructorPropertiesType = new QualifiedTypeReference(JAVA_BEANS_CONSTRUCTORPROPERTIES, poss);
	setGeneratedBy(constructorPropertiesType, source);
	SingleMemberAnnotation ann = new SingleMemberAnnotation(constructorPropertiesType, pS);
	ann.declarationSourceEnd = pE;
	
	ArrayInitializer fieldNames = new ArrayInitializer();
	fieldNames.sourceStart = pS;
	fieldNames.sourceEnd = pE;
	fieldNames.expressions = new Expression[fields.size()];
	
	int ctr = 0;
	for (EclipseNode field : fields) {
		char[] fieldName = removePrefixFromField(field);
		fieldNames.expressions[ctr] = new StringLiteral(fieldName, pS, pE, 0);
		setGeneratedBy(fieldNames.expressions[ctr], source);
		ctr++;
	}
	
	ann.memberValue = fieldNames;
	setGeneratedBy(ann, source);
	setGeneratedBy(ann.memberValue, source);
	return new Annotation[] { ann };
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:31,代码来源:HandleConstructor.java

示例4: visit

import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
	this.scribe.printNextToken(TerminalTokens.TokenNameAT);
	if (this.preferences.insert_space_after_at_in_annotation) {
		this.scribe.space();
	}
	this.scribe.printQualifiedReference(annotation.sourceEnd, false/*do not expect parenthesis*/);
	this.scribe.printNextToken(TerminalTokens.TokenNameLPAREN, this.preferences.insert_space_before_opening_paren_in_annotation);
	if (this.preferences.insert_space_after_opening_paren_in_annotation) {
		this.scribe.space();
	}
	annotation.memberValue.traverse(this, scope);
	this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation);
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:CodeFormatterVisitor.java

示例5: createConstructorProperties

import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
private static Annotation[] createConstructorProperties(ASTNode source, Collection<EclipseNode> fields) {
	if (fields.isEmpty()) return null;
	
	int pS = source.sourceStart, pE = source.sourceEnd;
	long p = (long)pS << 32 | pE;
	long[] poss = new long[3];
	Arrays.fill(poss, p);
	QualifiedTypeReference constructorPropertiesType = new QualifiedTypeReference(JAVA_BEANS_CONSTRUCTORPROPERTIES, poss);
	setGeneratedBy(constructorPropertiesType, source);
	SingleMemberAnnotation ann = new SingleMemberAnnotation(constructorPropertiesType, pS);
	ann.declarationSourceEnd = pE;
	
	ArrayInitializer fieldNames = new ArrayInitializer();
	fieldNames.sourceStart = pS;
	fieldNames.sourceEnd = pE;
	fieldNames.expressions = new Expression[fields.size()];
	
	int ctr = 0;
	for (EclipseNode field : fields) {
		fieldNames.expressions[ctr] = new StringLiteral(field.getName().toCharArray(), pS, pE, 0);
		setGeneratedBy(fieldNames.expressions[ctr], source);
		ctr++;
	}
	
	ann.memberValue = fieldNames;
	setGeneratedBy(ann, source);
	setGeneratedBy(ann.memberValue, source);
	return new Annotation[] { ann };
}
 
开发者ID:redundent,项目名称:lombok,代码行数:30,代码来源:HandleConstructor.java

示例6: visit

import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
@Override public boolean visit(SingleMemberAnnotation node, BlockScope scope) {
	fixPositions(setGeneratedBy(node, source));
	return super.visit(node, scope);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:5,代码来源:SetGeneratedByVisitor.java

示例7: visit

import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
@Override
public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
  return false;
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:5,代码来源:GwtAstBuilder.java

示例8: visit

import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
@Override public boolean visit(SingleMemberAnnotation node, BlockScope scope) {
	setGeneratedBy(node, source);
	applyOffset(node);
	return super.visit(node, scope);
}
 
开发者ID:redundent,项目名称:lombok,代码行数:6,代码来源:SetGeneratedByVisitor.java


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