本文整理汇总了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;
}
示例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 };
}
示例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 };
}
示例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;
}
示例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 };
}
示例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);
}
示例7: visit
import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; //导入依赖的package包/类
@Override
public boolean visit(SingleMemberAnnotation annotation, BlockScope scope) {
return false;
}
示例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);
}