Examples of CharCursor


Examples of com.caucho.util.CharCursor

   * parse the content-type, possibly changing character-encoding.
   */
  private void parseContentType(Node parent, String contentType)
    throws IOException, XslParseException
  {
    CharCursor cursor = new StringCharCursor(contentType);

    CharBuffer buf = new CharBuffer();
    wsScanner.skip(cursor);
    delimScanner.scan(cursor, buf);

    if (buf.length() <= 0)
      return;

    Element output = xsl.createElementNS(XSLNS, "xsl:output");
    parent.appendChild(output);
    output.setAttribute("media-type", buf.toString());
    delimScanner.skip(cursor);

    buf.clear();
    delimScanner.scan(cursor, buf);
    wsScanner.skip(cursor);
    if (cursor.current() == '=' && buf.toString().equals("charset")) {
      delimScanner.skip(cursor);
      buf.clear();
      delimScanner.scan(cursor, buf);
      if (buf.length() > 0) {
  output.setAttribute("encoding", Encoding.getMimeName(buf.toString()));
View Full Code Here

Examples of com.caucho.util.CharCursor

    String content = elt.getAttribute("content");
    if (http.equals("") || content.equals("") ||
  ! http.equalsIgnoreCase("content-type"))
      return;

    CharCursor cursor = new StringCharCursor(content);
    charsetScanner.scan(cursor);
    charsetScanner.skip(cursor);
    CharBuffer buf = CharBuffer.allocate();
    while (cursor.current() != cursor.DONE) {
      buf.clear();
      charsetScanner.scan(cursor, buf);
      if (buf.toString().equalsIgnoreCase("charset")) {
  charsetScanner.skip(cursor);
  buf.clear();
View Full Code Here

Examples of com.caucho.util.CharCursor

    String content = elt.getAttribute("content");
    if (http.equals("") || content.equals("") ||
        ! http.equalsIgnoreCase("content-type"))
      return;

    CharCursor cursor = new StringCharCursor(content);
    charsetScanner.scan(cursor);
    charsetScanner.skip(cursor);
    CharBuffer buf = CharBuffer.allocate();
    while (cursor.current() != cursor.DONE) {
      buf.clear();
      charsetScanner.scan(cursor, buf);
      if (buf.toString().equalsIgnoreCase("charset")) {
        charsetScanner.skip(cursor);
        buf.clear();
View Full Code Here

Examples of net.openhft.koloboke.collect.CharCursor

        }.test();
    }
    /* endwith */

    public void testIteratorNoSuchElementException() {
        CharCursor/*<>*/ cur = c().cursor();
        while (cur.moveNext());
        try {
            cur.elem();
            fail("cursor.elem() should throw IllegalStateException");
        } catch (IllegalStateException expected) {}
    }
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.