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


Java IAccessRule.IGNORE_IF_BETTER属性代码示例

本文整理汇总了Java中org.eclipse.jdt.core.IAccessRule.IGNORE_IF_BETTER属性的典型用法代码示例。如果您正苦于以下问题:Java IAccessRule.IGNORE_IF_BETTER属性的具体用法?Java IAccessRule.IGNORE_IF_BETTER怎么用?Java IAccessRule.IGNORE_IF_BETTER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jdt.core.IAccessRule的用法示例。


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

示例1: decodeAccessRules

static IAccessRule[] decodeAccessRules(NodeList list) {
  if (list == null) return null;
  int length = list.getLength();
  if (length == 0) return null;
  IAccessRule[] result = new IAccessRule[length];
  int index = 0;
  for (int i = 0; i < length; i++) {
    Node accessRule = list.item(i);
    if (accessRule.getNodeType() == Node.ELEMENT_NODE) {
      Element elementAccessRule = (Element) accessRule;
      String pattern = elementAccessRule.getAttribute(TAG_PATTERN);
      if (pattern == null) continue;
      String tagKind = elementAccessRule.getAttribute(TAG_KIND);
      int kind;
      if (TAG_ACCESSIBLE.equals(tagKind)) kind = IAccessRule.K_ACCESSIBLE;
      else if (TAG_NON_ACCESSIBLE.equals(tagKind)) kind = IAccessRule.K_NON_ACCESSIBLE;
      else if (TAG_DISCOURAGED.equals(tagKind)) kind = IAccessRule.K_DISCOURAGED;
      else continue;
      boolean ignoreIfBetter =
          "true".equals(elementAccessRule.getAttribute(TAG_IGNORE_IF_BETTER)); // $NON-NLS-1$
      result[index++] =
          new ClasspathAccessRule(
              new Path(pattern), ignoreIfBetter ? kind | IAccessRule.IGNORE_IF_BETTER : kind);
    }
  }
  if (index != length) System.arraycopy(result, 0, result = new IAccessRule[index], 0, index);
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:28,代码来源:ClasspathEntry.java

示例2: toProblemId

private static int toProblemId(int kind) {
	boolean ignoreIfBetter = (kind & IAccessRule.IGNORE_IF_BETTER) != 0;
	switch (kind & ~IAccessRule.IGNORE_IF_BETTER) {
		case K_NON_ACCESSIBLE:
			return ignoreIfBetter ? IProblem.ForbiddenReference | AccessRule.IgnoreIfBetter : IProblem.ForbiddenReference;
		case K_DISCOURAGED:
			return ignoreIfBetter ? IProblem.DiscouragedReference | AccessRule.IgnoreIfBetter : IProblem.DiscouragedReference;
		default:
			return ignoreIfBetter ? AccessRule.IgnoreIfBetter : 0;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:ClasspathAccessRule.java

示例3: decodeAccessRules

static IAccessRule[] decodeAccessRules(NodeList list) {
	if (list == null) return null;
	int length = list.getLength();
	if (length == 0) return null;
	IAccessRule[] result = new IAccessRule[length];
	int index = 0;
	for (int i = 0; i < length; i++) {
		Node accessRule = list.item(i);
		if (accessRule.getNodeType() == Node.ELEMENT_NODE) {
			Element elementAccessRule = (Element) accessRule;
			String pattern = elementAccessRule.getAttribute(TAG_PATTERN);
			if (pattern == null) continue;
			String tagKind =  elementAccessRule.getAttribute(TAG_KIND);
			int kind;
			if (TAG_ACCESSIBLE.equals(tagKind))
				kind = IAccessRule.K_ACCESSIBLE;
			else if (TAG_NON_ACCESSIBLE.equals(tagKind))
				kind = IAccessRule.K_NON_ACCESSIBLE;
			else if (TAG_DISCOURAGED.equals(tagKind))
				kind = IAccessRule.K_DISCOURAGED;
			else
				continue;
			boolean ignoreIfBetter = "true".equals(elementAccessRule.getAttribute(TAG_IGNORE_IF_BETTER)); //$NON-NLS-1$
			result[index++] = new ClasspathAccessRule(new Path(pattern), ignoreIfBetter ? kind | IAccessRule.IGNORE_IF_BETTER : kind);
		}
	}
	if (index != length)
		System.arraycopy(result, 0, result = new IAccessRule[index], 0, index);
	return result;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:30,代码来源:ClasspathEntry.java


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