• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RegExpGroup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



RegExpGroup类属于org.intellij.lang.regexp.psi包,在下文中一共展示了RegExpGroup类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: resolve

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
public RegExpGroup resolve() {
    final int index = getIndex();

    final PsiElementProcessor.FindFilteredElement<RegExpElement> processor = new PsiElementProcessor.FindFilteredElement<RegExpElement>(new PsiElementFilter() {
        int groupCount;

        public boolean isAccepted(PsiElement element) {
            if (element instanceof RegExpGroup) {
                if (((RegExpGroup)element).isCapturing() && ++groupCount == index) {
                    return true;
                }
            }
            return element == RegExpBackrefImpl.this;
        }
    });

    PsiTreeUtil.processElements(getContainingFile(), processor);
    if (processor.getFoundElement() instanceof RegExpGroup) {
        return (RegExpGroup)processor.getFoundElement();
    }
    return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:RegExpBackrefImpl.java


示例2: resolve

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Nullable
public RegExpGroup resolve() {
  final PsiElementProcessor.FindFilteredElement<RegExpGroup> processor = new PsiElementProcessor.FindFilteredElement<RegExpGroup>(
    new PsiElementFilter() {
      public boolean isAccepted(PsiElement element) {
        if (!(element instanceof RegExpGroup)) {
          return false;
        }
        final RegExpGroup regExpGroup = (RegExpGroup)element;
        return (regExpGroup.isPythonNamedGroup() || regExpGroup.isRubyNamedGroup()) &&
               Comparing.equal(getGroupName(), regExpGroup.getGroupName());
      }
    }
  );
  PsiTreeUtil.processElements(getContainingFile(), processor);
  return processor.getFoundElement();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:RegExpNamedGroupRefImpl.java


示例3: resolve

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Nullable
public RegExpGroup resolve() {
  final PsiElementProcessor.FindFilteredElement<RegExpElement> processor = new PsiElementProcessor.FindFilteredElement<RegExpElement>(new PsiElementFilter() {
      public boolean isAccepted(PsiElement element) {
          if (element instanceof RegExpGroup) {
              if (((RegExpGroup)element).isPythonNamedGroup() && Comparing.equal(getGroupName(), ((RegExpGroup)element).getGroupName())) {
                  return true;
              }
          }
          return element == RegExpPyNamedGroupRefImpl.this;
      }
  });

  PsiTreeUtil.processElements(getContainingFile(), processor);
  if (processor.getFoundElement() instanceof RegExpGroup) {
      return (RegExpGroup) processor.getFoundElement();
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:RegExpPyNamedGroupRefImpl.java


示例4: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Override
public boolean supportsNamedGroupSyntax(RegExpGroup group) {
  if (group.isNamedGroup()) {
    final JavaSdkVersion version = getJavaVersion(group);
    return version != null && version.isAtLeast(JavaSdkVersion.JDK_1_7);
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaRegExpHost.java


示例5: getQuickNavigateInfo

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Nullable
public String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
  if (element instanceof RegExpGroup) {
    return "Capturing Group: " + ((RegExpElement)element).getUnescapedText();
  } else {
    return null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:RegExpDocumentationProvider.java


示例6: annotate

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) {
  if (psiElement instanceof RegExpFile && psiElement.getCopyableUserData(KEY) == Boolean.TRUE) {
    final PsiElement pattern = psiElement.getFirstChild();
    if (!(pattern instanceof RegExpPattern)) {
      return;
    }

    final RegExpBranch[] branches = ((RegExpPattern)pattern).getBranches();
    if (branches.length == 1 && branches[0].getAtoms().length == 0) {
      return;
    }

    for (RegExpBranch branch : branches) {
      final int[] count = new int[1];
      branch.accept(new RegExpRecursiveElementVisitor() {
        @Override
        public void visitRegExpGroup(RegExpGroup group) {
          if (group.isCapturing()) {
            count[0]++;
          }
          super.visitRegExpGroup(group);
        }
      });

      if (count[0] != 1) {
        holder.createWarningAnnotation(branch, "The pattern should contain exactly one capturing group");
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:ValueRegExpAnnotator.java


示例7: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Override
public boolean supportsNamedGroupSyntax(RegExpGroup group) {
  if (group.isNamedGroup()) {
    final String version = getGroovyVersion(group);
    return version != null && version.compareTo(GroovyConfigUtils.GROOVY2_0) >= 0;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GroovyRegExpHost.java


示例8: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Override
public boolean supportsNamedGroupSyntax(RegExpGroup group) {
  if (group.isRubyNamedGroup()) {
    final Module module = ModuleUtilCore.findModuleForPsiElement(group);
    if (module != null) {
      final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
      if (sdk != null && sdk.getSdkType() instanceof JavaSdk) {
        final JavaSdkVersion version = JavaSdk.getInstance().getVersion(sdk);
        return version != null && version.isAtLeast(JavaSdkVersion.JDK_1_7);
      }
    }
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:JavaRegExpHost.java


示例9: annotate

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
public void annotate(PsiElement psiElement, AnnotationHolder holder) {
  if (psiElement instanceof RegExpFile && psiElement.getCopyableUserData(KEY) == Boolean.TRUE) {
    final PsiElement pattern = psiElement.getFirstChild();
    if (!(pattern instanceof RegExpPattern)) {
      return;
    }

    final RegExpBranch[] branches = ((RegExpPattern)pattern).getBranches();
    if (branches.length == 1 && branches[0].getAtoms().length == 0) {
      return;
    }

    for (RegExpBranch branch : branches) {
      final int[] count = new int[1];
      branch.accept(new RegExpRecursiveElementVisitor() {
        @Override
        public void visitRegExpGroup(RegExpGroup group) {
          if (group.isCapturing()) {
            count[0]++;
          }
          super.visitRegExpGroup(group);
        }
      });

      if (count[0] != 1) {
        holder.createWarningAnnotation(branch, "The pattern should contain exactly one capturing group");
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:ValueRegExpAnnotator.java


示例10: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
public boolean supportsNamedGroupSyntax(RegExpGroup group) {
  return group.isPythonNamedGroup();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PyStringLiteralExpressionImpl.java


示例11: getGroups

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
/**
 * @return Regexp groups this file has
 */
@NotNull
public Collection<RegExpGroup> getGroups() {
  return PsiTreeUtil.findChildrenOfType(this, RegExpGroup.class);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RegExpFile.java


示例12: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Override
public boolean supportsNamedGroupSyntax(RegExpGroup group) {
    return true;
}
 
开发者ID:dryabov,项目名称:phpregexp,代码行数:5,代码来源:PhpRegexpHost.java


示例13: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
public boolean supportsNamedGroupSyntax(@Nullable final RegExpGroup group) {
  final RegExpLanguageHost host = findRegExpHost(group);
  return host != null && host.supportsNamedGroupSyntax(group);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:RegExpLanguageHosts.java


示例14: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Override
public boolean supportsNamedGroupSyntax(RegExpGroup group) {
  return false;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:5,代码来源:HaxeRegularExpressionImpl.java


示例15: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Override
public boolean supportsNamedGroupSyntax(RegExpGroup group)
{
	return false;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:6,代码来源:HaxeRegularExpressionImpl.java


示例16: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
@Override
public boolean supportsNamedGroupSyntax(RegExpGroup group)
{
	return group.isNamedGroup() && hasAtLeastJdkVersion(group, JavaSdkVersion.JDK_1_7);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:6,代码来源:JavaRegExpHost.java


示例17: supportsNamedGroupSyntax

import org.intellij.lang.regexp.psi.RegExpGroup; //导入依赖的package包/类
boolean supportsNamedGroupSyntax(RegExpGroup group); 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:2,代码来源:RegExpLanguageHost.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MapInterceptor类代码示例发布时间:2022-05-22
下一篇:
Java NewCpdTokens类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap