Examples of ElementStart


Examples of com.google.walkaround.proto.GoogleImport.GoogleDocumentContent.ElementStart

    if (component.hasAnnotationBoundary()) {
      out.annotationBoundary(annotationBoundaryFrom(component.getAnnotationBoundary()));
    } else if (component.hasCharacters()) {
      out.characters(component.getCharacters());
    } else if (component.hasElementStart()) {
      ElementStart elementStart = component.getElementStart();
      out.elementStart(elementStart.getType(), attributesFrom(elementStart));
    } else if (component.hasElementEnd()) {
      if (!component.getElementEnd()) {
        throw new InvalidInputException("Element end present but false: " + component);
      }
      out.elementEnd();
View Full Code Here

Examples of com.google.walkaround.proto.GoogleImport.GoogleDocumentContent.ElementStart

    Preconditions.checkNotNull(keyAttributeName, "Null keyAttributeName");
    Preconditions.checkNotNull(valueAttributeName, "Null valueAttributeName");
    Map<String, String> out = Maps.newHashMap();
    for (Component component : doc.getComponentList()) {
      if (component.hasElementStart()) {
        ElementStart start = component.getElementStart();
        Assert.check(elementType.equals(start.getType()), "Unexpected element type: %s", doc);
        Map<String, String> attrs = Maps.newHashMap();
        for (KeyValuePair attr : start.getAttributeList()) {
          attrs.put(attr.getKey(), attr.getValue());
        }
        Assert.check(attrs.size() == 2, "Need two attrs: %s", doc);
        String key = attrs.get(keyAttributeName);
        String value = attrs.get(valueAttributeName);
View Full Code Here

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

    }
    return attribute;
  }

  private static ElementStart createElementStart(String type, Attributes attrs) {
    ElementStart elementStart = MessageFactoryHelper.createDocumentElementStart();
    elementStart.setType(type);
    for (Map.Entry<String, String> attribute : attrs.entrySet()) {
      elementStart.addAttribute(
          createKeyValuePair(attribute.getKey(), attribute.getValue()));
    }
    return elementStart;
  }
View Full Code Here

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

  }

  @Override
  public Attributes getDeleteElementStartAttributes(int i) {
    Component component = provider.getContent().getComponent(i);
    ElementStart elementStart = component.getDeleteElementStart();
    return attributesFrom(elementStart);
  }
View Full Code Here

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

  }

  @Override
  public String getDeleteElementStartTag(int i) {
    Component component = provider.getContent().getComponent(i);
    ElementStart elementStart = component.getDeleteElementStart();
    return elementStart.getType();
  }
View Full Code Here

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

  }

  @Override
  public Attributes getElementStartAttributes(int i) {
    Component component = provider.getContent().getComponent(i);
    ElementStart elementStart = component.getElementStart();
    return attributesFrom(elementStart);
  }
View Full Code Here

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

  }

  @Override
  public String getElementStartTag(int i) {
    Component component = provider.getContent().getComponent(i);
    ElementStart elementStart = component.getElementStart();
    return elementStart.getType();
  }
View Full Code Here

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

    } else if (component.hasCharacters()) {
      cursor.characters(component.getCharacters());
    } else if (component.hasDeleteCharacters()) {
      cursor.deleteCharacters(component.getDeleteCharacters());
    } else if (component.hasElementStart()) {
      ElementStart elementStart = component.getElementStart();
      cursor.elementStart(elementStart.getType(), attributesFrom(elementStart));
    } else if (component.hasElementEnd()) {
      if (!component.getElementEnd()) {
        throw new DelayedInvalidInputException("Element end present but false: " +
            provider.getContent());
      }
      cursor.elementEnd();
    } else if (component.hasDeleteElementStart()) {
      ElementStart elementStart = component.getDeleteElementStart();
      cursor.deleteElementStart(elementStart.getType(), attributesFrom(elementStart));
    } else if (component.hasDeleteElementEnd()) {
      if (!component.getDeleteElementEnd()) {
        throw new DelayedInvalidInputException("Delete element end present but false: " + provider);
      }
      cursor.deleteElementEnd();
View Full Code Here

Examples of org.apache.garbage.tree.ElementStart

/**
* Parse an element (<code>&lt;name ...&gt;</code>, <code>&lt;name
* .../&gt;</code> or <code>&lt;/name &gt;</code>) declaration.
*/
  final public void p_element(Events events) throws ParseException {
  ElementStart element = null;
  String name = null;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case T_ELEMENT_CLOSE:
      jj_consume_token(T_ELEMENT_CLOSE);
      events.append(new ElementEnd(this, token.image.substring(2)));
      jj_consume_token(T_ELEMENT_END);
      break;
    case T_ELEMENT_OPEN:
      jj_consume_token(T_ELEMENT_OPEN);
      name = token.image.substring(1);
      element = new ElementStart(this, name);
      label_2:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case T_ATTRIBUTE:
          ;
View Full Code Here

Examples of org.waveprotocol.wave.federation.Proto.ProtocolDocumentOperation.Component.ElementStart

      ProtocolWaveletOperation op = delta.getOperation(i);
      if (op.hasMutateDocument()) {
        MutateDocument doc = op.getMutateDocument();
        for (int c = 0; c < doc.getDocumentOperation().getComponentCount(); c++) {
          Component comp = doc.getDocumentOperation().getComponent(c);
          ElementStart start = comp.getElementStart();
          if (ImageConstants.TAGNAME.equals(start.getType())) {
            for (int a=0; a < start.getAttributeCount(); a++) {
              Component.KeyValuePair attr = start.getAttribute(a);
              if (ImageConstants.ATTACHMENT_ATTRIBUTE.equals(attr.getKey())) {
                try {
                  ids.add(AttachmentId.deserialise(attr.getValue()));
                } catch (InvalidIdException ex) {
                  Console.error("Invalid attachment Id " + attr.getValue(), ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.