Package com.caucho.util

Examples of com.caucho.util.CharBuffer


  @Override
  public String generateJavaSelect(String id)
  {
    ArrayList<IdField> keys = getKeys();

    CharBuffer cb = CharBuffer.allocate();

    for (int i = 0; i < keys.size(); i++) {
      if (i != 0)
        cb.append(", ");

      cb.append(keys.get(i).generateJavaSelect(id));
    }

    return cb.close();
  }
View Full Code Here


   * Returns the key for the value
   */
  @Override
  public String generateGet(String value)
  {
    CharBuffer cb = CharBuffer.allocate();

    cb.append("__caucho_make_key_" + getForeignMakeKeyName());
    cb.append("(");

    ArrayList<IdField> keys = getKeys();

    for (int i = 0; i < keys.size(); i++) {
      if (i != 0)
        cb.append(", ");

      cb.append(keys.get(i).generateGet(value));
    }

    cb.append(")");

    return cb.close();
  }
View Full Code Here

  /**
   * Returns the key for the value
   */
  public String generateGetProxyProperty(String value)
  {
    CharBuffer cb = CharBuffer.allocate();

    cb.append("__caucho_make_key_" + getForeignMakeKeyName());
    cb.append("(");

    ArrayList<IdField> keys = getKeys();

    for (int i = 0; i < keys.size(); i++) {
      if (i != 0)
        cb.append(", ");

      cb.append(keys.get(i).generateGetProxyProperty(value));
    }

    cb.append(")");

    return cb.close();
  }
View Full Code Here

   */
  public String generateWhere(String id)
  {
    ArrayList<IdField> keys = getKeys();

    CharBuffer cb = CharBuffer.allocate();

    for (int i = 0; i < keys.size(); i++) {
      if (i != 0)
        cb.append(" and ");

      cb.append(keys.get(i).generateWhere(id));
    }

    return cb.close();
  }
View Full Code Here

   * Returns the text value of the element.  For an element, the text
   * value is the smashing together of all the child text nodes.
   */
  public String getTextValue()
  {
    CharBuffer cb = CharBuffer.allocate();

    for (QAbstractNode node = _firstChild; node != null; node = node._next) {
      cb.append(node.getTextValue());
    }

    return cb.close();
  }
View Full Code Here

    out.endElement(getNamespaceURI(), getLocalName(), getNodeName());
  }

  public String toString()
  {
    CharBuffer cb = CharBuffer.allocate();

    cb.append("Element[" + _name);

    for (QAttr attr = (QAttr) getFirstAttribute();
         attr != null;
         attr = (QAttr) attr.getNextSibling())
      cb.append(" " + attr);
    cb.append("]");

    return cb.close();
  }
View Full Code Here

  public static String escapeXml(String string)
  {
    if (string == null)
      return "";

    CharBuffer cb = CharBuffer.allocate();

    for (int i = 0; i < string.length(); i++) {
      int ch = string.charAt(i);

      switch (ch) {
      case '<':
        cb.append("&lt;");
        break;
      case '>':
        cb.append("&gt;");
        break;
      case '&':
        cb.append("&amp;");
        break;
      case '\'':
        cb.append("&#039;");
        break;
      case '"':
        cb.append("&#034;");
        break;
      default:
        cb.append((char) ch);
        break;
      }
    }

    return cb.close();
  }
View Full Code Here

      return "";

    if (sep == null)
      sep = "";

    CharBuffer result = CharBuffer.allocate();

    for (int i = 0; i < array.length; i++) {
      if (i != 0)
        result.append(sep);

      result.append(array[i]);
    }

    return result.close();
  }
View Full Code Here

      return input;

    if (after == null)
      after = "";

    CharBuffer result = CharBuffer.allocate();

    int head = 0;
    int next;
    while ((next = input.indexOf(before, head)) >= 0) {
      result.append(input.substring(head, next));

      result.append(after);

      head = next + before.length();
    }

    result.append(input.substring(head));

    return result.close();
  }
View Full Code Here

  {
    super.init();
   
    _attributes = new QAttributes();
    _nullAttributes = new QAttributes();
    _eltName = new CharBuffer();
    _text = new CharBuffer();

    _textLength = 0;
    _isIgnorableWhitespace = true;
    _elementTop = 0;
    _elementLines[0] = 1;
View Full Code Here

TOP

Related Classes of com.caucho.util.CharBuffer

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.