Package com.google.gdata.util.common.xml

Examples of com.google.gdata.util.common.xml.XmlWriter


      this.xmlBlob = xmlBlob;
      this.mixedContent = mixedContent;
      this.innerXmlStringWriter = new StringWriter();
      try {
        this.innerXml = new XmlWriter(innerXmlStringWriter);
       
        // The XmlWriter constructor doesn't actually throw an IOException, so
        // once that constructor is fixed we can remove this catch block.
      } catch (IOException impossible) {
        throw new AssertionError(impossible);
View Full Code Here


    ParseSource resultEntrySource = null;
    try {
      startVersionScope();
      GDataRequest request = createInsertRequest(feedUrl);
      XmlWriter xw = request.getRequestWriter();
      entry.generateAtom(xw, extProfile);
      xw.flush();

      request.execute();

      resultEntrySource = request.getParseSource();
      return (E) parseEntry(entry.getClass(), resultEntrySource);
View Full Code Here

      throws IOException, ServiceException, BatchInterruptedException {
    ParseSource resultFeedSource = null;
    GDataRequest request = createInsertRequest(feedUrl);
    try {
      startVersionScope();
      XmlWriter xw = request.getRequestWriter();
      inputFeed.generateAtom(xw, extProfile);
      xw.flush();

      request.execute();

      resultFeedSource = request.getParseSource();
      F resultFeed =
View Full Code Here

    try {
      startVersionScope();
      request.setEtag(etag);
     
      // Send the entry
      XmlWriter xw = request.getRequestWriter();
      entry.generateAtom(xw, extProfile);
      xw.flush();

      // Execute the request
      request.execute();

      // Handle the update
View Full Code Here


  public XmlWriter getRequestWriter() throws IOException {
    OutputStream requestStream = getRequestStream();
    Writer writer = new OutputStreamWriter(requestStream, "utf-8");
    return new XmlWriter(writer);
  }
View Full Code Here

  protected String getXmlOutput(GsaEntry entry) throws IOException {
    if (entry == null) {
      return null;
    }
    StringWriter stringWriter = new StringWriter();
    XmlWriter xmlWriter = new XmlWriter(stringWriter);
    entry.generate(xmlWriter, new ExtensionProfile());
   
    return stringWriter.toString();
  }
View Full Code Here

  protected String getXmlOutput(GsaFeed feed) throws IOException {
    if (feed == null) {
      return null;
    }
    StringWriter stringWriter = new StringWriter();
    XmlWriter xmlWriter = new XmlWriter(stringWriter);
    feed.generate(xmlWriter, new ExtensionProfile());
   
    return stringWriter.toString();
  }
View Full Code Here

    XmlBlob cumulative = new XmlBlob();
    Collection<XmlNamespace> namespaces = cumulative.getNamespaces();

    StringWriter w = new StringWriter();
    XmlWriter xw = new XmlWriter(w);

    if (xmlBlob != null) {
      cumulative.setLang(xmlBlob.getLang());
      cumulative.setBase(xmlBlob.getBase());
      namespaces.addAll(xmlBlob.getNamespaces());
      w.write(xmlBlob.getBlob());
    }

    if (manifest != null) {
      for (XmlNamespace ns : manifest.getNamespaceDecls()) {
        XmlNamespace newNs = new XmlNamespace(ns.getAlias(), ns.getUri());
        if (!namespaces.contains(newNs)) {
          namespaces.add(newNs);
        }
      }
    }

    for (Extension ext : nonRepeatingExtensionMap.values()) {
      ext.generate(xw, extProfile);
    }

    for (List<Extension> extList : repeatingExtensionMap.values()) {
      xw.startRepeatingElement();
      for (Extension ext : extList) {
        ext.generate(xw, extProfile);
      }
      xw.endRepeatingElement();
    }

    cumulative.setBlob(w.toString());
    return cumulative;
  }
View Full Code Here

    nonRepeatingExtensionMap.clear();
    repeatingExtensionMap.clear();

    // Prepare a fake XML document from the blob.
    StringWriter sw = new StringWriter();
    XmlWriter w = new XmlWriter(sw);
    XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null);
    XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob);

    // Now parse it.
    StringReader sr = new StringReader(sw.toString());
View Full Code Here

    }
  
    private String buildContent() throws IOException {
        StringWriter writer = new StringWriter();
        XmlWriter xmlWriter = new XmlWriter(writer, INTERNAL_ENCODING);
        this.entry.generateAtom(xmlWriter, this.config.getExtensionProfile());
        return writer.toString();

    }
View Full Code Here

TOP

Related Classes of com.google.gdata.util.common.xml.XmlWriter

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.