Changed return type of handleElementStart

This commit is contained in:
daniel oeh 2012-06-10 11:02:40 +02:00
parent 4166e04a3f
commit d397ef0df7
4 changed files with 9 additions and 7 deletions

View File

@ -32,8 +32,8 @@ public class SyndHandler extends DefaultHandler {
Namespace handler = getHandlingNamespace(uri);
if (handler != null) {
handler.handleElementStart(localName, state, attributes);
state.tagstack.push(new SyndElement(localName, handler));
SyndElement element = handler.handleElementStart(localName, state, attributes);
state.tagstack.push(element);
}
}
@ -46,7 +46,6 @@ public class SyndHandler extends DefaultHandler {
if (top.getNamespace() != null) {
top.getNamespace().handleCharacters(state, ch, start, length);
}
// ignore element otherwise
}
@Override

View File

@ -11,9 +11,9 @@ public abstract class Namespace {
public static final String NSURI = null;
/** Called by a Feedhandler when in startElement and it detects a namespace element
* @return true if namespace handled the element, false if it ignored it
* @return The SyndElement to push onto the stack
* */
public abstract void handleElementStart(String localName, HandlerState state, Attributes attributes);
public abstract SyndElement handleElementStart(String localName, HandlerState state, Attributes attributes);
/** Called by a Feedhandler when in characters and it detects a namespace element */
public abstract void handleCharacters(HandlerState state, char ch[], int start, int length);

View File

@ -5,6 +5,7 @@ import org.xml.sax.Attributes;
import de.podfetcher.feed.Feed;
import de.podfetcher.syndication.handler.HandlerState;
import de.podfetcher.syndication.namespace.Namespace;
import de.podfetcher.syndication.namespace.SyndElement;
public class NSAtom extends Namespace {
public static final String NSTAG = "atom";
@ -16,11 +17,12 @@ public class NSAtom extends Namespace {
private static final String AUTHOR = "author";
@Override
public void handleElementStart(String localName, HandlerState state,
public SyndElement handleElementStart(String localName, HandlerState state,
Attributes attributes) {
if (localName.equals(TITLE)) {
}
return null;
}
@Override

View File

@ -40,7 +40,7 @@ public class NSRSS20 extends Namespace {
public final static String ENC_TYPE = "type";
@Override
public void handleElementStart(String localName, HandlerState state,
public SyndElement handleElementStart(String localName, HandlerState state,
Attributes attributes) {
if (localName.equals(ITEM)) {
state.setCurrentItem(new FeedItem());
@ -55,6 +55,7 @@ public class NSRSS20 extends Namespace {
} else if (localName.equals(IMAGE)) {
state.getFeed().setImage(new FeedImage());
}
return new SyndElement(localName, this);
}
@Override