本文整理匯總了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;
}
示例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;
}