Package org.waveprotocol.wave.model.document.Doc

Examples of org.waveprotocol.wave.model.document.Doc.E


   */
  @VisibleForTesting
  public static <E> DocumentBasedManifest createNew(
      ObservableMutableDocument<? super E, E, ?> doc) {
    // If the precondition holds then the document must be empty.
    E top = DocHelper.createFirstTopLevelElement(doc, MANIFEST_TOP_TAG);
    DocumentEventRouter<? super E, E, ?> router = DefaultDocumentEventRouter.create(doc);
    return new DocumentBasedManifest(
        DocumentBasedManifestThread.create(router, top),
        DocumentBasedStructuredValue.create(router, top, Serializer.STRING, AnchorKey.class));
  }
View Full Code Here


    this.wavelet = wavelet;
    parse(doc);
  }

  private void parse(Document doc) {
    E bodyElement = Blips.getBody(doc);
    if (bodyElement != null) {
      N child = doc.getFirstChild(bodyElement);
      while (child != null) {
        T asText = doc.asText(child);
        int xmlPos = doc.getLocation(child);
        if (asText != null) {
          bits.add(new Bit(doc.getData(asText), xmlPos));
        } else {
          E xmlElement = doc.asElement(child);
          if (xmlElement != null) {
            Element element = ElementSerializer.xmlToApiElement(doc, xmlElement, wavelet);
            // element can be null, but we still want to note that there
            // was something unknown.
            N next = doc.getNextSibling(child);
View Full Code Here

    if (node != null) {
      // The node is the body; we're after its children
      node = doc.getFirstChild(node);
    }
    while (node != null) {
      E element = doc.asElement(node);
      if (element != null) {
        Element apiElement = xmlToApiElement(doc, element, wavelet);
        if (apiElement != null) {
          result.put(apiView.transformToTextOffset(doc.getLocation(element)), apiElement);
        }
View Full Code Here

    checkNotNull(conv, "Null conv");
    Document manifest = getDoc(conv, IdConstants.MANIFEST_DOCUMENT_ID);
    if (manifest == null) {
      return "";
    }
    E blipElem = DocHelper.getElementWithTagName(manifest, "blip");
    if (blipElem == null) {
      return "";
    }
    String rootBlipId = manifest.getAttribute(blipElem, "id");
View Full Code Here

   */
  @VisibleForTesting
  public static <E> DocumentBasedManifest createNew(
      ObservableMutableDocument<? super E, E, ?> doc) {
    // If the precondition holds then the document must be empty.
    E top = DocHelper.createFirstTopLevelElement(doc, MANIFEST_TOP_TAG);
    DocumentEventRouter<? super E, E, ?> router = DefaultDocumentEventRouter.create(doc);
    return new DocumentBasedManifest(
        DocumentBasedManifestThread.create(router, top),
        DocumentBasedStructuredValue.create(router, top, Serializer.STRING, AnchorKey.class));
  }
View Full Code Here

    if (node != null) {
      // The node is the body; we're after its children
      node = doc.getFirstChild(node);
    }
    while (node != null) {
      E element = doc.asElement(node);
      if (element != null) {
        Element apiElement = xmlToApiElement(doc, element, wavelet);
        if (apiElement != null) {
          result.put(apiView.transformToTextOffset(doc.getLocation(element)), apiElement);
        }
View Full Code Here

    this.wavelet = wavelet;
    parse(doc);
  }

  private void parse(Document doc) {
    E bodyElement = Blips.getBody(doc);
    if (bodyElement != null) {
      N child = doc.getFirstChild(bodyElement);
      while (child != null) {
        T asText = doc.asText(child);
        int xmlPos = doc.getLocation(child);
        if (asText != null) {
          bits.add(new Bit(doc.getData(asText), xmlPos));
        } else {
          E xmlElement = doc.asElement(child);
          if (xmlElement != null) {
            Element element = ElementSerializer.xmlToApiElement(doc, xmlElement, wavelet);
            // element can be null, but we still want to note that there
            // was something unknown.
            N next = doc.getNextSibling(child);
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.Doc.E

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.