Examples of StringChunk


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

    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,'{}'''}";
View Full Code Here

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

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

    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

Examples of org.apache.poi.hsmf.datatypes.StringChunk

   * @param chunk
   * @throws ChunkNotFoundException
   */
  public String getStringFromChunk(StringChunk chunk) throws ChunkNotFoundException {
    Chunk out = this.chunkParser.getDocumentNode(chunk);
    StringChunk strchunk = (StringChunk)out;
    return strchunk.toString();
  }
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.StringChunk

                   chunk = new DirectoryChunk((DirectoryNode)entry, namePrefix, chunkId, type);
               }
               break;
            case Types.ASCII_STRING:
            case Types.UNICODE_STRING:
               chunk = new StringChunk(namePrefix, chunkId, type);
               break;
            }
         }
        
         if(chunk != null) {
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.StringChunk

                 // There's normally something in the headers
                 msg.guess7BitEncoding();
              } else {
                 // Nothing in the header, try encoding detection
                 //  on the message body
                 StringChunk text = msg.getMainChunks().textBodyChunk;
                 if(text != null) {
                    CharsetDetector detector = new CharsetDetector();
                    detector.setText( text.getRawValue() );
                    CharsetMatch match = detector.detect();
                    if(match.getConfidence() > 35) {
                       msg.set7BitEncoding( match.getName() );
                    }
                 }
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.StringChunk

   * @return
   * @throws ChunkNotFoundException
   */
  public String getStringFromChunk(StringChunk chunk) throws ChunkNotFoundException {
    Chunk out = this.chunkParser.getDocumentNode(chunk);
    StringChunk strchunk = (StringChunk)out;
    return strchunk.toString();
  }
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.StringChunk

* @author Travis Ferguson
*
*/
public class TestChunkData extends TestCase {
  public void testChunkCreate() {
    StringChunk chunk = new StringChunk(0x0200);
    TestCase.assertEquals("__substg1.0_0200001E", chunk.getEntryName());
   
    /* test the lower and upper limits of the chunk ids */
    chunk = new StringChunk(0x0000);
    TestCase.assertEquals("__substg1.0_0000001E", chunk.getEntryName());
   
    chunk = new StringChunk(0xFFFF);
    TestCase.assertEquals("__substg1.0_FFFF001E", chunk.getEntryName());
  }
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.StringChunk

    chunk = new StringChunk(0xFFFF);
    TestCase.assertEquals("__substg1.0_FFFF001E", chunk.getEntryName());
  }
 
  public void testTextBodyChunk() {
    StringChunk chunk = new StringChunk(0x1000);
    TestCase.assertEquals(chunk.getEntryName(), Chunks.getInstance().textBodyChunk.getEntryName());
  }
View Full Code Here

Examples of org.apache.poi.hsmf.datatypes.StringChunk

    StringChunk chunk = new StringChunk(0x1000);
    TestCase.assertEquals(chunk.getEntryName(), Chunks.getInstance().textBodyChunk.getEntryName());
  }

  public void testDisplayToChunk() {
    StringChunk chunk = new StringChunk(0x0E04);
    TestCase.assertEquals(chunk.getEntryName(), Chunks.getInstance().displayToChunk.getEntryName());
  }
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.