本文整理汇总了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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例5: caseEnumElementType
import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
@Override
public TypeReference caseEnumElementType(EnumElementType type) {
return new JavaTypeReference(checkNotNull(getJavaType(type)));
}
示例6: caseEnumElementType
import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
@Override
public Void caseEnumElementType(EnumElementType type) {
return null;
}
示例7: caseEnumElementType
import com.google.javascript.rhino.jstype.EnumElementType; //导入依赖的package包/类
@Override
public Object caseEnumElementType(EnumElementType type) {
return null;
}