Package ch.qos.logback.core.pattern.util

Examples of ch.qos.logback.core.pattern.util.AlmostAsIsEscapeUtil


      // http://jira.qos.ch/browse/LBCORE-130
      // we escape ')' for parsing purposes. Note that the original pattern is preserved
      // because it is shown to the user in status messages. We don't want the escaped version
      // to leak out.
      String patternForParsing = escapeRightParantesis(pattern);
      Parser<Object> p = new Parser<Object>(patternForParsing, new AlmostAsIsEscapeUtil());
      p.setContext(context);
      Node t = p.parse();
      this.headTokenConverter = p.compile(t, CONVERTER_MAP);

    } catch (ScanException sce) {
View Full Code Here


      // http://jira.qos.ch/browse/LBCORE-130
      // we escape ')' for parsing purposes. Note that the original pattern is preserved
      // because it is shown to the user in status messages. We don't want the escaped version
      // to leak out.
      String patternForParsing = escapeRightParantesis(pattern);
      Parser<Object> p = new Parser<Object>(patternForParsing, new AlmostAsIsEscapeUtil());
      p.setContext(context);
      Node t = p.parse();
      this.headTokenConverter = p.compile(t, CONVERTER_MAP);

    } catch (ScanException sce) {
View Full Code Here

      // http://jira.qos.ch/browse/LBCORE-130
      // we escape ')' for parsing purposes. Note that the original pattern is preserved
      // because it is shown to the user in status messages. We don't want the escaped version
      // to leak out.
      String patternForParsing = escapeRightParantesis(pattern);
      Parser<Object> p = new Parser<Object>(patternForParsing, new AlmostAsIsEscapeUtil());
      p.setContext(context);
      Node t = p.parse();
      this.headTokenConverter = p.compile(t, CONVERTER_MAP);

    } catch (ScanException sce) {
View Full Code Here

  }

  @Test
  public void testWindowsLikeBackSlashes() throws ScanException {
    List tl = new TokenStream("c:\\hello\\world.%i",
            new AlmostAsIsEscapeUtil()).tokenize();

    List<Token> witness = new ArrayList<Token>();
    witness.add(new Token(Token.LITERAL, "c:\\hello\\world."));
    witness.add(Token.PERCENT_TOKEN);
    witness.add(new Token(Token.SIMPLE_KEYWORD, "i"));
View Full Code Here

  @Test
  public void compositedKeyword() throws ScanException {
    {
      List tl = new TokenStream("%d(A)",
              new AlmostAsIsEscapeUtil()).tokenize();
      List<Token> witness = new ArrayList<Token>();
      witness.add(Token.PERCENT_TOKEN);
      witness.add(new Token(Token.COMPOSITE_KEYWORD, "d"));
      witness.add(new Token(Token.LITERAL, "A"));
      witness.add(Token.RIGHT_PARENTHESIS_TOKEN);
      assertEquals(witness, tl);
    }
    {
      List tl = new TokenStream("a %subst(%b C)",
              new AlmostAsIsEscapeUtil()).tokenize();
      List<Token> witness = new ArrayList<Token>();
      witness.add(new Token(Token.LITERAL, "a "));
      witness.add(Token.PERCENT_TOKEN);
      witness.add(new Token(Token.COMPOSITE_KEYWORD, "subst"));
      witness.add(Token.PERCENT_TOKEN);
View Full Code Here

  @Test
  public void compositedKeywordFollowedByOptions() throws ScanException {
    {
      List tl = new TokenStream("%d(A){o}",
              new AlmostAsIsEscapeUtil()).tokenize();
      List<Token> witness = new ArrayList<Token>();
      witness.add(Token.PERCENT_TOKEN);
      witness.add(new Token(Token.COMPOSITE_KEYWORD, "d"));
      witness.add(new Token(Token.LITERAL, "A"));
      witness.add(Token.RIGHT_PARENTHESIS_TOKEN);
View Full Code Here

    ConverterUtil.startConverters(this.headTokenConverter);
  }

  void parse() {
    try {
      Parser<Object> p = new Parser<Object>(pattern, new AlmostAsIsEscapeUtil());
      p.setContext(context);
      Node t = p.parse();
      this.headTokenConverter = p.compile(t, CONVERTER_MAP);

    } catch (ScanException sce) {
View Full Code Here

      // http://jira.qos.ch/browse/LBCORE-130
      // we escape ')' for parsing purposes. Note that the original pattern is preserved
      // because it is shown to the user in status messages. We don't want the escaped version
      // to leak out.
      String patternForParsing = escapeRightParantesis(pattern);
      Parser<Object> p = new Parser<Object>(patternForParsing, new AlmostAsIsEscapeUtil());
      p.setContext(context);
      Node t = p.parse();
      this.headTokenConverter = p.compile(t, CONVERTER_MAP);

    } catch (ScanException sce) {
View Full Code Here

    ConverterUtil.startConverters(this.headTokenConverter);
  }

  void parse() {
    try {
      Parser<Object> p = new Parser<Object>(pattern, new AlmostAsIsEscapeUtil());
      p.setContext(context);
      Node t = p.parse();
      this.headTokenConverter = p.compile(t, CONVERTER_MAP);

    } catch (ScanException sce) {
View Full Code Here

      // http://jira.qos.ch/browse/LBCORE-130
      // we escape ')' for parsing purposes. Note that the original pattern is preserved
      // because it is shown to the user in status messages. We don't want the escaped version
      // to leak out.
      String patternForParsing = escapeRightParantesis(pattern);
      Parser<Object> p = new Parser<Object>(patternForParsing, new AlmostAsIsEscapeUtil());
      p.setContext(context);
      Node t = p.parse();
      this.headTokenConverter = p.compile(t, CONVERTER_MAP);

    } catch (ScanException sce) {
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.pattern.util.AlmostAsIsEscapeUtil

Copyright © 2018 www.massapicom. 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.