com.sun.syndication.io
Class SyndInput

java.lang.Object
  extended bycom.sun.syndication.io.SyndInput

public class SyndInput
extends java.lang.Object

Parses an XML document (File, InputStream, Reader, W3C SAX InputSource, W3C DOM Document or JDom DOcument) into an SyndFeed.

It delegates to a FeedInput to handle all feed types.

Author:
Alejandro Abdelnur

Constructor Summary
SyndInput()
          Creates a SyndInput instance with input validation turned off.
SyndInput(boolean validate)
          Creates a SyndInput instance.
 
Method Summary
 SyndFeedI build(org.w3c.dom.Document document)
          Builds SyndFeed from an W3C DOM document.
 SyndFeedI build(org.jdom.Document document)
          Builds SyndFeed from an JDOM document.
 SyndFeedI build(java.io.File file)
          Builds SyndFeed from a file.
 SyndFeedI build(org.xml.sax.InputSource is)
          Builds SyndFeed from an W3C SAX InputSource.
 SyndFeedI build(java.io.InputStream is)
          Builds SyndFeed from an InputStream.
 SyndFeedI build(java.io.Reader reader)
          Builds SyndFeed from an Reader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyndInput

public SyndInput()
Creates a SyndInput instance with input validation turned off.


SyndInput

public SyndInput(boolean validate)
Creates a SyndInput instance.

Parameters:
validate - indicates if the input should be validated. NOT IMPLEMENTED YET (validation does not happen)
Method Detail

build

public SyndFeedI build(java.io.File file)
                throws java.io.FileNotFoundException,
                       java.io.IOException,
                       java.lang.IllegalArgumentException,
                       FeedException
Builds SyndFeed from a file.

Parameters:
file - file to read to create the SyndFeed.
Returns:
the SyndFeed read from the file.
Throws:
java.io.FileNotFoundException - thrown if the file could not be found.
java.io.IOException - thrown if there is problem reading the file.
java.lang.IllegalArgumentException - thrown if feed type could not be understood by any of the underlying parsers.
FeedException - if the feed could not be parsed

build

public SyndFeedI build(java.io.InputStream is)
                throws java.lang.IllegalArgumentException,
                       FeedException
Builds SyndFeed from an InputStream.

Parameters:
is - InputStream to read to create the SyndFeed.
Returns:
the SyndFeed read from the InputStream.
Throws:
java.lang.IllegalArgumentException - thrown if feed type could not be understood by any of the underlying parsers.
FeedException - if the feed could not be parsed

build

public SyndFeedI build(java.io.Reader reader)
                throws java.lang.IllegalArgumentException,
                       FeedException
Builds SyndFeed from an Reader.

Parameters:
reader - Reader to read to create the SyndFeed.
Returns:
the SyndFeed read from the Reader.
Throws:
java.lang.IllegalArgumentException - thrown if feed type could not be understood by any of the underlying parsers.
FeedException - if the feed could not be parsed

build

public SyndFeedI build(org.xml.sax.InputSource is)
                throws java.lang.IllegalArgumentException,
                       FeedException
Builds SyndFeed from an W3C SAX InputSource.

Parameters:
is - W3C SAX InputSource to read to create the SyndFeed.
Returns:
the SyndFeed read from the W3C SAX InputSource.
Throws:
java.lang.IllegalArgumentException - thrown if feed type could not be understood by any of the underlying parsers.
FeedException - if the feed could not be parsed

build

public SyndFeedI build(org.w3c.dom.Document document)
                throws java.lang.IllegalArgumentException,
                       FeedException
Builds SyndFeed from an W3C DOM document.

Parameters:
document - W3C DOM document to read to create the SyndFeed.
Returns:
the SyndFeed read from the W3C DOM document.
Throws:
java.lang.IllegalArgumentException - thrown if feed type could not be understood by any of the underlying parsers.
FeedException - if the feed could not be parsed

build

public SyndFeedI build(org.jdom.Document document)
                throws java.lang.IllegalArgumentException,
                       FeedException
Builds SyndFeed from an JDOM document.

Parameters:
document - JDOM document to read to create the SyndFeed.
Returns:
the SyndFeed read from the JDOM document.
Throws:
java.lang.IllegalArgumentException - thrown if feed type could not be understood by any of the underlying parsers.
FeedException - if the feed could not be parsed


Copyright © 2004 Sun Microsystems. All Rights Reserved.