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


Java EnumElementType类代码示例

本文整理汇总了Java中com.google.javascript.rhino.jstype.EnumElementType的典型用法代码示例。如果您正苦于以下问题:Java EnumElementType类的具体用法?Java EnumElementType怎么用?Java EnumElementType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EnumElementType类属于com.google.javascript.rhino.jstype包,在下文中一共展示了EnumElementType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: caseEnumElementType

import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
public JSType caseEnumElementType(EnumElementType enumElementType) {
  // NOTE(nicksantos): This is a white lie. Suppose we have:
  // /** @enum {string|number} */ var MyEnum = ...;
  // if (goog.isNumber(myEnumInstance)) {
  //   /* what is myEnumInstance here? */
  // }
  // There is no type that represents {MyEnum - string}. What we really
  // need is a notion of "enum subtyping", so that we could dynamically
  // create a subtype of MyEnum restricted by string. In any case,
  // this should catch the common case.
  JSType type = enumElementType.getPrimitiveType().visit(this);
  if (type != null && enumElementType.getPrimitiveType().equals(type)) {
    return enumElementType;
  } else {
    return type;
  }
}
 
开发者ID:andyjko,项目名称:feedlack,代码行数:18,代码来源:ChainableReverseAbstractInterpreter.java

示例2: caseEnumElementType

import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
@Override
public JSType caseEnumElementType(EnumElementType enumElementType) {
  // NOTE(nicksantos): This is a white lie. Suppose we have:
  // /** @enum {string|number} */ var MyEnum = ...;
  // if (goog.isNumber(myEnumInstance)) {
  //   /* what is myEnumInstance here? */
  // }
  // There is no type that represents {MyEnum - string}. What we really
  // need is a notion of "enum subtyping", so that we could dynamically
  // create a subtype of MyEnum restricted by string. In any case,
  // this should catch the common case.
  JSType type = enumElementType.getPrimitiveType().visit(this);
  if (type != null &&
      enumElementType.getPrimitiveType().isEquivalentTo(type)) {
    return enumElementType;
  } else {
    return type;
  }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:20,代码来源:ChainableReverseAbstractInterpreter.java

示例3: caseEnumElementType

import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
public Set<String> caseEnumElementType(EnumElementType type) {
  // Descend into the enum's element type.
  // @enum {T}
  visitOnce(type.getPrimitiveType());

  return externProperties;
}
 
开发者ID:nicks,项目名称:closure-compiler-old,代码行数:8,代码来源:GatherExternProperties.java

示例4: caseEnumElementType

import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
@Override
public Void caseEnumElementType(EnumElementType type) {
  List<NominalType> types = typeRegistry.getTypes(type.getEnumType());
  if (types.isEmpty()) {
    type.getEnumType().visit(this);
  } else {
    com.github.jsdossier.proto.NamedType link = linkFactory.createTypeReference(types.get(0));
    currentExpression().setNamedType(link);
  }
  return null;
}
 
开发者ID:jleyba,项目名称:js-dossier,代码行数:12,代码来源:TypeExpressionParser.java

示例5: caseEnumElementType

import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
@Override
public TypeReference caseEnumElementType(EnumElementType type) {
  return new JavaTypeReference(checkNotNull(getJavaType(type)));
}
 
开发者ID:google,项目名称:jsinterop-generator,代码行数:5,代码来源:ClosureTypeRegistry.java

示例6: caseEnumElementType

import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
@Override
public Void caseEnumElementType(EnumElementType type) {
  return null;
}
 
开发者ID:angular,项目名称:clutz,代码行数:5,代码来源:DeclarationGenerator.java

示例7: caseEnumElementType

import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
@Override
public Object caseEnumElementType(EnumElementType type) {
  return null;
}
 
开发者ID:jleyba,项目名称:js-dossier,代码行数:5,代码来源:TypeCollectionPass.java


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