Examples of AggregationMessageFormat


Examples of com.dianping.cat.config.aggregation.AggregationMessageFormat

  @Rule
  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

Examples of com.dianping.cat.config.aggregation.AggregationMessageFormat

      for (Entry<String, AggregationMessageFormat> entry : amfMap.entrySet()) {
        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) {
View Full Code Here

Examples of com.dianping.cat.config.aggregation.AggregationMessageFormat

      }

      String key1 = format.substring(0, index1);
      String key2 = format.substring(index2 + 1);

      AggregationMessageFormat value = new AggregationMessageFormat(format);

      buildFormatTree(formats, key1.toCharArray(), key2.toCharArray(), value);
    }
    m_formats = formats;
    m_orignals = orignals;
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.