@Override public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); // Add any feed-level extension declarations here. }
/** * Generates the atom output for a feed using the given xml writer and * extension profile. */ public static void generateAtom(XmlWriter writer, IFeed feed, ExtensionProfile extProfile) throws IOException { if (feed instanceof BaseFeed) { ((BaseFeed<?, ?>) feed).generateAtom(writer, extProfile); } else { } } }
/** * Generates XML in the Atom format. * * @param w * Output writer. * * @param extProfile * Extension profile. * * @throws IOException */ @Override public void generateAtom(XmlWriter w, ExtensionProfile extProfile) throws IOException { generateFeedStart(extProfile, w, null); generateEntries(w, extProfile); generateFeedEnd(w); }
putAttributes(generator); generateAttributes(attrs, generator); generateStartElement(w, Namespaces.atomNs, "feed", attrs, nsDecls); generateInnerAtom(w, extProfile); if (getTotalResults() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "totalResults", null, String.valueOf(feedState.totalResults)); if (getStartIndex() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "startIndex", null, String.valueOf(feedState.startIndex)); if (getItemsPerPage() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "itemsPerPage", null, String.valueOf(feedState.itemsPerPage)); generateExtensions(w, extProfile);
generateStartElement(w, Namespaces.rssNs, "channel", null, null); Link htmlLink = getHtmlLink(); if (htmlLink != null) { w.simpleElement(Namespaces.rssNs, "link", null, htmlLink.getHref()); if (getTotalResults() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "totalResults", null, String.valueOf(feedState.totalResults)); if (getStartIndex() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "startIndex", null, String.valueOf(feedState.startIndex)); if (getItemsPerPage() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "itemsPerPage", null, String.valueOf(feedState.itemsPerPage)); generateExtensions(w, extProfile); w.startRepeatingElement(); for (E entry : entries) {
/** * {@inheritDoc} * <p> * The implementation of this method for BaseFeed will declare any * extensions associated with the contained entry type. */ @Override public void declareExtensions(ExtensionProfile extProfile) { // Create an instance of the associated entry class and declare its // extensions. E entry = createEntry(); extProfile.addDeclarations(entry); }
@Override public void generateXml(XmlWriter xw, OutputProperties outProps, IAtom source) throws IOException { if (source instanceof IFeed) { IFeed feed = (IFeed) source; if (feed instanceof BaseFeed) { ((BaseFeed<?, ?>) feed).generateRss(xw, outProps.getExtensionProfile()); } else { throw new IllegalArgumentException( "Feed was not an instance of BaseFeed"); } } else if (source instanceof IEntry) { IEntry entry = (IEntry) source; if (entry instanceof BaseEntry) { ((BaseEntry<?>) entry).generateRss(xw, outProps.getExtensionProfile()); } else { throw new IllegalArgumentException( "Entry was not an instance of BaseEntry"); } } else { throw new IllegalStateException("Unexpected source type: " + source); } } }
putAttributes(generator); generateAttributes(attrs, generator); generateStartElement(w, Namespaces.atomNs, "feed", attrs, nsDecls); generateInnerAtom(w, extProfile); if (getTotalResults() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "totalResults", null, String.valueOf(feedState.totalResults)); if (getStartIndex() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "startIndex", null, String.valueOf(feedState.startIndex)); if (getItemsPerPage() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "itemsPerPage", null, String.valueOf(feedState.itemsPerPage)); generateExtensions(w, extProfile);
generateStartElement(w, Namespaces.rssNs, "channel", null, null); Link htmlLink = getHtmlLink(); if (htmlLink != null) { w.simpleElement(Namespaces.rssNs, "link", null, htmlLink.getHref()); if (getTotalResults() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "totalResults", null, String.valueOf(feedState.totalResults)); if (getStartIndex() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "startIndex", null, String.valueOf(feedState.startIndex)); if (getItemsPerPage() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "itemsPerPage", null, String.valueOf(feedState.itemsPerPage)); generateExtensions(w, extProfile); w.startRepeatingElement(); for (E entry : entries) {
/** * {@inheritDoc} * <p> * The implementation of this method for BaseFeed will declare any * extensions associated with the contained entry type. */ @Override public void declareExtensions(ExtensionProfile extProfile) { // Create an instance of the associated entry class and declare its // extensions. E entry = createEntry(); extProfile.addDeclarations(entry); }
@Override public void generateXml(XmlWriter xw, OutputProperties outProps, IAtom source) throws IOException { if (source instanceof IFeed) { IFeed feed = (IFeed) source; if (feed instanceof BaseFeed) { ((BaseFeed<?, ?>) feed).generateRss(xw, outProps.getExtensionProfile()); } else { throw new IllegalArgumentException( "Feed was not an instance of BaseFeed"); } } else if (source instanceof IEntry) { IEntry entry = (IEntry) source; if (entry instanceof BaseEntry) { ((BaseEntry<?>) entry).generateRss(xw, outProps.getExtensionProfile()); } else { throw new IllegalArgumentException( "Entry was not an instance of BaseEntry"); } } else { throw new IllegalStateException("Unexpected source type: " + source); } } }
@Override public void declareExtensions(ExtensionProfile extProfile) { // Add any feed-level extension declarations here. super.declareExtensions(extProfile); }
putAttributes(generator); generateAttributes(attrs, generator); generateStartElement(w, Namespaces.atomNs, "feed", attrs, nsDecls); generateInnerAtom(w, extProfile); if (getTotalResults() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "totalResults", null, String.valueOf(feedState.totalResults)); if (getStartIndex() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "startIndex", null, String.valueOf(feedState.startIndex)); if (getItemsPerPage() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "itemsPerPage", null, String.valueOf(feedState.itemsPerPage)); generateExtensions(w, extProfile);
generateStartElement(w, Namespaces.rssNs, "channel", null, null); Link htmlLink = getHtmlLink(); if (htmlLink != null) { w.simpleElement(Namespaces.rssNs, "link", null, htmlLink.getHref()); if (getTotalResults() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "totalResults", null, String.valueOf(feedState.totalResults)); if (getStartIndex() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "startIndex", null, String.valueOf(feedState.startIndex)); if (getItemsPerPage() != Query.UNDEFINED) { w.simpleElement(openSearchNs, "itemsPerPage", null, String.valueOf(feedState.itemsPerPage)); generateExtensions(w, extProfile); w.startRepeatingElement(); for (E entry : entries) {
/** * Generates XML in the Atom format. * * @param w * Output writer. * * @param extProfile * Extension profile. * * @throws IOException */ @Override public void generateAtom(XmlWriter w, ExtensionProfile extProfile) throws IOException { generateFeedStart(extProfile, w, null); generateEntries(w, extProfile); generateFeedEnd(w); }
/** * Generates the atom output for a feed using the given xml writer and * extension profile. */ public static void generateAtom(XmlWriter writer, IFeed feed, ExtensionProfile extProfile) throws IOException { if (feed instanceof BaseFeed) { ((BaseFeed<?, ?>) feed).generateAtom(writer, extProfile); } else { } } }
/** * {@inheritDoc} * <p> * The implementation of this method for BaseFeed will declare any * extensions associated with the contained entry type. */ @Override public void declareExtensions(ExtensionProfile extProfile) { // Create an instance of the associated entry class and declare its // extensions. E entry = createEntry(); extProfile.addDeclarations(entry); }
@Override public void generateXml(XmlWriter xw, OutputProperties outProps, IAtom source) throws IOException { if (source instanceof IFeed) { IFeed feed = (IFeed) source; if (feed instanceof BaseFeed) { ((BaseFeed<?, ?>) feed).generateRss(xw, outProps.getExtensionProfile()); } else { throw new IllegalArgumentException( "Feed was not an instance of BaseFeed"); } } else if (source instanceof IEntry) { IEntry entry = (IEntry) source; if (entry instanceof BaseEntry) { ((BaseEntry<?>) entry).generateRss(xw, outProps.getExtensionProfile()); } else { throw new IllegalArgumentException( "Entry was not an instance of BaseEntry"); } } else { throw new IllegalStateException("Unexpected source type: " + source); } } }
/** Declares extensions used by Rows feeds into the extension profile. */ public void declareExtensions(ExtensionProfile extProfile) { // No feed-level extensions. super.declareExtensions(extProfile); } }
/** * Generates XML in the Atom format. * * @param w * Output writer. * * @param extProfile * Extension profile. * * @throws IOException */ @Override public void generateAtom(XmlWriter w, ExtensionProfile extProfile) throws IOException { generateFeedStart(extProfile, w, null); generateEntries(w, extProfile); generateFeedEnd(w); }