• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ClassFileConstants类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: toClassFmt

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
private long toClassFmt(final JavaVersion version) {
  if (version != null) {
    switch (version) {
      case JAVA5:
        return ClassFileConstants.JDK1_5;
      case JAVA6:
        return ClassFileConstants.JDK1_6;
      case JAVA7:
        return ClassFileConstants.JDK1_7;
      case JAVA8:
        return (((ClassFileConstants.MAJOR_VERSION_1_7 + 1) << 16) + ClassFileConstants.MINOR_VERSION_0);
      case JAVA9:
        return (((ClassFileConstants.MAJOR_VERSION_1_7 + 2) << 16) + ClassFileConstants.MINOR_VERSION_0);
      default:
        break;
    }
  }
  return 0;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:20,代码来源:InMemoryJavaCompiler.java


示例2: getLatestEcjCompilerVersionConstant

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
public static long getLatestEcjCompilerVersionConstant() {
	if (latestEcjCompilerVersionConstantCached != 0) return latestEcjCompilerVersionConstantCached;
	
	int highestVersionSoFar = 0;
	for (Field f : ClassFileConstants.class.getDeclaredFields()) {
		try {
			if (f.getName().startsWith("JDK1_")) {
				int thisVersion = Integer.parseInt(f.getName().substring("JDK1_".length()));
				if (thisVersion > highestVersionSoFar) {
					highestVersionSoFar = thisVersion;
					latestEcjCompilerVersionConstantCached = (Long) f.get(null);
				}
			}
		} catch (Exception ignore) {}
	}
	
	if (highestVersionSoFar > 6 && !ecjSupportsJava7Features()) {
		latestEcjCompilerVersionConstantCached = ClassFileConstants.JDK1_6;
	}
	return latestEcjCompilerVersionConstantCached;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:22,代码来源:Eclipse.java


示例3: handleValForForEach

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
public static boolean handleValForForEach(ForeachStatement forEach, BlockScope scope) {
	if (forEach.elementVariable == null) return false;
	
	if (!isVal(forEach.elementVariable.type, scope)) return false;
	
	TypeBinding component = getForEachComponentType(forEach.collection, scope);
	if (component == null) return false;
	TypeReference replacement = makeType(component, forEach.elementVariable.type, false);
	
	forEach.elementVariable.modifiers |= ClassFileConstants.AccFinal;
	forEach.elementVariable.annotations = addValAnnotation(forEach.elementVariable.annotations, forEach.elementVariable.type, scope);
	forEach.elementVariable.type = replacement != null ? replacement :
			new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, poss(forEach.elementVariable.type, 3));
	
	return false;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:17,代码来源:PatchVal.java


示例4: setFieldDefaultsForField

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
public void setFieldDefaultsForField(EclipseNode fieldNode, ASTNode pos, AccessLevel level, boolean makeFinal) {
	FieldDeclaration field = (FieldDeclaration) fieldNode.get();
	if (level != null && level != AccessLevel.NONE) {
		if ((field.modifiers & (ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected)) == 0) {
			if (!hasAnnotation(PackagePrivate.class, fieldNode)) {
				field.modifiers |= EclipseHandlerUtil.toEclipseModifier(level);
			}
		}
	}
	
	if (makeFinal && (field.modifiers & ClassFileConstants.AccFinal) == 0) {
		if (!hasAnnotation(NonFinal.class, fieldNode)) {
			if ((field.modifiers & ClassFileConstants.AccStatic) == 0 || field.initialization != null) {
				field.modifiers |= ClassFileConstants.AccFinal;
			}
		}
	}
	
	fieldNode.rebuild();
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:21,代码来源:HandleFieldDefaults.java


示例5: toEclipseModifier

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
/**
 * Turns an {@code AccessLevel} instance into the flag bit used by eclipse.
 */
public static int toEclipseModifier(AccessLevel value) {
	switch (value) {
	case MODULE:
	case PACKAGE:
		return 0;
	default:
	case PUBLIC:
		return ClassFileConstants.AccPublic;
	case PROTECTED:
		return ClassFileConstants.AccProtected;
	case NONE:
	case PRIVATE:
		return ClassFileConstants.AccPrivate;
	}
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:19,代码来源:EclipseHandlerUtil.java


示例6: createListOfNonExistentFields

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
/**
 * Given a list of field names and a node referring to a type, finds each name in the list that does not match a field within the type.
 */
public static List<Integer> createListOfNonExistentFields(List<String> list, EclipseNode type, boolean excludeStandard, boolean excludeTransient) {
	boolean[] matched = new boolean[list.size()];
	
	for (EclipseNode child : type.down()) {
		if (list.isEmpty()) break;
		if (child.getKind() != Kind.FIELD) continue;
		if (excludeStandard) {
			if ((((FieldDeclaration)child.get()).modifiers & ClassFileConstants.AccStatic) != 0) continue;
			if (child.getName().startsWith("$")) continue;
		}
		if (excludeTransient && (((FieldDeclaration)child.get()).modifiers & ClassFileConstants.AccTransient) != 0) continue;
		int idx = list.indexOf(child.getName());
		if (idx > -1) matched[idx] = true;
	}
	
	List<Integer> problematic = new ArrayList<Integer>();
	for (int i = 0 ; i < list.size() ; i++) {
		if (!matched[i]) problematic.add(i);
	}
	
	return problematic;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:26,代码来源:EclipseHandlerUtil.java


示例7: generateCleanMethod

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
private MethodDeclaration generateCleanMethod(List<BuilderFieldData> builderFields, EclipseNode builderType, ASTNode source) {
	List<Statement> statements = new ArrayList<Statement>();
	
	for (BuilderFieldData bfd : builderFields) {
		if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) {
			bfd.singularData.getSingularizer().appendCleaningCode(bfd.singularData, builderType, statements);
		}
	}
	
	FieldReference thisUnclean = new FieldReference(CLEAN_FIELD_NAME, 0);
	thisUnclean.receiver = new ThisReference(0, 0);
	statements.add(new Assignment(thisUnclean, new FalseLiteral(0, 0), 0));
	MethodDeclaration decl = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult);
	decl.selector = CLEAN_METHOD_NAME;
	decl.modifiers = ClassFileConstants.AccPrivate;
	decl.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;
	decl.returnType = TypeReference.baseTypeReference(TypeIds.T_void, 0);
	decl.statements = statements.toArray(new Statement[0]);
	decl.traverse(new SetGeneratedByVisitor(source), (ClassScope) null);
	return decl;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:22,代码来源:HandleBuilder.java


示例8: generateBuilderMethod

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
public MethodDeclaration generateBuilderMethod(boolean isStatic, String builderMethodName, String builderClassName, EclipseNode type, TypeParameter[] typeParams, ASTNode source) {
	int pS = source.sourceStart, pE = source.sourceEnd;
	long p = (long) pS << 32 | pE;
	
	MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult);
	out.selector = builderMethodName.toCharArray();
	out.modifiers = ClassFileConstants.AccPublic;
	if (isStatic) out.modifiers |= ClassFileConstants.AccStatic;
	out.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;
	out.returnType = namePlusTypeParamsToTypeReference(builderClassName.toCharArray(), typeParams, p);
	out.typeParameters = copyTypeParams(typeParams, source);
	AllocationExpression invoke = new AllocationExpression();
	invoke.type = namePlusTypeParamsToTypeReference(builderClassName.toCharArray(), typeParams, p);
	out.statements = new Statement[] {new ReturnStatement(invoke, pS, pE)};
	
	out.traverse(new SetGeneratedByVisitor(source), ((TypeDeclaration) type.get()).scope);
	return out;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:19,代码来源:HandleBuilder.java


示例9: makeSimpleSetterMethodForBuilder

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
private void makeSimpleSetterMethodForBuilder(EclipseNode builderType, EclipseNode fieldNode, EclipseNode sourceNode, boolean fluent, boolean chain) {
	TypeDeclaration td = (TypeDeclaration) builderType.get();
	AbstractMethodDeclaration[] existing = td.methods;
	if (existing == null) existing = EMPTY;
	int len = existing.length;
	FieldDeclaration fd = (FieldDeclaration) fieldNode.get();
	char[] name = fd.name;
	
	for (int i = 0; i < len; i++) {
		if (!(existing[i] instanceof MethodDeclaration)) continue;
		char[] existingName = existing[i].selector;
		if (Arrays.equals(name, existingName)) return;
	}
	
	String setterName = fluent ? fieldNode.getName() : HandlerUtil.buildAccessorName("set", fieldNode.getName());
	
	MethodDeclaration setter = HandleSetter.createSetter(td, fieldNode, setterName, chain, ClassFileConstants.AccPublic,
		sourceNode, Collections.<Annotation>emptyList(), Collections.<Annotation>emptyList());
	injectMethod(builderType, setter);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:21,代码来源:HandleBuilder.java


示例10: generateFields

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
@Override public List<EclipseNode> generateFields(SingularData data, EclipseNode builderType) {
	if (useGuavaInstead(builderType)) {
		return guavaListSetSingularizer.generateFields(data, builderType);
	}
	
	TypeReference type = new QualifiedTypeReference(JAVA_UTIL_ARRAYLIST, NULL_POSS);
	type = addTypeArgs(1, false, builderType, type, data.getTypeArgs());
	
	FieldDeclaration buildField = new FieldDeclaration(data.getPluralName(), 0, -1);
	buildField.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;
	buildField.modifiers = ClassFileConstants.AccPrivate;
	buildField.declarationSourceEnd = -1;
	buildField.type = type;
	data.setGeneratedByRecursive(buildField);
	return Collections.singletonList(injectFieldAndMarkGenerated(builderType, buildField));
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:17,代码来源:EclipseJavaUtilListSetSingularizer.java


示例11: generateClearMethod

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
private void generateClearMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType) {
	MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult);
	md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;
	md.modifiers = ClassFileConstants.AccPublic;
	
	FieldReference thisDotField = new FieldReference(data.getPluralName(), 0L);
	thisDotField.receiver = new ThisReference(0, 0);
	FieldReference thisDotField2 = new FieldReference(data.getPluralName(), 0L);
	thisDotField2.receiver = new ThisReference(0, 0);
	md.selector = HandlerUtil.buildAccessorName("clear", new String(data.getPluralName())).toCharArray();
	MessageSend clearMsg = new MessageSend();
	clearMsg.receiver = thisDotField2;
	clearMsg.selector = "clear".toCharArray();
	Statement clearStatement = new IfStatement(new EqualExpression(thisDotField, new NullLiteral(0, 0), OperatorIds.NOT_EQUAL), clearMsg, 0, 0);
	md.statements = returnStatement != null ? new Statement[] {clearStatement, returnStatement} : new Statement[] {clearStatement};
	md.returnType = returnType;
	injectMethod(builderType, md);
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:19,代码来源:EclipseJavaUtilListSetSingularizer.java


示例12: parse

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
@Nullable
private static Node parse(String code) {
  CompilerOptions options = new CompilerOptions();
  options.complianceLevel = options.sourceLevel = options.targetJDK = ClassFileConstants.JDK1_7;
  options.parseLiteralExpressionsAsConstants = true;
  ProblemReporter problemReporter = new ProblemReporter(
    DefaultErrorHandlingPolicies.exitOnFirstError(), options, new DefaultProblemFactory());
  Parser parser = new Parser(problemReporter, options.parseLiteralExpressionsAsConstants);
  parser.javadocParser.checkDocComment = false;
  EcjTreeConverter converter = new EcjTreeConverter();
  org.eclipse.jdt.internal.compiler.batch.CompilationUnit sourceUnit =
    new org.eclipse.jdt.internal.compiler.batch.CompilationUnit(code.toCharArray(), "unitTest", "UTF-8");
  CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 0);
  CompilationUnitDeclaration unit = parser.parse(sourceUnit, compilationResult);
  if (unit == null) {
    return null;
  }
  converter.visit(code, unit);
  List<? extends Node> nodes = converter.getAll();
  for (lombok.ast.Node node : nodes) {
    if (node instanceof lombok.ast.CompilationUnit) {
      return node;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:LombokPsiConverterTest.java


示例13: setFieldDefaultsForField

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
public void setFieldDefaultsForField(EclipseNode fieldNode, ASTNode pos, AccessLevel level, boolean makeFinal) {
	FieldDeclaration field = (FieldDeclaration) fieldNode.get();
	if (level != null && level != AccessLevel.NONE) {
		if ((field.modifiers & (ClassFileConstants.AccPublic | ClassFileConstants.AccPrivate | ClassFileConstants.AccProtected)) == 0) {
			if (!hasAnnotation(PackagePrivate.class, fieldNode)) {
				field.modifiers |= EclipseHandlerUtil.toEclipseModifier(level);
			}
		}
	}
	
	if (makeFinal && (field.modifiers & ClassFileConstants.AccFinal) == 0) {
		if (!hasAnnotation(NonFinal.class, fieldNode)) {
			field.modifiers |= ClassFileConstants.AccFinal;
		}
	}
	
	fieldNode.rebuild();
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:19,代码来源:HandleFieldDefaults.java


示例14: generateBuilderMethod

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
public MethodDeclaration generateBuilderMethod(String builderMethodName, String builderClassName, EclipseNode type, TypeParameter[] typeParams, ASTNode source) {
	int pS = source.sourceStart, pE = source.sourceEnd;
	long p = (long) pS << 32 | pE;
	
	MethodDeclaration out = new MethodDeclaration(
			((CompilationUnitDeclaration) type.top().get()).compilationResult);
	out.selector = builderMethodName.toCharArray();
	out.modifiers = ClassFileConstants.AccPublic | ClassFileConstants.AccStatic;
	out.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG;
	out.returnType = namePlusTypeParamsToTypeReference(builderClassName.toCharArray(), typeParams, p);
	out.typeParameters = copyTypeParams(typeParams, source);
	AllocationExpression invoke = new AllocationExpression();
	invoke.type = namePlusTypeParamsToTypeReference(builderClassName.toCharArray(), typeParams, p);
	out.statements = new Statement[] {new ReturnStatement(invoke, pS, pE)};
	
	out.traverse(new SetGeneratedByVisitor(source), ((TypeDeclaration) type.get()).scope);
	return out;
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:19,代码来源:HandleBuilder.java


示例15: makeSimpleSetterMethodForBuilder

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
private void makeSimpleSetterMethodForBuilder(EclipseNode builderType, EclipseNode fieldNode, EclipseNode sourceNode, boolean fluent, boolean chain) {
	TypeDeclaration td = (TypeDeclaration) builderType.get();
	AbstractMethodDeclaration[] existing = td.methods;
	if (existing == null) existing = EMPTY;
	int len = existing.length;
	FieldDeclaration fd = (FieldDeclaration) fieldNode.get();
	char[] name = fd.name;
	
	for (int i = 0; i < len; i++) {
		if (!(existing[i] instanceof MethodDeclaration)) continue;
		char[] existingName = existing[i].selector;
		if (Arrays.equals(name, existingName)) return;
	}
	
	String setterName = fluent ? fieldNode.getName() : HandlerUtil.buildAccessorName("set", fieldNode.getName());
	
	MethodDeclaration setter = HandleSetter.createSetter(td, fieldNode, setterName, chain, ClassFileConstants.AccPublic,
			sourceNode, Collections.<Annotation>emptyList(), Collections.<Annotation>emptyList());
	injectMethod(builderType, setter);
}
 
开发者ID:mobmead,项目名称:EasyMPermission,代码行数:21,代码来源:HandleBuilder.java


示例16: convert

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
private QualifiedAllocationExpression convert(
    IJavaElement localType, FieldDeclaration enumConstant, CompilationResult compilationResult)
    throws JavaModelException {
  TypeDeclaration anonymousLocalTypeDeclaration =
      convert((SourceType) localType, compilationResult);
  QualifiedAllocationExpression expression =
      new QualifiedAllocationExpression(anonymousLocalTypeDeclaration);
  expression.type = anonymousLocalTypeDeclaration.superclass;
  anonymousLocalTypeDeclaration.superclass = null;
  anonymousLocalTypeDeclaration.superInterfaces = null;
  anonymousLocalTypeDeclaration.allocation = expression;
  if (enumConstant != null) {
    anonymousLocalTypeDeclaration.modifiers &= ~ClassFileConstants.AccEnum;
    expression.enumConstant = enumConstant;
    expression.type = null;
  }
  return expression;
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:SourceTypeConverter.java


示例17: parse

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
Javadoc parse(String rawInput, int from, int to) {
	char[] rawContent;
	
	rawContent = new char[to + GENERIC_JAVA_CLASS_SUFFIX.length];
	Arrays.fill(rawContent, 0, from, ' ');
	System.arraycopy(rawInput.substring(from, to).toCharArray(), 0, rawContent, from, to - from);
	// Eclipse crashes if there's no character following the javadoc.
	System.arraycopy(GENERIC_JAVA_CLASS_SUFFIX, 0, rawContent, to, GENERIC_JAVA_CLASS_SUFFIX.length);
	
	this.sourceLevel = ClassFileConstants.JDK1_6;
	this.scanner.setSource(rawContent);
	this.source = rawContent;
	this.javadocStart = from;
	this.javadocEnd = to;
	this.reportProblems = true;
	this.docComment = new Javadoc(this.javadocStart, this.javadocEnd);
	commentParse();
	this.docComment.valuePositions = -1;
	this.docComment.sourceEnd--;
	return docComment;
}
 
开发者ID:evant,项目名称:android-retrolambda-lombok,代码行数:22,代码来源:EcjTreeBuilder.java


示例18: completionOnMethodName

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
private void completionOnMethodName(ASTNode astNode, Scope scope) {
	if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) {
		CompletionOnMethodName method = (CompletionOnMethodName) astNode;

		setSourceAndTokenRange(method.sourceStart, method.selectorEnd);

		FieldBinding[] fields = scope.enclosingSourceType().fields();
		char[][] excludeNames = new char[fields.length][];
		for(int i = 0 ; i < fields.length ; i++){
			excludeNames[i] = fields[i].name;
		}

		this.completionToken = method.selector;

		
		int kind =
			 (method.modifiers & ClassFileConstants.AccStatic) == 0 ? 
					InternalNamingConventions.VK_INSTANCE_FIELD :
						(method.modifiers & ClassFileConstants.AccFinal) == 0 ? 
								InternalNamingConventions.VK_STATIC_FIELD :
									InternalNamingConventions.VK_STATIC_FINAL_FIELD;
					
		findVariableNames(this.completionToken, method.returnType, excludeNames, null, kind);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:26,代码来源:CompletionEngine.java


示例19: consumeMethodHeaderDefaultValue

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
protected void consumeMethodHeaderDefaultValue() {
	// MethodHeaderDefaultValue ::= DefaultValue
	MethodDeclaration md = (MethodDeclaration) this.astStack[this.astPtr];


	int length = this.expressionLengthStack[this.expressionLengthPtr--];
	if (length == 1) {
		this.intPtr--; // we get rid of the position of the default keyword
		this.intPtr--; // we get rid of the position of the default keyword
		if(md.isAnnotationMethod()) {
			((AnnotationMethodDeclaration)md).defaultValue = this.expressionStack[this.expressionPtr];
			md.modifiers |=  ClassFileConstants.AccAnnotationDefault;
		}
		this.expressionPtr--;
		this.recordStringLiterals = true;
	}

	if(this.currentElement != null) {
		if(md.isAnnotationMethod()) {
			this.currentElement.updateSourceEndIfNecessary(((AnnotationMethodDeclaration)md).defaultValue.sourceEnd);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:Parser.java


示例20: completionOnFieldName

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入依赖的package包/类
private void completionOnFieldName(ASTNode astNode, Scope scope) {
	if (!this.requestor.isIgnored(CompletionProposal.VARIABLE_DECLARATION)) {
		CompletionOnFieldName field = (CompletionOnFieldName) astNode;

		FieldBinding[] fields = scope.enclosingSourceType().fields();
		char[][] excludeNames = new char[fields.length][];
		for(int i = 0 ; i < fields.length ; i++){
			excludeNames[i] = fields[i].name;
		}

		this.completionToken = field.realName;

		
		int kind =
			 (field.modifiers & ClassFileConstants.AccStatic) == 0 ? 
					InternalNamingConventions.VK_INSTANCE_FIELD :
						(field.modifiers & ClassFileConstants.AccFinal) == 0 ? 
								InternalNamingConventions.VK_STATIC_FIELD :
									InternalNamingConventions.VK_STATIC_FINAL_FIELD;
		
		findVariableNames(field.realName, field.type, excludeNames, null, kind);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:CompletionEngine.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MatchFields类代码示例发布时间:2022-05-22
下一篇:
Java WebLink类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap