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


Java TypeIds.T_ConfiguredAnnotationNonNullByDefault方法代码示例

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


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

示例1: excludeDueToAnnotation

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
 * Returns true if a private member should not be warned as unused if
 * annotated with a non-standard annotation.
 * https://bugs.eclipse.org/365437
 * https://bugs.eclipse.org/376590
 */
private boolean excludeDueToAnnotation(Annotation[] annotations, int problemId) {
	int annotationsLen = 0;
	if (annotations != null) {
		annotationsLen = annotations.length;
	} else {
		return false;
	}
	if (annotationsLen == 0) return false;
	for (int i = 0; i < annotationsLen; i++) {
		TypeBinding resolvedType = annotations[i].resolvedType;
		if (resolvedType != null) {
			switch (resolvedType.id) {
				case TypeIds.T_JavaLangSuppressWarnings:
				case TypeIds.T_JavaLangDeprecated:
				case TypeIds.T_JavaLangSafeVarargs:
				case TypeIds.T_ConfiguredAnnotationNonNull:
				case TypeIds.T_ConfiguredAnnotationNullable:
				case TypeIds.T_ConfiguredAnnotationNonNullByDefault:
					break;
				case TypeIds.T_JavaxInjectInject:
				case TypeIds.T_ComGoogleInjectInject:
					if (problemId != IProblem.UnusedPrivateField)
						return true; // @Inject on method/ctor does constitute a relevant use, just on fields it doesn't
					break;
				default:
					// non-standard annotation found, don't warn
					return true;
			}
		}
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:39,代码来源:ProblemReporter.java

示例2: excludeDueToAnnotation

import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
 * Returns true if a private member should not be warned as unused if
 * annotated with a non-standard annotation.
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=365437
 */
private boolean excludeDueToAnnotation(Annotation[] annotations) {
	int annotationsLen = 0;
	if (annotations != null) {
		annotationsLen = annotations.length;
	} else {
		return false;
	}
	if (annotationsLen == 0) return false;
	for (int i = 0; i < annotationsLen; i++) {
		TypeBinding resolvedType = annotations[i].resolvedType;
		if (resolvedType != null) {
			switch (resolvedType.id) {
				case TypeIds.T_JavaLangSuppressWarnings:
				case TypeIds.T_JavaLangDeprecated:
				case TypeIds.T_JavaLangSafeVarargs:
				case TypeIds.T_ConfiguredAnnotationNonNull:
				case TypeIds.T_ConfiguredAnnotationNullable:
				case TypeIds.T_ConfiguredAnnotationNonNullByDefault:
					break;
				default:
					// non-standard annotation found, don't warn
					return true;
			}
		}
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:33,代码来源:ProblemReporter.java


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