Package com.google.gwt.i18n.rebind.MessageFormatParser

Examples of com.google.gwt.i18n.rebind.MessageFormatParser.StaticArgChunk


  public void testStaticArg() throws ParseException {
    String str = "{beginBold,<b>}bold{endBold,</b>}";
    List<TemplateChunk> parsed = MessageFormatParser.parse(str);
    assertEquals(3, parsed.size());
    StaticArgChunk staticArg = (StaticArgChunk) parsed.get(0);
    assertEquals("beginBold", staticArg.getArgName());
    assertEquals("<b>", staticArg.getReplacement());
    StringChunk stringChunk = (StringChunk) parsed.get(1);
    assertEquals("bold", stringChunk.getString());
    staticArg = (StaticArgChunk) parsed.get(2);
    assertEquals("endBold", staticArg.getArgName());
    assertEquals("</b>", staticArg.getReplacement());
   
    str = "{test,'{}'''}";
    parsed = MessageFormatParser.parse(str);
    assertEquals(1, parsed.size());
    staticArg = (StaticArgChunk) parsed.get(0);
    assertEquals("test", staticArg.getArgName());
    assertEquals("{}'", staticArg.getReplacement());
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.i18n.rebind.MessageFormatParser.StaticArgChunk

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.