當前位置: 首頁>>代碼示例>>Java>>正文


Java ITypeBinding.isClass方法代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.dom.ITypeBinding.isClass方法的典型用法代碼示例。如果您正苦於以下問題:Java ITypeBinding.isClass方法的具體用法?Java ITypeBinding.isClass怎麽用?Java ITypeBinding.isClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jdt.core.dom.ITypeBinding的用法示例。


在下文中一共展示了ITypeBinding.isClass方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getUnboxedTypeBinding

import org.eclipse.jdt.core.dom.ITypeBinding; //導入方法依賴的package包/類
/**
 * Returns the unboxed type binding according to JLS3 5.1.7, or the original binding if
 * the given type is not a boxed type.
 *
 * @param type a type binding
 * @param ast an AST to resolve the unboxed type
 * @return the unboxed type, or the original type if no unboxed type found
 */
public static ITypeBinding getUnboxedTypeBinding(ITypeBinding type, AST ast) {
	if (!type.isClass()) {
		return type;
	}
	String unboxedTypeName= getUnboxedTypeName(type.getQualifiedName());
	if (unboxedTypeName == null) {
		return type;
	}
	ITypeBinding unboxed= ast.resolveWellKnownType(unboxedTypeName);
	if (unboxed == null) {
		return type;
	}
	return unboxed;
}
 
開發者ID:eclipse,項目名稱:eclipse.jdt.ls,代碼行數:23,代碼來源:Bindings.java

示例2: isContainerType

import org.eclipse.jdt.core.dom.ITypeBinding; //導入方法依賴的package包/類
public boolean isContainerType(String fullyQualifiedName) {
	boolean containerType = false;
	String containerofType = getRawTypeName(fullyQualifiedName);

	model = m.getModel();
	Set<String> containerList = model.getContainerTypes();

	// Check if ArrayList and other containers are containers of TYPE(CLASS)
	if (containerList.contains(containerofType)) {
		ITypeBinding typeBinding = getTypeBinding(fullyQualifiedName);
		if (typeBinding != null) {
			ITypeBinding[] typeArguments = typeBinding.getTypeArguments();

			if (typeArguments != null) {
				for (int ii = 0; ii < typeArguments.length; ii++) {
					ITypeBinding typeArgument = typeArguments[ii];
					if (typeArgument != null && typeArgument.isClass()) {
						containerType = true;
						break;
					}
				}
			}
		}
	}

	return containerType;
}
 
開發者ID:aroog,項目名稱:code,代碼行數:28,代碼來源:QualUtils.java


注:本文中的org.eclipse.jdt.core.dom.ITypeBinding.isClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。