本文整理汇总了Java中com.google.javascript.rhino.jstype.ObjectType.isNativeObjectType方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectType.isNativeObjectType方法的具体用法?Java ObjectType.isNativeObjectType怎么用?Java ObjectType.isNativeObjectType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.javascript.rhino.jstype.ObjectType
的用法示例。
在下文中一共展示了ObjectType.isNativeObjectType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachJSDocInfoToNominalTypeOrShape
import com.google.javascript.rhino.jstype.ObjectType; //导入方法依赖的package包/类
/**
* Handle cases #1 and #3 in the class doc.
*/
private void attachJSDocInfoToNominalTypeOrShape(
ObjectType objType, JSDocInfo docInfo, @Nullable String qName) {
if (objType.isConstructor() ||
objType.isEnumType() ||
objType.isInterface()) {
// Named types.
if (objType.hasReferenceName() &&
objType.getReferenceName().equals(qName)) {
objType.setJSDocInfo(docInfo);
if (objType.isConstructor() || objType.isInterface()) {
((FunctionType) objType).getInstanceType().setJSDocInfo(
docInfo);
} else if (objType instanceof EnumType) {
((EnumType) objType).getElementsType().setJSDocInfo(docInfo);
}
}
} else if (!objType.isNativeObjectType() &&
objType.isFunctionType()) {
// Structural functions.
objType.setJSDocInfo(docInfo);
}
}
示例2: ensurePropertyDeclaredHelper
import com.google.javascript.rhino.jstype.ObjectType; //导入方法依赖的package包/类
/**
* Declares a property on its owner, if necessary.
* @return True if a property was declared.
*/
private boolean ensurePropertyDeclaredHelper(
Node getprop, ObjectType objectType) {
String propName = getprop.getLastChild().getString();
String qName = getprop.getQualifiedName();
if (qName != null) {
Var var = syntacticScope.getVar(qName);
if (var != null && !var.isTypeInferred()) {
// Handle normal declarations that could not be addressed earlier.
if (propName.equals("prototype") ||
// Handle prototype declarations that could not be addressed earlier.
(!objectType.hasOwnProperty(propName) &&
(!objectType.isInstanceType() ||
(var.isExtern() && !objectType.isNativeObjectType())))) {
return objectType.defineDeclaredProperty(
propName, var.getType(), var.isExtern());
}
}
}
return false;
}