本文整理汇总了Java中com.google.javascript.rhino.JSDocInfo.setDeprecated方法的典型用法代码示例。如果您正苦于以下问题:Java JSDocInfo.setDeprecated方法的具体用法?Java JSDocInfo.setDeprecated怎么用?Java JSDocInfo.setDeprecated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.javascript.rhino.JSDocInfo
的用法示例。
在下文中一共展示了JSDocInfo.setDeprecated方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetAndSetJSDocInfoWithObjectTypes
import com.google.javascript.rhino.JSDocInfo; //导入方法依赖的package包/类
public void testGetAndSetJSDocInfoWithObjectTypes() throws Exception {
ObjectType sup =
registry.createObjectType(registry.createAnonymousObjectType());
ObjectType sub = registry.createObjectType(sup);
JSDocInfo deprecated = new JSDocInfo();
deprecated.setDeprecated(true);
JSDocInfo privateInfo = new JSDocInfo();
privateInfo.setVisibility(Visibility.PRIVATE);
sup.defineProperty("X", NUMBER_TYPE, false, false);
sup.setPropertyJSDocInfo("X", privateInfo, false);
sub.setPropertyJSDocInfo("X", deprecated, false);
assertFalse(sup.getOwnPropertyJSDocInfo("X").isDeprecated());
assertEquals(Visibility.PRIVATE,
sup.getOwnPropertyJSDocInfo("X").getVisibility());
assertEquals(NUMBER_TYPE, sup.getPropertyType("X"));
assertTrue(sub.getOwnPropertyJSDocInfo("X").isDeprecated());
assertNull(sub.getOwnPropertyJSDocInfo("X").getVisibility());
assertEquals(NUMBER_TYPE, sub.getPropertyType("X"));
}
示例2: testGetAndSetJSDocInfoWithNamedType
import com.google.javascript.rhino.JSDocInfo; //导入方法依赖的package包/类
public void testGetAndSetJSDocInfoWithNamedType() throws Exception {
JSDocInfo info = new JSDocInfo();
info.setDeprecated(true);
assertNull(namedGoogBar.getOwnPropertyJSDocInfo("X"));
namedGoogBar.setPropertyJSDocInfo("X", info, false);
assertTrue(namedGoogBar.getOwnPropertyJSDocInfo("X").isDeprecated());
assertPropertyTypeInferred(namedGoogBar, "X");
assertEquals(UNKNOWN_TYPE, namedGoogBar.getPropertyType("X"));
}
示例3: testGetAndSetJSDocInfoWithNoType
import com.google.javascript.rhino.JSDocInfo; //导入方法依赖的package包/类
public void testGetAndSetJSDocInfoWithNoType() throws Exception {
JSDocInfo deprecated = new JSDocInfo();
deprecated.setDeprecated(true);
NO_TYPE.setPropertyJSDocInfo("X", deprecated, false);
assertNull(NO_TYPE.getOwnPropertyJSDocInfo("X"));
}