Package com.google.gwt.i18n.server.MessageFormatUtils

Examples of com.google.gwt.i18n.server.MessageFormatUtils.StringChunk


  public void testParseInnerPlural() throws ParseException {
    String str = "You have {#} widgets";
    List<TemplateChunk> parsed = MessageStyle.MESSAGE_FORMAT.parse(str);
    assertEquals(3, parsed.size());
    StringChunk stringChunk = (StringChunk) parsed.get(0);
    assertEquals("You have ", stringChunk.getString());
    ArgumentChunk argChunk = (ArgumentChunk) parsed.get(1);
    assertEquals(-1, argChunk.getArgumentNumber());
    assertEquals("{#}", argChunk.getAsMessageFormatString());
    stringChunk = (StringChunk) parsed.get(2);
    assertEquals(" widgets", stringChunk.getString());
  }
View Full Code Here


    List<TemplateChunk> parsed = MessageStyle.MESSAGE_FORMAT.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,'{}'''}";
View Full Code Here

TOP

Related Classes of com.google.gwt.i18n.server.MessageFormatUtils.StringChunk

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.