Package org.waveprotocol.wave.model.document.operation.impl

Examples of org.waveprotocol.wave.model.document.operation.impl.AttributesImpl


      public <N, E extends N, T extends N> void exec(ObservableMutableDocument<N, E, T> doc) {
        E container = doc.getDocumentElement();

        // Insert entries
        Attributes attrs =
            state != null ? new AttributesImpl(VALUE_ATTR, state.toString()) : Attributes.EMPTY_MAP;
        doc.createChildElement(container, ENTRY_TAG, attrs);
      }
    });
  }
View Full Code Here


        }

        for (Boolean b : state) {
          assertNotNull(entry);
          Attributes attrs =
              b != null ? new AttributesImpl(VALUE_ATTR, b.toString()) : Attributes.EMPTY_MAP;
          assertEquals(attrs, doc.getAttributes(entry));

          entry = DocHelper.getNextSiblingElement(doc, entry);
          // Skip over anything we don't care about
          while (entry != null && !ENTRY_TAG.equals(doc.getTagName(entry))) {
View Full Code Here

    // Insert entries
    for (Entry<String, Integer> e : values.build()) {
      Map<String, String> attrs = new HashMap<String, String>();
      attrs.put(KEY_ATTR, e.key);
      attrs.put(VALUE_ATTR, Serializer.INTEGER.toString(e.value));
      doc.createChildElement(container, ENTRY_TAG, new AttributesImpl(attrs));
    }

    return new ValueContext<N, E>(doc, container);
  }
View Full Code Here

      Map<String, String> attrs = new HashMap<String, String>();
      attrs.put(KEY_ATTR, keySerializer.toString(key));
      attrs.put(VALUE_ATTR, valueSerializer.toString(value));
      E child = context.doc.createElement(Point.start(context.doc, context.container),
                                          ENTRY_TAG,
                                          new AttributesImpl(attrs));
    }
View Full Code Here

    }

    void addEntry(K key, C value) {
      String keyString = keySerializer.toString(key);
      String valueString = valueSerializer.toString(value);
      Attributes attrs = new AttributesImpl(KEY_ATTR, keyString, VALUE_ATTR, valueString);
      E child = context.doc.createChildElement(context.container, ENTRY_TAG, attrs);
    }
View Full Code Here

      int ... values) {
    // Insert container element
    E container = doc.createChildElement(doc.getDocumentElement(), CONTAINER_TAG,
        Collections.<String,String>emptyMap());
    for (int value : values) {
      Attributes attrs = new AttributesImpl(VALUE_ATTR, Serializer.INTEGER.toString(value));
      doc.createChildElement(container, ENTRY_TAG, attrs);
    }
    return new ValueContext<N, E>(doc, container);
  }
View Full Code Here

    // Insert entries
    for (Integer x : values) {
      Map<String, String> attrs = new HashMap<String, String>();
      attrs.put(VALUE_ATTR, Serializer.INTEGER.toString(x));
      doc.createChildElement(container, ENTRY_TAG, new AttributesImpl(attrs));
    }

    return new ValueContext<N, E>(doc, container);
  }
View Full Code Here

    void addEntry(C value) {
      Map<String, String> attrs = new HashMap<String, String>();
      attrs.put(VALUE_ATTR, serializer.toString(value));
      E child =
          context.doc.createChildElement(context.container, ENTRY_TAG, new AttributesImpl(attrs));
    }
View Full Code Here

    // Insert entries
    for (Entry<String, Integer> e : values.build()) {
      Map<String, String> attrs = new HashMap<String, String>();
      attrs.put(KEY_ATTR, e.key);
      attrs.put(VALUE_ATTR, Serializer.INTEGER.toString(e.value));
      doc.createChildElement(container, ENTRY_TAG, new AttributesImpl(attrs));
    }

    return new ValueContext<N, E>(doc, container);
  }
View Full Code Here

   * @param cursor Cursor to write results out to.
   * @param recurse Whether or not to write children to the operation.
   */
  public static <N, E extends N, T extends N> void buildDomInitializationFromElement(
      ReadableDocument<N, E, T> doc, E element, DocInitializationCursor cursor, boolean recurse) {
    cursor.elementStart(doc.getTagName(element), new AttributesImpl(doc.getAttributes(element)));
    if (recurse) {
      for (N child = doc.getFirstChild(element); child != null; child = doc.getNextSibling(child)) {
        buildDomInitializationFromSubtree(doc, child, cursor);
      }
    }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.operation.impl.AttributesImpl

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.