diff options
Diffstat (limited to 'src/de/podfetcher/syndication/namespace')
3 files changed, 67 insertions, 0 deletions
diff --git a/src/de/podfetcher/syndication/namespace/NSElement.java b/src/de/podfetcher/syndication/namespace/NSElement.java new file mode 100644 index 000000000..6b62def77 --- /dev/null +++ b/src/de/podfetcher/syndication/namespace/NSElement.java @@ -0,0 +1,11 @@ +package de.podfetcher.syndication.namespace; + +import org.xml.sax.Attributes; + +import de.podfetcher.feed.Feed; + +/** Defines a XML Element of a specific namespace */ +public abstract class NSElement { + /** Called by its namespace if the processing of the element gets more complex */ + public abstract void handleElement(String localName, Feed feed, Attributes attributes); +} diff --git a/src/de/podfetcher/syndication/namespace/Namespace.java b/src/de/podfetcher/syndication/namespace/Namespace.java new file mode 100644 index 000000000..152c53652 --- /dev/null +++ b/src/de/podfetcher/syndication/namespace/Namespace.java @@ -0,0 +1,18 @@ +package de.podfetcher.syndication.namespace; + +import org.xml.sax.Attributes; + +import de.podfetcher.feed.Feed; + + +public abstract class Namespace { + + /** Called by a Feedhandler when in startElement and it detects a namespace element */ + public abstract void handleElement(String localName, Feed feed, Attributes attributes); + + /** Called by a Feedhandler when in characters and it detects a namespace element */ + public abstract void handleCharacters(String localName, Feed feed, char ch[], int start, int length); + + public abstract String getNsTag(); + public abstract String getNsURI(); +} diff --git a/src/de/podfetcher/syndication/namespace/atom/NSAtom.java b/src/de/podfetcher/syndication/namespace/atom/NSAtom.java new file mode 100644 index 000000000..c55e9fcd6 --- /dev/null +++ b/src/de/podfetcher/syndication/namespace/atom/NSAtom.java @@ -0,0 +1,38 @@ +package de.podfetcher.syndication.namespace.atom; + +import org.xml.sax.Attributes; + +import de.podfetcher.feed.Feed; +import de.podfetcher.syndication.namespace.Namespace; + +public class NSAtom extends Namespace { + private static final String TITLE = "title"; + private static final String LINK = "link"; + private static final String UPDATED = "updated"; + private static final String AUTHOR = "author"; + + @Override + public void handleElement(String localName, Feed feed, Attributes attributes) { + if (localName.equals(TITLE)) { + + } + + } + + @Override + public void handleCharacters(String localName, Feed feed, char[] ch, + int start, int length) { + + } + + @Override + public String getNsTag() { + return "atom"; + } + + @Override + public String getNsURI() { + return "http://www.w3.org/2005/Atom"; + } + +} |