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


Java ObjectType.getOwnPropertyNames方法代码示例

本文整理汇总了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;
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:26,代码来源:NameReferenceGraphConstruction.java

示例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;
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:17,代码来源:ConcreteTypeTest.java

示例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;
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:16,代码来源:TightenTypes.java


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