Package com.google.walkaround.proto.ProtocolDocumentOperation.Component

Examples of com.google.walkaround.proto.ProtocolDocumentOperation.Component.ReplaceAttributes


      @Override
      public void replaceAttributes(Attributes oldAttributes, Attributes newAttributes) {
        Component component =
            MessageFactoryHelper.createDocumentOperationComponent();
        ReplaceAttributes replace =
            MessageFactoryHelper.createDocumentReplaceAttributes();
        if (oldAttributes.isEmpty() && newAttributes.isEmpty()) {
          replace.setEmpty(true);
        } else {
          for (Map.Entry<String, String> e : oldAttributes.entrySet()) {
            replace.addOldAttribute(createKeyValuePair(e.getKey(), e.getValue()));
          }
          for (Map.Entry<String, String> e : newAttributes.entrySet()) {
            replace.addNewAttribute(createKeyValuePair(e.getKey(), e.getValue()));
          }
        }
        component.setReplaceAttributes(replace);
        mutation.addComponent(component);
      }
View Full Code Here


  }

  @Override
  public Attributes getReplaceAttributesNewAttributes(int i) {
    Component component = provider.getContent().getComponent(i);
    ReplaceAttributes r = component.getReplaceAttributes();
    return newAttributesFrom(r);
  }
View Full Code Here

  }

  @Override
  public Attributes getReplaceAttributesOldAttributes(int i) {
    Component component = provider.getContent().getComponent(i);
    ReplaceAttributes r = component.getReplaceAttributes();
    return oldAttributesFrom(r);
  }
View Full Code Here

      if (!component.getDeleteElementEnd()) {
        throw new DelayedInvalidInputException("Delete element end present but false: " + provider);
      }
      cursor.deleteElementEnd();
    } else if (component.hasReplaceAttributes()) {
      ReplaceAttributes r = component.getReplaceAttributes();
      cursor.replaceAttributes(oldAttributesFrom(r), newAttributesFrom(r));
    } else if (component.hasUpdateAttributes()) {
      UpdateAttributes r = component.getUpdateAttributes();
      cursor.updateAttributes(attributesUpdateFrom(r));
    } else {
View Full Code Here

TOP

Related Classes of com.google.walkaround.proto.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.