Package com.dianping.cat.config

Examples of com.dianping.cat.config.CompositeFormat


  public ExpectedException exception = ExpectedException.none();

  @Test
  public void TestParse() throws ParseException {
    AggregationMessageFormat amf = new AggregationMessageFormat("Hello {world}.I am{*}.{md5:8}.");
    CompositeFormat format = new CompositeFormat(amf);
 
    assertEquals("Hello {world}.I am Jack.{md5:8}.", format.parse("Hello world.I am Jack.balabala."));
  }
View Full Code Here


        String key = entry.getKey();
        if (!input.endsWith(key)) {
          continue;
        }
        AggregationMessageFormat amf = amfMap.get(key);
        CompositeFormat cf = new CompositeFormat(amf);
        String output;
        try {
          output = cf.parse(input);
        } catch (Exception e) {
          continue;
        }
        return output;
      }
    }
    for (Map<String, AggregationMessageFormat> amfMap : eformatSet) {
      for (Entry<String, AggregationMessageFormat> entry : amfMap.entrySet()) {
        String key = entry.getKey();
        if (!input.startsWith(key)) {
          continue;
        }
        AggregationMessageFormat amf = amfMap.get(key);
        CompositeFormat cf = new CompositeFormat(amf);
        String output;
        try {
          output = cf.parse(input);
        } catch (Exception e) {
          continue;
        }
        return output;
      }
View Full Code Here

        String key = entry.getKey();
        if (!input.endsWith(key)) {
          continue;
        }
        AggregationMessageFormat amf = amfMap.get(key);
        CompositeFormat cf = new CompositeFormat(amf);
        String output;
        try {
          output = cf.parse(input);
        } catch (Exception e) {
          continue;
        }
        return output;
      }
    }
    for (Map<String, AggregationMessageFormat> amfMap : eformatSet) {
      for (Entry<String, AggregationMessageFormat> entry : amfMap.entrySet()) {
        String key = entry.getKey();
        if (!input.startsWith(key)) {
          continue;
        }
        AggregationMessageFormat amf = amfMap.get(key);
        CompositeFormat cf = new CompositeFormat(amf);
        String output;
        try {
          output = cf.parse(input);
        } catch (Exception e) {
          continue;
        }
        return output;
      }
View Full Code Here

TOP

Related Classes of com.dianping.cat.config.CompositeFormat

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.