Package org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.ReplaceAttributes


        output.deleteElementStart(c.getDeleteElementStart().getType(), new AttributesImpl(
            deserialize(c.getDeleteElementStart().getAttribute())));
      } else if (c.hasDeleteElementEnd()) {
        output.deleteElementEnd();
      } else if (c.hasReplaceAttributes()) {
        ReplaceAttributes r = c.getReplaceAttributes();
        if (r.getEmpty()) {
          output.replaceAttributes(AttributesImpl.EMPTY_MAP, AttributesImpl.EMPTY_MAP);
        } else {
          output.replaceAttributes(new AttributesImpl(deserialize(r.getOldAttribute())),
              new AttributesImpl(deserialize(r.getNewAttribute())));
        }
      } else if (c.hasUpdateAttributes()) {
        UpdateAttributes u = c.getUpdateAttributes();
        if (u.getEmpty()) {
          output.updateAttributes(AttributesUpdateImpl.EMPTY_MAP);
View Full Code Here


        addComponent().setDeleteElementEnd(true);
      }

      @Override
      public void replaceAttributes(Attributes oldAttributes, Attributes newAttributes) {
        ReplaceAttributes r = ReplaceAttributesJsoImpl.create();
        if (oldAttributes.isEmpty() && newAttributes.isEmpty()) {
          r.setEmpty(true);
        } else {
          for (String name : oldAttributes.keySet()) {
            r.addOldAttribute(keyValuePair(name, oldAttributes.get(name)));
          }

          for (String name : newAttributes.keySet()) {
            r.addNewAttribute(keyValuePair(name, newAttributes.get(name)));
          }
        }
        addComponent().setReplaceAttributes(r);
      }
View Full Code Here

        return this;
      }

      /** Builds a {@link ReplaceAttributes} using this builder and a factory. */
      public ReplaceAttributes build(Factory factory) {
        ReplaceAttributes message = factory.create();
        message.setEmpty(empty);
        message.clearOldAttribute();
        message.addAllOldAttribute(oldAttribute);
        message.clearNewAttribute();
        message.addAllNewAttribute(newAttribute);
        return message;
      }
View Full Code Here

        output.deleteElementStart(c.getDeleteElementStart().getType(), new AttributesImpl(
            deserialize(c.getDeleteElementStart().getAttribute())));
      } else if (c.hasDeleteElementEnd()) {
        output.deleteElementEnd();
      } else if (c.hasReplaceAttributes()) {
        ReplaceAttributes r = c.getReplaceAttributes();
        if (r.getEmpty()) {
          output.replaceAttributes(AttributesImpl.EMPTY_MAP, AttributesImpl.EMPTY_MAP);
        } else {
          output.replaceAttributes(new AttributesImpl(deserialize(r.getOldAttribute())),
              new AttributesImpl(deserialize(r.getNewAttribute())));
        }
      } else if (c.hasUpdateAttributes()) {
        UpdateAttributes u = c.getUpdateAttributes();
        if (u.getEmpty()) {
          output.updateAttributes(AttributesUpdateImpl.EMPTY_MAP);
View Full Code Here

        addComponent().setDeleteElementEnd(true);
      }

      @Override
      public void replaceAttributes(Attributes oldAttributes, Attributes newAttributes) {
        ReplaceAttributes r = ReplaceAttributesJsoImpl.create();
        if (oldAttributes.isEmpty() && newAttributes.isEmpty()) {
          r.setEmpty(true);
        } else {
          for (String name : oldAttributes.keySet()) {
            r.addOldAttribute(keyValuePair(name, oldAttributes.get(name)));
          }

          for (String name : newAttributes.keySet()) {
            r.addNewAttribute(keyValuePair(name, newAttributes.get(name)));
          }
        }
        addComponent().setReplaceAttributes(r);
      }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.federation.ProtocolDocumentOperation.Component.ReplaceAttributes

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.