Package org.apache.vinci.transport

Examples of org.apache.vinci.transport.FrameComponent


   *         indicates no such key).
   *
   * @pre key != null
   */
  public Attributes aget(String key) {
    FrameComponent comp = fgetFirst(key);
    if (comp != null) {
      Attributes not_null = comp.getAttributes();
      if (not_null == null) {
        return new Attributes();
      } else {
        return not_null;
      }
View Full Code Here


   *         indicates no such key).
   *
   * @pre key != null
   */
  public Attributes aget(String key) {
    FrameComponent comp = fgetFirst(key);
    if (comp != null) {
      Attributes not_null = comp.getAttributes();
      if (not_null == null) {
        return new Attributes();
      } else {
        return not_null;
      }
View Full Code Here

    for (int i = 0; i < count; i++) {
      KeyValuePair kvp = aFrame.getKeyValuePair(i);
      boolean isIndexed = false;

      FrameComponent val = kvp.getValue();

      // read attributes
      AttributesImpl attrs = new AttributesImpl();

      Attributes vinciAttrs = null;
      if (val instanceof AFrame) {
        vinciAttrs = ((AFrame) val).getAttributes();
      } else if (val instanceof AFrameLeaf) {
        vinciAttrs = ((AFrameLeaf) val).getAttributes();
      }

      if (vinciAttrs != null) {
        for (int j = 0; j < vinciAttrs.getKeyValuePairCount(); j++) {
          KeyValuePair attr = vinciAttrs.getKeyValuePair(j);
          String attrName = attr.getKey();
          String attrVal = attr.getValueAsString();
          attrs.addAttribute("", attrName, attrName, "CDATA", attrVal);
          if (attrName.equals("_indexed")) {
            isIndexed = true;
          }
        }
      }

      // Kludge: all annotations returned from Vinci service are "indexed"
      // (but not array elements!)
      if (!isIndexed && !kvp.getKey().equals("i")) {
        attrs.addAttribute("", "_indexed", "_indexed", "CDATA", "true");
      }

      mHandler.startElement("", kvp.getKey(), kvp.getKey(), attrs);
      if (val instanceof FrameLeaf) {
        String leafString = ((FrameLeaf) val).toString();
        mHandler.characters(leafString.toCharArray(), 0, leafString.length());
      } else if (val instanceof VinciFrame) {
        _parse((VinciFrame) val);
      } else {
        throw new SAXException("Expected FrameLeaf or VinciFrame, found " + val.getClass());
      }
      mHandler.endElement("", kvp.getKey(), kvp.getKey());
    }
  }
View Full Code Here

   *         indicates no such key).
   *
   * @pre key != null
   */
  public Attributes aget(String key) {
    FrameComponent comp = fgetFirst(key);
    if (comp != null) {
      Attributes not_null = comp.getAttributes();
      if (not_null == null) {
        return new Attributes();
      } else {
        return not_null;
      }
View Full Code Here

TOP

Related Classes of org.apache.vinci.transport.FrameComponent

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.