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


Java JavaModelUtil.isInterfaceOrAnnotation方法代码示例

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


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

示例1: adjustOutgoingVisibility

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
/**
 * Adjusts the visibility of the referenced body declaration.
 *
 * @param member the member where to adjust the visibility
 * @param threshold the visibility keyword representing the required visibility, or <code>null</code> for default visibility
 * @param template the message template to use
 * @throws JavaModelException if an error occurs
 */
private void adjustOutgoingVisibility(final IMember member, final ModifierKeyword threshold, final String template) throws JavaModelException {
	Assert.isTrue(!member.isBinary() && !member.isReadOnly());
	boolean adjust= true;
	final IType declaring= member.getDeclaringType();
	if (declaring != null && (JavaModelUtil.isInterfaceOrAnnotation(declaring)
			|| (member instanceof IField) && Flags.isEnum(member.getFlags()) 
			|| declaring.equals(fReferenced)))
		adjust= false;
	if (adjust && hasLowerVisibility(member.getFlags(), keywordToVisibility(threshold)) && needsVisibilityAdjustment(member, threshold))
		fAdjustments.put(member, new OutgoingMemberVisibilityAdjustment(member, threshold, RefactoringStatus.createStatus(fVisibilitySeverity, Messages.format(template, new String[] { JavaElementLabels.getTextLabel(member, JavaElementLabels.M_PARAMETER_TYPES | JavaElementLabels.ALL_FULLY_QUALIFIED), getLabel(threshold)}), JavaStatusContext.create(member), null, RefactoringStatusEntry.NO_CODE, null)));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:MemberVisibilityAdjustor.java

示例2: getAllConstructors

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
public static IMethod[] getAllConstructors(IType type) throws JavaModelException {
	if (JavaModelUtil.isInterfaceOrAnnotation(type))
		return new IMethod[0];
	List<IMethod> result= new ArrayList<IMethod>();
	IMethod[] methods= type.getMethods();
	for (int i= 0; i < methods.length; i++) {
		IMethod iMethod= methods[i];
		if (iMethod.isConstructor())
			result.add(iMethod);
	}
	return result.toArray(new IMethod[result.size()]);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:JavaElementUtil.java

示例3: confirmAbstract

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private static boolean confirmAbstract(IMember element) throws JavaModelException {
	// never show the abstract symbol on interfaces
	if (element.getElementType() == IJavaElement.TYPE) {
		return ! JavaModelUtil.isInterfaceOrAnnotation((IType) element);
	}
	return true;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:JavaElementImageProvider.java

示例4: isInterfaceOrAnnotationField

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private static boolean isInterfaceOrAnnotationField(IMember element) throws JavaModelException {
	// always show the final symbol on interface fields
	if (element.getElementType() == IJavaElement.FIELD) {
		return JavaModelUtil.isInterfaceOrAnnotation(element.getDeclaringType());
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:JavaElementImageProvider.java

示例5: isInterfaceOrAnnotationFieldOrType

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private static boolean isInterfaceOrAnnotationFieldOrType(IMember element) throws JavaModelException {
	// always show the static symbol on interface fields and types
	if (element.getElementType() == IJavaElement.FIELD) {
		return JavaModelUtil.isInterfaceOrAnnotation(element.getDeclaringType());
	} else if (element.getElementType() == IJavaElement.TYPE && element.getDeclaringType() != null) {
		return JavaModelUtil.isInterfaceOrAnnotation(element.getDeclaringType());
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:JavaElementImageProvider.java

示例6: confirmAbstract

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private static boolean confirmAbstract(IMember element) throws JavaModelException {
	// never show the abstract symbol on interfaces or members in interfaces
	if (element.getElementType() == IJavaElement.TYPE) {
		return ! JavaModelUtil.isInterfaceOrAnnotation((IType) element);
	}
	return ! JavaModelUtil.isInterfaceOrAnnotation(element.getDeclaringType());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:8,代码来源:JavaElementImageProvider.java

示例7: isInstanceField

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private static boolean isInstanceField(IField field) throws CoreException{
	if (JavaModelUtil.isInterfaceOrAnnotation(field.getDeclaringType()))
		return false;
	else
		return ! JdtFlags.isStatic(field);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:RenameFieldProcessor.java

示例8: isMemberInInterfaceOrAnnotation

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private boolean isMemberInInterfaceOrAnnotation(IMember member) throws JavaModelException {
	IType parent= member.getDeclaringType();
	return parent != null && JavaModelUtil.isInterfaceOrAnnotation(parent);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:MemberFilter.java

示例9: isFieldInInterfaceOrAnnotation

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private boolean isFieldInInterfaceOrAnnotation(IMember member) throws JavaModelException {
	return (member.getElementType() == IJavaElement.FIELD) && JavaModelUtil.isInterfaceOrAnnotation(member.getDeclaringType());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:MemberFilter.java


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