Package org.slf4j.migrator.line

Examples of org.slf4j.migrator.line.MultiGroupConversionRule.addReplacement()


   
    //we define 4 differents capturing groups
    MultiGroupConversionRule cr1 = new MultiGroupConversionRule(Pattern.compile("(first group)( second group)( third group)( 4th group)"));
    //group zero is ignored during treatment
    //replacement for the first
    cr1.addReplacement(1, "1st group");
    //no replacement for the second group it will remains the same
    //empty string for the third group it will be deleted
    cr1.addReplacement(3, "");
    //no replacement for the third group it will remains the same
   
View Full Code Here


    //group zero is ignored during treatment
    //replacement for the first
    cr1.addReplacement(1, "1st group");
    //no replacement for the second group it will remains the same
    //empty string for the third group it will be deleted
    cr1.addReplacement(3, "");
    //no replacement for the third group it will remains the same
   
    conversionRuleList = new ArrayList<ConversionRule>();
    conversionRuleList.add(cr);
    conversionRuleList.add(cr1);
View Full Code Here

   *
   */
  public void test() {
    MultiGroupConversionRule cr2 = new MultiGroupConversionRule(Pattern
        .compile("(.*)(Log)"));
    cr2.addReplacement(2, "LOGGER");

    String s = "abcd Log";
    Pattern pat = cr2.getPattern();
    Matcher m = pat.matcher(s);

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.