|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sourceforge.java.feednread.backend.importer.OPMLImport
Imports a valid OPML 1.0 or 1.1
File into an arbitrary Category. The OPML
version is automatically detected in order to adjust parsing towards version
specific guidelines.
NewsFeedFavoritesTreeOPMLExport| Field Summary | |
private String |
creationDate
The creation date of the parsed OPML Document |
private static String |
OPML_VERSION_1_0
The OPML 1.0 import version |
private static String |
OPML_VERSION_1_1
The OPML 1.1 import version |
private Category |
targetCategory
The Category to import into |
private String |
title
The title of the parsed OPML Document |
| Constructor Summary | |
OPMLImport(Category targetCategory)
Creates a new OPMLImport bound to the specified
Category.
|
|
| Method Summary | |
void |
doImport(String fileName)
Imports the OPML Document from the File with the
specified fileName.
|
String |
getCreationDate()
Gets the creation date of the imported OPML Document as
defined in the OPML head section.
|
String |
getTitle()
Gets the title of the imported OPML Document as
defined in the OPML head section.
|
protected void |
importCategory(Element outline,
Category parent)
Recursively imports the specified outline
Element into the the specified Category.
|
protected void |
importFavorite(Element outline,
Category parent)
Imports the specified outline Element
as Favorite into the specified parent
Category.
|
protected boolean |
isCategory(Element outline)
Verifies if the specified outline Element
represents a Category.
|
private void |
parseBody(Element root)
Parses the OPML body section. |
protected void |
parseDocument(Document doc)
Parses the OPML Document.
|
private void |
parseHead(Element root)
Parses the OPML head section. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final String OPML_VERSION_1_0
The OPML 1.0 import version
private static final String OPML_VERSION_1_1
The OPML 1.1 import version
private Category targetCategory
The Category to import into
private String title
The title of the parsed OPML Document
private String creationDate
The creation date of the parsed OPML Document
| Constructor Detail |
public OPMLImport(Category targetCategory)
Creates a new OPMLImport bound to the specified
Category.
targetCategory - the Category to import into| Method Detail |
public void doImport(String fileName)
throws JDOMException,
IOException
Imports the OPML Document from the File with the
specified fileName.
fileName - the name of the file to import from
IOException - if the import failed due to an IO error
JDOMExceptionpublic String getTitle()
Gets the title of the imported OPML Document as
defined in the OPML head section.
Document as
defined in the OPML head section; null if no title was
set or foundpublic String getCreationDate()
Gets the creation date of the imported OPML Document as
defined in the OPML head section.
Document as
defined in the OPML head section; null if not set or foundprotected boolean isCategory(Element outline)
Verifies if the specified outline Element
represents a Category.
outline - the outline Element to verify
true if the specified outline
Element represents a Category;
false otherwise
protected void parseDocument(Document doc)
throws JDOMException
Parses the OPML Document.
doc - the OPML Document to parse
JDOMException
private void parseHead(Element root)
throws JDOMException
Parses the OPML head section.
root - the root of the OPML Document
JDOMException
private void parseBody(Element root)
throws JDOMException
Parses the OPML body section.
root - the root of the OPML Document
JDOMException
protected void importCategory(Element outline,
Category parent)
Recursively imports the specified outline
Element into the the specified Category.
outline - the outline Element to importparent - the Category to import into
protected void importFavorite(Element outline,
Category parent)
Imports the specified outline Element
as Favorite into the specified parent
Category.
outline - the outline Element to importparent - the Category to import into
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||