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

Java RegExp类代码示例

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

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



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

示例1: log4jColumnizer

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
private static Columnizer log4jColumnizer() {
    ObservableList<ColumnDefinition> columns = FXCollections.observableArrayList();
    columns.add(new ColumnDefinition("Date/Time", "datetime", Description.Server.DATE, Width.DATE));
    columns.add(new ColumnDefinition("Thread ID", "thread", Description.Server.THREAD_ID));
    columns.add(new ColumnDefinition("Severity", "severity", Description.Server.SEVERITY, Width.SEVERITY));
    columns.add(new ColumnDefinition("Class", "class", Description.Server.CLASS, Width.CLASS));
    columns.add(new ColumnDefinition("Message", "msg", Description.Server.MSG, Width.MSG));

    @RegExp
    String regex = "(?<datetime>\\S+)" //
            + " \\[(?<thread>[^]]*?)]" //
            + " (?<severity>\\S+)" //
            + "\\s+(?<class>\\S+)" //
            + " - (?<msg>.*)";
    @RegExp
    String defaultToMsg = "(?<msg>.*)";

    ObservableList<String> regexps = FXCollections.observableArrayList(regex, defaultToMsg);
    return new Columnizer("Log4j / Logback", columns, regexps);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:21,代码来源:DefaultConfig.java


示例2: accessLogColumnizer

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
private static Columnizer accessLogColumnizer() {
    ObservableList<ColumnDefinition> columnDefinitions = FXCollections.observableArrayList();
    columnDefinitions.add(new ColumnDefinition("Client", "client", Description.Access.CLIENT, Width.DOMAIN));
    columnDefinitions.add(new ColumnDefinition("Indentity", "identd", Description.Access.IDENTD));
    columnDefinitions.add(new ColumnDefinition("User ID", "userid", Description.Access.USERID));
    columnDefinitions.add(new ColumnDefinition("Date/Time", "datetime", Description.Access.DATE, Width.DATE));
    columnDefinitions.add(new ColumnDefinition("Request", "request", Description.Access.REQUEST, Width.MSG));
    columnDefinitions.add(new ColumnDefinition("Rsp. Code", "rstatus", Description.Access.STATUS));
    columnDefinitions.add(new ColumnDefinition("Rsp. Size (B)", "rsize", Description.Access.RSIZE));
    columnDefinitions.add(new ColumnDefinition("Referer", "referer", Description.Access.REFERER));
    columnDefinitions.add(new ColumnDefinition("User-Agent", "useragent", Description.Access.USERAGENT));

    @RegExp
    String regex = "(?<client>\\S+)" //
            + " (?<identd>\\S+)" //
            + " (?<userid>\\S+)" //
            + " \\[(?<datetime>[^\\]]*?)\\]" //
            + " \"(?<request>[^\"]*?)\"" //
            + " (?<rstatus>\\S+)" //
            + " (?<rsize>\\S+)" //
            + "( \"(?<referer>[^\"]*?)\" \"(?<useragent>[^\"]*?)\")?";

    ObservableList<String> regexps = FXCollections.observableArrayList(regex);
    return new Columnizer("Common/Combined Log Format (access)", columnDefinitions, regexps);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:26,代码来源:DefaultConfig.java


示例3: apacheErrorColumnizer

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
private static Columnizer apacheErrorColumnizer() {
    ObservableList<ColumnDefinition> columnDefinitions = FXCollections.observableArrayList();
    columnDefinitions.add(new ColumnDefinition("Date/Time", "datetime", Width.DATE));
    columnDefinitions.add(new ColumnDefinition("Severity", "severity", Width.SEVERITY));
    columnDefinitions.add(new ColumnDefinition("Client", "client", Width.DOMAIN));
    columnDefinitions.add(new ColumnDefinition("Message", "msg", Width.MSG));

    @RegExp
    String full = "\\[(?<datetime>[^]]*?)] \\[(?<severity>[^]]*?)] \\[(?<client>[^]]*?)] (?<msg>.*)";
    @RegExp
    String noClient = "\\[(?<datetime>[^]]*?)] \\[(?<severity>[^]]*?)] (?<msg>.*)";
    @RegExp
    String noClientNoSev = "\\[(?<datetime>[^]]*?)] (?<msg>.*)";
    @RegExp
    String defaultToMsg = "(?<msg>.*)";

    ObservableList<String> regexps = FXCollections.observableArrayList(full, noClient, noClientNoSev, defaultToMsg);
    return new Columnizer("Apache Error Log", columnDefinitions, regexps);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:20,代码来源:DefaultConfig.java


示例4: parseActionHint

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
@NotNull
public static Pair<String, Boolean> parseActionHint(@NotNull PsiFile file,
                                                    @NotNull String contents,
                                                    @NotNull @NonNls @RegExp String actionPattern) {
  PsiFile hostFile = InjectedLanguageManager.getInstance(file.getProject()).getTopLevelFile(file);

  final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(hostFile.getLanguage());
  String comment = commenter.getLineCommentPrefix();
  if (comment == null) {
    comment = commenter.getBlockCommentPrefix();
  }

  // "quick fix action text to perform" "should be available"
  assert comment != null : commenter;
  Pattern pattern = Pattern.compile("^" + comment.replace("*", "\\*") + actionPattern, Pattern.DOTALL);
  Matcher matcher = pattern.matcher(contents);
  assertTrue("No comment found in "+file.getVirtualFile(), matcher.matches());
  final String text = matcher.group(1);
  final Boolean actionShouldBeAvailable = Boolean.valueOf(matcher.group(2));
  return Pair.create(text, actionShouldBeAvailable);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:LightQuickFixTestCase.java


示例5: setValuePattern

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
public void setValuePattern(@RegExp @Nullable String pattern) {
  try {
    if (pattern != null && pattern.length() > 0) {
      myValuePattern = pattern;
      myCompiledValuePattern = Pattern.compile(pattern, Pattern.DOTALL);
    }
    else {
      myValuePattern = "";
      myCompiledValuePattern = null;
    }
  }
  catch (Exception e1) {
    myCompiledValuePattern = null;
    Logger.getInstance(getClass().getName()).info("Invalid pattern", e1);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:BaseInjection.java


示例6: registerPlayer

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
/**
 * Adds a player to PlayerManager to handle the given URI pattern.
 *
 * @param uriPattern the pattern to register with the PlayerManager.
 * @param player the player associated with the pattern.
 */
public void registerPlayer(@RegExp String uriPattern, Player player) {
    if (players.containsKey(uriPattern)) {
        IllegalStateException exception =
                new IllegalStateException("Can't have two players registered to the same URI.");

        if (QLog.shouldIgnoreIllegalStates()) {
            QLog.e(exception, this.getClass().getSimpleName(), exception.getMessage());
        } else {
            throw exception;
        }
    } else {
        log("Registered to play tracks with URI: " + uriPattern);
        players.put(uriPattern, player);
    }
}
 
开发者ID:jacoblubecki,项目名称:Q,代码行数:22,代码来源:PlayerManager.java


示例7: unregisterPlayer

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
/**
 * Removes a player from the PlayerManager that matches the given URI.
 *
 * @param uriPattern the URI pattern that should no longer be associated with the PlayerManager.
 */
public void unregisterPlayer(@RegExp String uriPattern) {
    if (players.containsKey(uriPattern)) {
        log(String.format("Player unregistered. URI: %s    Name: %s", uriPattern,
                players.get(uriPattern).getClass().getSimpleName()));

        players.get(uriPattern).release();
        players.remove(uriPattern);
    } else {
        IllegalStateException exception = new IllegalStateException("Player was never registered.");

        if (QLog.shouldIgnoreIllegalStates()) {
            QLog.e(exception, this.getClass().getSimpleName(), exception.getMessage());
        } else {
            throw exception;
        }
    }
}
 
开发者ID:jacoblubecki,项目名称:Q,代码行数:23,代码来源:PlayerManager.java


示例8: parseActionHint

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
@NotNull
public static Pair<String, Boolean> parseActionHint(@NotNull PsiFile file, @NotNull String contents, @NotNull @NonNls @RegExp String actionPattern) {
  PsiFile hostFile = InjectedLanguageManager.getInstance(file.getProject()).getTopLevelFile(file);

  final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(hostFile.getLanguage());
  String comment = commenter.getLineCommentPrefix();
  if (comment == null) {
    comment = commenter.getBlockCommentPrefix();
  }

  // "quick fix action text to perform" "should be available"
  assert comment != null : commenter;
  Pattern pattern = Pattern.compile("^" + comment.replace("*", "\\*") + actionPattern, Pattern.DOTALL);
  Matcher matcher = pattern.matcher(contents);
  assertTrue("No comment found in "+file.getVirtualFile(), matcher.matches());
  final String text = matcher.group(1);
  final Boolean actionShouldBeAvailable = Boolean.valueOf(matcher.group(2));
  return Pair.create(text, actionShouldBeAvailable);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:LightQuickFixTestCase.java


示例9: parseActionHint

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
public static Pair<String, Boolean> parseActionHint(final PsiFile file, String contents, @NonNls @RegExp String actionPattern) {
  PsiFile hostFile = InjectedLanguageManager.getInstance(LightPlatformTestCase.getProject()).getTopLevelFile(file);

  final Commenter commenter = LanguageCommenters.INSTANCE.forLanguage(hostFile.getLanguage());
  String comment = commenter.getLineCommentPrefix();
  if (comment == null) {
    comment = commenter.getBlockCommentPrefix();
  }

  // "quick fix action text to perform" "should be available"
  assert comment != null : commenter;
  Pattern pattern = Pattern.compile("^" + comment.replace("*", "\\*") + actionPattern, Pattern.DOTALL);
  Matcher matcher = pattern.matcher(contents);
  assertTrue("No comment found in "+file.getVirtualFile(), matcher.matches());
  final String text = matcher.group(1);
  final Boolean actionShouldBeAvailable = Boolean.valueOf(matcher.group(2));
  return Pair.create(text, actionShouldBeAvailable);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:19,代码来源:LightQuickFixTestCase.java


示例10: weblogicEasyTraceColumnizer

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
private static Columnizer weblogicEasyTraceColumnizer() {
    ObservableList<ColumnDefinition> columns = FXCollections.observableArrayList();
    columns.add(new ColumnDefinition("Date/Time", "datetime", Description.Server.DATE, Width.DATE));
    columns.add(new ColumnDefinition("Severity", "severity", Description.Server.SEVERITY, Width.SEVERITY));
    columns.add(new ColumnDefinition("Subsystem", "subsystem", Description.Server.SUBSYSTEM, false));
    columns.add(new ColumnDefinition("Machine Name", "machine", Description.Server.MACHINE_NAME, false));
    columns.add(new ColumnDefinition("Server Name", "server", Description.Server.SERVER_NAME, false));
    columns.add(new ColumnDefinition("Thread ID", "thread", Description.Server.THREAD_ID, false));
    columns.add(new ColumnDefinition("Class", "class", Description.Server.CLASS, Width.CLASS));
    columns.add(new ColumnDefinition("Message", "msg", Description.Server.MSG, Width.MSG));
    columns.add(new ColumnDefinition("JSessionID", "sessionid", Description.Server.JSESSIONID,
            Width.SESSION_ID));

    @RegExp
    String logStart = "<(?<datetime>[^>]*?)>" //
            + " ?<(?<severity>[^>]*?)>" //
            + " ?<(?<subsystem>[^>]*?)>" //
            + " ?<(?<machine>[^>]*?)>" //
            + " ?<(?<server>[^>]*?)>" //
            + " ?<(?<thread>[^>]*?)>" //
            + "( ?<(?<class>[^>]*?)>)?" //
            + " ?<(?<msg>.*?)" // message start
            + "(;jsessionid=(?<sessionid>[^>]*))?" // optional session id
            + ">?\\s*"; // optional end of message
    @RegExp
    String logEnd = "(?<msg>.*?)(;jsessionid=(?<sessionid>[^>]*))?>\\s*"; // end of msg and optional session id
    @RegExp
    String logCenter = "(?<msg>.*)";

    ObservableList<String> regexps = FXCollections.observableArrayList(logStart, logEnd, logCenter);
    return new Columnizer("Weblogic (processed by EasyTrace)", columns, regexps);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:33,代码来源:DefaultConfig.java


示例11: amadeusInputLog

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
private static Columnizer amadeusInputLog() {
    ObservableList<ColumnDefinition> columnDefinitions = FXCollections.observableArrayList();
    columnDefinitions.add(new ColumnDefinition("Date/Time", "date", Width.DATE));
    columnDefinitions.add(new ColumnDefinition("Domain", "domain", Width.URL));
    columnDefinitions.add(new ColumnDefinition("Action", "action", Width.ENDPOINT));
    columnDefinitions.add(new ColumnDefinition("Parameters", "params", Width.PARAMETER_LIST));

    @RegExp
    String regex = "(?<date>[0-9]{17}).*?(?<domain>http.*)/(?<action>.*?)\\?(?<params>.*)";

    ObservableList<String> regexps = FXCollections.observableArrayList(regex);
    return new Columnizer("Amadeus input.out", columnDefinitions, regexps);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:14,代码来源:DefaultConfig.java


示例12: pregMatch

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
@Nullable
private String pregMatch(@Nullable String content, @RegExp String regular) {
    if(content == null) {
        return null;
    }

    Matcher matcher = Pattern.compile(regular, Pattern.MULTILINE).matcher(content);
    if(matcher.find()){
        return matcher.group(1);
    }

    return null;
}
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:14,代码来源:LocalDefaultDataCollector.java


示例13: NumericPropertyAction

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
public NumericPropertyAction(String name, String operation, @RegExp String... pattern)
{
    super(name, pattern);
    this.operation = operation;
}
 
开发者ID:GotoFinal,项目名称:diorite-configs-java8,代码行数:6,代码来源:NumericPropertyAction.java


示例14: weblogicColumnizer

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
private static Columnizer weblogicColumnizer() {
    ObservableList<ColumnDefinition> columns = FXCollections.observableArrayList();
    columns.add(new ColumnDefinition("Date/Time", "datetime", Description.Server.DATE, Width.DATE));
    columns.add(new ColumnDefinition("Severity", "severity", Description.Server.SEVERITY, Width.SEVERITY));
    columns.add(new ColumnDefinition("Subsystem", "subsystem", Description.Server.SUBSYSTEM, false));
    columns.add(new ColumnDefinition("Machine Name", "machine", Description.Server.MACHINE_NAME, false));
    columns.add(new ColumnDefinition("Server Name", "server", Description.Server.SERVER_NAME, false));
    columns.add(new ColumnDefinition("Thread ID", "thread", Description.Server.THREAD_ID, false));
    columns.add(new ColumnDefinition("User ID", "userId", Description.Server.USER_ID, false));
    columns.add(new ColumnDefinition("Transaction ID", "transaction", Description.Server.TRANSACTION, false));
    columns.add(new ColumnDefinition("Diagnostic Context ID", "context", Description.Server.DIAGNOSTIC_CTX_ID,
            false));
    columns.add(new ColumnDefinition("Timestamp", "timestamp", Description.Server.TIMESTAMP, false));
    columns.add(new ColumnDefinition("Message ID", "msgId", Description.Server.MSG_ID, false));
    columns.add(new ColumnDefinition("Class", "class", Description.Server.CLASS, Width.CLASS));
    columns.add(new ColumnDefinition("Message", "msg", Description.Server.MSG, Width.MSG));
    columns.add(new ColumnDefinition("JSessionID", "sessionid", Description.Server.JSESSIONID,
            Width.SESSION_ID));

    @RegExp
    String logStart = "####" //
            + "<(?<datetime>[^>]*?)>" //
            + " ?<(?<severity>[^>]*?)>" //
            + " ?<(?<subsystem>[^>]*?)>" //
            + " ?<(?<machine>[^>]*?)>" //
            + " ?<(?<server>[^>]*?)>" //
            + " ?<(?<thread>[^>]*?)>" //
            + " ?<(?<userId>.*?)>" //
            + " ?<(?<transaction>[^>]*?)>" //
            + " ?<(?<context>[^>]*?)>" //
            + " ?<(?<timestamp>[^>]*?)>" //
            + " ?<(?<msgId>[^>]*?)>" //
            + "( ?<(?<class>[^>]*?)>)?" //
            + " ?<(?<msg>.*?)" // message start
            + "(;jsessionid=(?<sessionid>[^>]*))?" // optional session id
            + ">?\\s*"; // optional end of message
    @RegExp
    String logEnd = "(?<msg>.*?)(;jsessionid=(?<sessionid>[^>]*))?>\\s*"; // end of msg and optional session id
    @RegExp
    String logCenter = "(?<msg>.*)";

    ObservableList<String> regexps = FXCollections.observableArrayList(logStart, logEnd, logCenter);
    return new Columnizer("Weblogic Server Log", columns, regexps);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:45,代码来源:DefaultConfig.java


示例15: convertAntToRegexp

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
@RegExp
@NotNull
public static String convertAntToRegexp(@NotNull String antPattern) {
  return convertAntToRegexp(antPattern, true);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:FileUtil.java


示例16: convertAntToRegexp

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
@RegExp
@Nonnull
public static String convertAntToRegexp(@Nonnull String antPattern) {
  return convertAntToRegexp(antPattern, true);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:FileUtil.java


示例17: Filter

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
/**
 * Creates a new filter.
 *
 * @param columnName
 *         the capturing group name corresponding to the column to apply this filter to, or null to apply this
 *         filter to the whole raw log line
 * @param regex
 *         the regex that the given column (or whole line) should match
 * @param flags
 *         the match flags, a bit mask that may include {@link Pattern#CASE_INSENSITIVE}, {@link Pattern#MULTILINE},
 *         {@link Pattern#DOTALL}, {@link Pattern#UNICODE_CASE}, {@link Pattern#CANON_EQ}, {@link
 *         Pattern#UNIX_LINES}, {@link Pattern#LITERAL}, {@link Pattern#UNICODE_CHARACTER_CLASS} and {@link
 *         Pattern#COMMENTS}
 *
 * @throws PatternSyntaxException
 *         if the given regex is not well formed
 */
private Filter(String columnName, @RegExp String regex, int flags) throws PatternSyntaxException {
    this.pattern = new SimpleObjectProperty<>(Pattern.compile(regex, flags));
    this.columnName = new SimpleStringProperty(columnName);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:22,代码来源:Filter.java


示例18: findInRawLog

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
/**
 * Creates a new filter which applies on the raw log line.
 *
 * @param regex
 *         the regex that the whole raw log line should match
 *
 * @throws PatternSyntaxException
 *         if the given regex is not well formed
 */
@NotNull
public static Filter findInRawLog(@NotNull @RegExp String regex) throws PatternSyntaxException {
    return new Filter(null, regex, 0);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:14,代码来源:Filter.java


示例19: findInColumn

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
/**
 * Creates a new filter which applies on the value of the given column.
 *
 * @param columnName
 *         the capturing group name corresponding to the column to apply this filter to
 * @param regex
 *         the regex that the whole value of the given column should match
 *
 * @throws PatternSyntaxException
 *         if the given regex is not well formed
 */
@NotNull
public static Filter findInColumn(@NotNull String columnName, @NotNull @RegExp String regex) throws
        PatternSyntaxException {
    return findInColumn(columnName, regex, 0);
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:17,代码来源:Filter.java


示例20: addPlayer

import org.intellij.lang.annotations.RegExp; //导入依赖的package包/类
/**
 * Adds a player to the {@link PlayerManager}.
 *
 * @param uriPattern the pattern linked to the provided {@link Player}.
 * @param player     the {@link Player} that should handle a track uri matching the provided pattern.
 */
public void addPlayer(@RegExp String uriPattern, Player player) {
    manager.registerPlayer(uriPattern, player);
}
 
开发者ID:jacoblubecki,项目名称:Q,代码行数:10,代码来源:Q.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java MethodSecurityMetadataSource类代码示例发布时间:2022-05-22
下一篇:
Java ContentHandler类代码示例发布时间: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