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

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


  public void generateConfig(XmlWriter w,
                             ExtensionProfile extProfile) throws IOException {


    List<Attribute> epAttrs = new ArrayList<Attribute>();
    epAttrs.add(new Attribute("arbitraryXml", allowsArbitraryXml));
    w.startElement(Namespaces.gdataConfigNs, "extensionProfile", epAttrs,
        nsDecls);

    for (XmlNamespace namespace : additionalNamespaces) {

      List<Attribute> nsAttrs = new ArrayList<Attribute>();
      nsAttrs.add(new Attribute("alias", namespace.getAlias()));
      nsAttrs.add(new Attribute("uri", namespace.getUri()));
      w.simpleElement(Namespaces.gdataConfigNs, "namespaceDescription",
                      nsAttrs, null);
    }

    //
    // Get a list of the extended classes sorted by class name
    //
    TreeSet<Class<?>> extensionSet = new TreeSet<Class<?>>(
        new Comparator<Class<?>>() {
          public int compare(Class<?> c1, Class<?> c2) {
            return c1.getName().compareTo(c2.getName());
          }
         
          @Override
          public boolean equals(Object c) {
            return this.getClass().equals(c.getClass());
          }
        });

    for (Class<?> extensionPoint : profile.keySet()) {
      extensionSet.add(extensionPoint);
    }

    for (Class<?> extensionPoint : extensionSet) {

      ExtensionManifest  manifest = profile.get(extensionPoint);

      List<Attribute> ptAttrs = new ArrayList<Attribute>();
      ptAttrs.add(new Attribute("extendedClass", extensionPoint.getName()));
      ptAttrs.add(new Attribute("arbitraryXml", manifest.arbitraryXml));
      w.startElement(Namespaces.gdataConfigNs, "extensionPoint", ptAttrs, null);

      // Create an ordered list of the descriptions in this profile
      TreeSet<ExtensionDescription> descSet =
        new TreeSet<ExtensionDescription>();
View Full Code Here


   */
  public void generateConfig(XmlWriter w,
                             ExtensionProfile extProfile) throws IOException {

    List<Attribute> attrs = new ArrayList<Attribute>();
    attrs.add(new Attribute("namespace", namespace.getUri()));
    attrs.add(new Attribute("localName", localName));
    attrs.add(new Attribute("extensionClass", extensionClass.getName()));
    attrs.add(new Attribute("required", required));
    attrs.add(new Attribute("repeatable", repeatable));
    attrs.add(new Attribute("aggregate", aggregate));
    generateStartElement(w, Namespaces.gdataConfigNs, "extensionDescription",
                         attrs, null);

    generateExtensions(w, extProfile);

View Full Code Here

    generateStartElement(w, Namespaces.rssNs, "item", null, nsDecls);

    if (state.id != null) {
      List<Attribute> attrs = new ArrayList<Attribute>(1);
      attrs.add(new Attribute("isPermaLink", "false"));
      w.simpleElement(Namespaces.rssNs, "guid", attrs, state.id);
    }

    String lang = null;
View Full Code Here

          ElementMetadata<?, ?> metadata) {
        List<Attribute> attrs = super.getAttributes(e, metadata);
        if (attrs == null) {
          attrs = Lists.newArrayListWithExpectedSize(1);
        }
        attrs.add(new Attribute("isPermaLink", "false"));
        return attrs;
      }
    });
    registry.build(Entry.KEY, Entry.ID, RSS)
        .setName(GUID)
View Full Code Here

            getNamespaces(parent, e, metadata);
        List<XmlWriter.Attribute> attrs = getAttributes(e, metadata);
        if (attrs == null) {
          attrs = Lists.newArrayList();
        }
        attrs.add(new Attribute("version", "2.0"));

        xw.startElement(Namespaces.rssNs, "rss", attrs, namespaces);
        xw.startElement(Namespaces.rssNs, "channel", null, null);

        if (!e.hasElement(Source.SUBTITLE) && !e.hasElement(Content.KEY)) {
View Full Code Here

    generateStartElement(w, Namespaces.rssNs, "item", null, nsDecls);

    if (state.id != null) {
      List<Attribute> attrs = new ArrayList<Attribute>(1);
      attrs.add(new Attribute("isPermaLink", "false"));
      w.simpleElement(Namespaces.rssNs, "guid", attrs, state.id);
    }

    String lang = null;
View Full Code Here

TOP

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

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.