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


Java ClassFileConstants.AccDeprecated方法代码示例

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


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

示例1: getAnnotationTagBits

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * Compute the tagbits for standard annotations. For source types, these could require
 * lazily resolving corresponding annotation nodes, in case of forward references.
 * For type use bindings, this method still returns the tagbits corresponding to the type 
 * declaration binding.
 * @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits()
 */
public long getAnnotationTagBits() {
	if (!isPrototype())
		return this.prototype.getAnnotationTagBits();
	
	if ((this.tagBits & TagBits.AnnotationResolved) == 0 && this.scope != null) {
		TypeDeclaration typeDecl = this.scope.referenceContext;
		boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation;
		try {
			typeDecl.staticInitializerScope.insideTypeAnnotation = true;
			ASTNode.resolveAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
		} finally {
			typeDecl.staticInitializerScope.insideTypeAnnotation = old;
		}
		if ((this.tagBits & TagBits.AnnotationDeprecated) != 0)
			this.modifiers |= ClassFileConstants.AccDeprecated;
		evaluateNullAnnotations(this.tagBits);
	}
	return this.tagBits;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:SourceTypeBinding.java

示例2: initializeDeprecatedAnnotationTagBits

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * @see org.eclipse.jdt.internal.compiler.lookup.Binding#initializeDeprecatedAnnotationTagBits()
 */
public void initializeDeprecatedAnnotationTagBits() {
	if (!isPrototype()) {
		this.prototype.initializeDeprecatedAnnotationTagBits();
		return;
	}
	if ((this.tagBits & TagBits.DeprecatedAnnotationResolved) == 0) {
		TypeDeclaration typeDecl = this.scope.referenceContext;
		boolean old = typeDecl.staticInitializerScope.insideTypeAnnotation;
		try {
			typeDecl.staticInitializerScope.insideTypeAnnotation = true;
			ASTNode.resolveDeprecatedAnnotations(typeDecl.staticInitializerScope, typeDecl.annotations, this);
			this.tagBits |= TagBits.DeprecatedAnnotationResolved;
		} finally {
			typeDecl.staticInitializerScope.insideTypeAnnotation = old;
		}
		if ((this.tagBits & TagBits.AnnotationDeprecated) != 0) {
			this.modifiers |= ClassFileConstants.AccDeprecated;
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:SourceTypeBinding.java

示例3: isFieldDeprecated

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public static boolean isFieldDeprecated(EclipseNode fieldNode) {
	FieldDeclaration field = (FieldDeclaration) fieldNode.get();
	if ((field.modifiers & ClassFileConstants.AccDeprecated) != 0) {
		return true;
	}
	if (field.annotations == null) return false;
	for (Annotation annotation : field.annotations) {
		if (typeMatches(Deprecated.class, fieldNode, annotation.type)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:14,代码来源:EclipseHandlerUtil.java

示例4: setFlags

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * @see IDOMMember#setFlags(int)
 */
public void setFlags(int flags) {
	becomeDetailed();
	if (Flags.isDeprecated(this.fFlags)) {
		this.fFlags= flags | ClassFileConstants.AccDeprecated;
	} else {
		this.fFlags= flags & (~ClassFileConstants.AccDeprecated);
	}
	fragment();
	this.fModifiers= generateFlags();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:14,代码来源:DOMMember.java

示例5: setComment

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * @see IDOMMember#setComment(String)
 */
public void setComment(String comment) {
	becomeDetailed();
	this.fComment= comment;
	fragment();
	setHasComment(comment != null);
	/* see 1FVIJAH */
	if (comment != null && comment.indexOf("@deprecated") >= 0) { //$NON-NLS-1$
		this.fFlags= this.fFlags | ClassFileConstants.AccDeprecated;
		return;
	}
	this.fFlags= this.fFlags & (~ClassFileConstants.AccDeprecated);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:DOMMember.java

示例6: isMethodUseDeprecated

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public final boolean isMethodUseDeprecated(MethodBinding method, Scope scope,
		boolean isExplicitUse) {
	// ignore references insing Javadoc comments
	if ((this.bits & ASTNode.InsideJavadoc) == 0 && method.isOrEnclosedByPrivateType() && !scope.isDefinedInMethod(method)) {
		// ignore cases where method is used from inside itself (e.g. direct recursions)
		method.original().modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
	}

	// TODO (maxime) consider separating concerns between deprecation and access restriction.
	// 				 Caveat: this was not the case when access restriction funtion was added.
	if (isExplicitUse && (method.modifiers & ExtraCompilerModifiers.AccRestrictedAccess) != 0) {
		// note: explicit constructors calls warnings are kept despite the 'new C1()' case (two
		//       warnings, one on type, the other on constructor), because of the 'super()' case.
		AccessRestriction restriction =
			scope.environment().getAccessRestriction(method.declaringClass.erasure());
		if (restriction != null) {
			scope.problemReporter().forbiddenReference(method, this,
					restriction.classpathEntryType, restriction.classpathEntryName,
					restriction.getProblemId());
		}
	}

	if (!method.isViewedAsDeprecated()) return false;

	// inside same unit - no report
	if (scope.isDefinedInSameUnit(method.declaringClass)) return false;

	// non explicit use and non explicitly deprecated - no report
	if (!isExplicitUse &&
			(method.modifiers & ClassFileConstants.AccDeprecated) == 0) {
		return false;
	}

	// if context is deprecated, may avoid reporting
	if (!scope.compilerOptions().reportDeprecationInsideDeprecatedCode && scope.isInsideDeprecatedCode()) return false;
	return true;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:38,代码来源:ASTNode.java

示例7: resolve

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public void resolve(ClassScope upperScope) {

		if (this.binding == null) {
			this.ignoreFurtherInvestigation = true;
		}

		try {
			bindArguments();
			resolveReceiver();
			bindThrownExceptions();
			resolveJavadoc();
			resolveAnnotations(this.scope, this.annotations, this.binding);
			
			long sourceLevel = this.scope.compilerOptions().sourceLevel;
			validateNullAnnotations(sourceLevel);

			resolveStatements();
			// check @Deprecated annotation presence
			if (this.binding != null
					&& (this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
					&& (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
					&& sourceLevel >= ClassFileConstants.JDK1_5) {
				this.scope.problemReporter().missingDeprecatedAnnotationForMethod(this);
			}
		} catch (AbortMethod e) {
			// ========= abort on fatal error =============
			this.ignoreFurtherInvestigation = true;
		}
	}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:AbstractMethodDeclaration.java

示例8: acceptType

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * One result of the search consists of a new type.
 *
 * NOTE - All package and type names are presented in their readable form:
 *    Package names are in the form "a.b.c".
 *    Nested type names are in the qualified form "A.I".
 *    The default package is represented by an empty array.
 */
public void acceptType(
	char[] packageName,
	char[] simpleTypeName,
	char[][] enclosingTypeNames,
	int modifiers,
	AccessRestriction accessRestriction) {
	
	// does not check cancellation for every types to avoid performance loss
	if ((this.foundTypesCount % CHECK_CANCEL_FREQUENCY) == 0) checkCancel();
	this.foundTypesCount++;
	
	if (this.options.checkDeprecation && (modifiers & ClassFileConstants.AccDeprecated) != 0) return;
	if (this.assistNodeIsExtendedType && (modifiers & ClassFileConstants.AccFinal) != 0) return;

	if (this.options.checkVisibility) {
		if((modifiers & ClassFileConstants.AccPublic) == 0) {
			if((modifiers & ClassFileConstants.AccPrivate) != 0) return;

			char[] currentPackage = CharOperation.concatWith(this.unitScope.fPackage.compoundName, '.');
			if(!CharOperation.equals(packageName, currentPackage)) return;
		}
	}

	int accessibility = IAccessRule.K_ACCESSIBLE;
	if(accessRestriction != null) {
		switch (accessRestriction.getProblemId()) {
			case IProblem.ForbiddenReference:
				if (this.options.checkForbiddenReference) {
					return;
				}
				accessibility = IAccessRule.K_NON_ACCESSIBLE;
				break;
			case IProblem.DiscouragedReference:
				if (this.options.checkDiscouragedReference) {
					return;
				}
				accessibility = IAccessRule.K_DISCOURAGED;
				break;
		}
	}
	
	if (isForbidden(packageName, simpleTypeName, enclosingTypeNames)) {
		return;
	}

	if(this.acceptedTypes == null) {
		this.acceptedTypes = new ObjectVector();
	}
	this.acceptedTypes.add(new AcceptedType(packageName, simpleTypeName, enclosingTypeNames, modifiers, accessibility));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:59,代码来源:CompletionEngine.java

示例9: consumeCatchFormalParameter

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected void consumeCatchFormalParameter() {
	if (this.indexOfAssistIdentifier() < 0) {
		super.consumeCatchFormalParameter();
		if (this.pendingAnnotation != null) {
			this.pendingAnnotation.potentialAnnotatedNode = this.astStack[this.astPtr];
			this.pendingAnnotation = null;
		}
	} else {
		this.identifierLengthPtr--;
		char[] identifierName = this.identifierStack[this.identifierPtr];
		long namePositions = this.identifierPositionStack[this.identifierPtr--];
		this.intPtr--; // dimension from the variabledeclaratorid
		TypeReference type = (TypeReference) this.astStack[this.astPtr--];
		this.intPtr -= 2;
		CompletionOnArgumentName arg =
			new CompletionOnArgumentName(
				identifierName,
				namePositions,
				type,
				this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers
		arg.bits &= ~ASTNode.IsArgument;
		// consume annotations
		int length;
		if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
			System.arraycopy(
				this.expressionStack,
				(this.expressionPtr -= length) + 1,
				arg.annotations = new Annotation[length],
				0,
				length);
		}

		arg.isCatchArgument = topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BETWEEN_CATCH_AND_RIGHT_PAREN;
		pushOnAstStack(arg);

		this.assistNode = arg;
		this.lastCheckPoint = (int) namePositions;
		this.isOrphanCompletionNode = true;

		/* if incomplete method header, listLength counter will not have been reset,
			indicating that some arguments are available on the stack */
		this.listLength++;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:45,代码来源:CompletionParser.java

示例10: isDeprecated

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * Answer true if the receiver is a deprecated type
 */
public final boolean isDeprecated() {
	return (this.modifiers & ClassFileConstants.AccDeprecated) != 0;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:ReferenceBinding.java

示例11: isViewedAsDeprecated

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
/**
 * Answer true if the receiver is deprecated (or any of its enclosing types)
 */
public final boolean isViewedAsDeprecated() {
	return (this.modifiers & (ClassFileConstants.AccDeprecated | ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0
			|| getPackage().isViewedAsDeprecated();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:ReferenceBinding.java

示例12: isViewedAsDeprecated

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public final boolean isViewedAsDeprecated() {
	return (this.modifiers & (ClassFileConstants.AccDeprecated | ExtraCompilerModifiers.AccDeprecatedImplicitly)) != 0;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:4,代码来源:FieldBinding.java

示例13: isDeprecated

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public final boolean isDeprecated() {
	return (this.modifiers & ClassFileConstants.AccDeprecated) != 0;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:4,代码来源:MethodBinding.java

示例14: acceptConstructor

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
public void acceptConstructor(
		int modifiers,
		char[] simpleTypeName,
		int parameterCount,
		char[] signature,
		char[][] parameterTypes,
		char[][] parameterNames,
		int typeModifiers,
		char[] packageName,
		int extraFlags,
		String path,
		AccessRestriction accessRestriction) {
	
	// does not check cancellation for every types to avoid performance loss
	if ((this.foundConstructorsCount % (CHECK_CANCEL_FREQUENCY)) == 0) checkCancel();
	this.foundConstructorsCount++;
	
	if ((typeModifiers & ClassFileConstants.AccEnum) != 0) return;
	
	if (this.options.checkDeprecation && (typeModifiers & ClassFileConstants.AccDeprecated) != 0) return;

	if (this.options.checkVisibility) {
		if((typeModifiers & ClassFileConstants.AccPublic) == 0) {
			if((typeModifiers & ClassFileConstants.AccPrivate) != 0) return;

			if (this.currentPackageName == null) {
				initializePackageCache();
			}
			
			if(!CharOperation.equals(packageName, this.currentPackageName)) return;
		}
	}

	int accessibility = IAccessRule.K_ACCESSIBLE;
	if(accessRestriction != null) {
		switch (accessRestriction.getProblemId()) {
			case IProblem.ForbiddenReference:
				if (this.options.checkForbiddenReference) {
					return;
				}
				accessibility = IAccessRule.K_NON_ACCESSIBLE;
				break;
			case IProblem.DiscouragedReference:
				if (this.options.checkDiscouragedReference) {
					return;
				}
				accessibility = IAccessRule.K_DISCOURAGED;
				break;
		}
	}
	
	if(this.acceptedConstructors == null) {
		this.acceptedConstructors = new ObjectVector();
	}
	this.acceptedConstructors.add(
			new AcceptedConstructor(
					modifiers,
					simpleTypeName,
					parameterCount,
					signature,
					parameterTypes,
					parameterNames,
					typeModifiers,
					packageName,
					extraFlags,
					accessibility));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:68,代码来源:CompletionEngine.java

示例15: consumeFormalParameter

import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; //导入方法依赖的package包/类
protected void consumeFormalParameter(boolean isVarArgs) {
	if (this.indexOfAssistIdentifier() < 0) {
		super.consumeFormalParameter(isVarArgs);
		if (this.pendingAnnotation != null) {
			this.pendingAnnotation.potentialAnnotatedNode = this.astStack[this.astPtr];
			this.pendingAnnotation = null;
		}
	} else {

		this.identifierLengthPtr--;
		char[] identifierName = this.identifierStack[this.identifierPtr];
		long namePositions = this.identifierPositionStack[this.identifierPtr--];
		int extendedDimensions = this.intStack[this.intPtr--];
		int endOfEllipsis = 0;
		if (isVarArgs) {
			endOfEllipsis = this.intStack[this.intPtr--];
		}
		int firstDimensions = this.intStack[this.intPtr--];
		final int typeDimensions = firstDimensions + extendedDimensions;
		TypeReference type = getTypeReference(typeDimensions);
		if (isVarArgs) {
			type = copyDims(type, typeDimensions + 1);
			if (extendedDimensions == 0) {
				type.sourceEnd = endOfEllipsis;
			}
			type.bits |= ASTNode.IsVarArgs; // set isVarArgs
		}
		this.intPtr -= 2;
		CompletionOnArgumentName arg =
			new CompletionOnArgumentName(
				identifierName,
				namePositions,
				type,
				this.intStack[this.intPtr + 1] & ~ClassFileConstants.AccDeprecated); // modifiers
		// consume annotations
		int length;
		if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
			System.arraycopy(
				this.expressionStack,
				(this.expressionPtr -= length) + 1,
				arg.annotations = new Annotation[length],
				0,
				length);
			RecoveredType currentRecoveryType = this.currentRecoveryType();
			if (currentRecoveryType != null)
				currentRecoveryType.annotationsConsumed(arg.annotations);
		}

		arg.isCatchArgument = topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_BETWEEN_CATCH_AND_RIGHT_PAREN;
		pushOnAstStack(arg);

		this.assistNode = arg;
		this.lastCheckPoint = (int) namePositions;
		this.isOrphanCompletionNode = true;

		/* if incomplete method header, listLength counter will not have been reset,
			indicating that some arguments are available on the stack */
		this.listLength++;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:61,代码来源:CompletionParser.java


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