本文整理汇总了Java中com.google.javascript.rhino.jstype.ObjectType.getOwnPropertyNames方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectType.getOwnPropertyNames方法的具体用法?Java ObjectType.getOwnPropertyNames怎么用?Java ObjectType.getOwnPropertyNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.javascript.rhino.jstype.ObjectType
的用法示例。
在下文中一共展示了ObjectType.getOwnPropertyNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: recordClassConstructorOrInterface
import com.google.javascript.rhino.jstype.ObjectType; //导入方法依赖的package包/类
/**
* Creates the name in the graph if it does not already exist. Also puts all
* the properties and prototype properties of this name in the graph.
*/
private Name recordClassConstructorOrInterface(
String name, FunctionType type, @Nullable Node n, @Nullable Node parent,
@Nullable Node gParent, @Nullable Node rhs) {
Preconditions.checkArgument(type.isConstructor() || type.isInterface());
Name symbol = graph.defineNameIfNotExists(name, isExtern);
if (rhs != null) {
// TODO(user): record the definition.
symbol.setType(getType(rhs));
if (NodeUtil.isAssign(n)) {
symbol.addAssignmentDeclaration(n);
} else {
symbol.addFunctionDeclaration(n);
}
}
ObjectType prototype = type.getPrototype();
for (String prop : prototype.getOwnPropertyNames()) {
graph.defineNameIfNotExists(
name + ".prototype." + prop, isExtern);
}
return symbol;
}
示例2: createInstanceScope
import com.google.javascript.rhino.jstype.ObjectType; //导入方法依赖的package包/类
/** @inheritDoc */
public StaticScope<ConcreteType> createInstanceScope(
ObjectType instanceType) {
FakeScope parentScope = null;
if (instanceType.getImplicitPrototype() != null) {
ConcreteInstanceType prototype =
createConcreteInstance(instanceType.getImplicitPrototype());
parentScope = (FakeScope) prototype.getScope();
}
FakeScope scope = new FakeScope(parentScope);
for (String propName : instanceType.getOwnPropertyNames()) {
scope.addSlot(propName);
}
return scope;
}
示例3: createInstanceScope
import com.google.javascript.rhino.jstype.ObjectType; //导入方法依赖的package包/类
@Override
public StaticScope<ConcreteType> createInstanceScope(
ObjectType instanceType) {
ConcreteScope parentScope = null;
if (instanceType.getImplicitPrototype() != null) {
ConcreteInstanceType prototype =
createConcreteInstance(instanceType.getImplicitPrototype());
parentScope = (ConcreteScope) prototype.getScope();
}
ConcreteScope scope = new ConcreteScope(parentScope);
for (String propName : instanceType.getOwnPropertyNames()) {
scope.declareSlot(propName, null);
}
return scope;
}