Source Code Cross Referenced for SyndFeedOutput.java in  » RSS-RDF » Rome » com » sun » syndication » io » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Rome » com.sun.syndication.io 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004 Sun Microsystems, Inc.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         *
016:         */
017:        package com.sun.syndication.io;
018:
019:        import com.sun.syndication.feed.synd.SyndFeed;
020:        import org.jdom.Document;
021:
022:        import java.io.File;
023:        import java.io.IOException;
024:        import java.io.Writer;
025:
026:        /**
027:         * Generates an XML document (String, File, OutputStream, Writer, W3C DOM document or JDOM document)
028:         * out of an SyndFeedImpl..
029:         * <p>
030:         * It delegates to a WireFeedOutput to generate all feed types.
031:         * <p>
032:         * @author Alejandro Abdelnur
033:         *
034:         */
035:        public class SyndFeedOutput {
036:            private WireFeedOutput _feedOutput;
037:
038:            /**
039:             * Creates a SyndFeedOutput instance.
040:             * <p>
041:             *
042:             */
043:            public SyndFeedOutput() {
044:                _feedOutput = new WireFeedOutput();
045:            }
046:
047:            /**
048:             * Creates a String with the XML representation for the given SyndFeedImpl.
049:             * <p>
050:             * If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. It is the responsibility
051:             * of the developer to ensure that if the String is written to a character stream the stream charset is the same as
052:             * the feed encoding property.
053:             * <p>
054:             * @param feed Abstract feed to create XML representation from. The type of the SyndFeedImpl must match
055:             *        the type given to the FeedOuptut constructor.
056:             * @return a String with the XML representation for the given SyndFeedImpl.
057:             * @throws FeedException thrown if the XML representation for the feed could not be created.
058:             *
059:             */
060:            public String outputString(SyndFeed feed) throws FeedException {
061:                return _feedOutput.outputString(feed.createWireFeed());
062:            }
063:
064:            /**
065:             * Creates a File containing with the XML representation for the given SyndFeedImpl.
066:             * <p>
067:             * If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. The platform
068:             * default charset encoding is used to write the feed to the file. It is the responsibility
069:             * of the developer to ensure the feed encoding is set to the platform charset encoding.
070:             * <p>
071:             * @param feed Abstract feed to create XML representation from. The type of the SyndFeedImpl must match
072:             *        the type given to the FeedOuptut constructor.
073:             * @param file the file where to write the XML representation for the given SyndFeedImpl.
074:             * @throws IOException thrown if there was some problem writing to the File.
075:             * @throws FeedException thrown if the XML representation for the feed could not be created.
076:             *
077:             */
078:            public void output(SyndFeed feed, File file) throws IOException,
079:                    FeedException {
080:                _feedOutput.output(feed.createWireFeed(), file);
081:            }
082:
083:            /**
084:             * Writes to an Writer the XML representation for the given SyndFeedImpl.
085:             * <p>
086:             * If the feed encoding is not NULL, it will be used in the XML prolog encoding attribute. It is the responsibility
087:             * of the developer to ensure that if the String is written to a character stream the stream charset is the same as
088:             * the feed encoding property.
089:             * <p>
090:             * @param feed Abstract feed to create XML representation from. The type of the SyndFeedImpl must match
091:             *        the type given to the FeedOuptut constructor.
092:             * @param writer Writer to write the XML representation for the given SyndFeedImpl.
093:             * @throws IOException thrown if there was some problem writing to the Writer.
094:             * @throws FeedException thrown if the XML representation for the feed could not be created.
095:             *
096:             */
097:            public void output(SyndFeed feed, Writer writer)
098:                    throws IOException, FeedException {
099:                _feedOutput.output(feed.createWireFeed(), writer);
100:            }
101:
102:            /**
103:             * Creates a W3C DOM document for the given SyndFeedImpl.
104:             * <p>
105:             * This method does not use the feed encoding property.
106:             * <p>
107:             * @param feed Abstract feed to create W3C DOM document from. The type of the SyndFeedImpl must match
108:             *        the type given to the FeedOuptut constructor.
109:             * @return the W3C DOM document for the given SyndFeedImpl.
110:             * @throws FeedException thrown if the W3C DOM document for the feed could not be created.
111:             *
112:             */
113:            public org.w3c.dom.Document outputW3CDom(SyndFeed feed)
114:                    throws FeedException {
115:                return _feedOutput.outputW3CDom(feed.createWireFeed());
116:            }
117:
118:            /**
119:             * Creates a JDOM document for the given SyndFeedImpl.
120:             * <p>
121:             * This method does not use the feed encoding property.
122:             * <p>
123:             * @param feed Abstract feed to create JDOM document from. The type of the SyndFeedImpl must match
124:             *        the type given to the FeedOuptut constructor.
125:             * @return the JDOM document for the given SyndFeedImpl.
126:             * @throws FeedException thrown if the JDOM document for the feed could not be created.
127:             *
128:             */
129:            public Document outputJDom(SyndFeed feed) throws FeedException {
130:                return _feedOutput.outputJDom(feed.createWireFeed());
131:            }
132:
133:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.