summaryrefslogtreecommitdiff
path: root/src/de/podfetcher/syndication/namespace/content/NSContent.java
blob: 8dcfc208ac05768fec6bd8a11e6fa856e15ea4af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package de.podfetcher.syndication.namespace.content;

import org.xml.sax.Attributes;

import de.podfetcher.syndication.handler.HandlerState;
import de.podfetcher.syndication.namespace.Namespace;
import de.podfetcher.syndication.namespace.SyndElement;
import de.podfetcher.syndication.namespace.rss20.NSRSS20;
import org.apache.commons.lang3.StringEscapeUtils;

public class NSContent extends Namespace {
	public static final String NSTAG = "content";
	public static final String NSURI = "http://purl.org/rss/1.0/modules/content/";
	
	private static final String ENCODED = "encoded";
	
	@Override
	public SyndElement handleElementStart(String localName, HandlerState state,
			Attributes attributes) {
		return new SyndElement(localName, this);
	}

	@Override
	public void handleCharacters(HandlerState state, char[] ch, int start,
			int length) {

	}

	@Override
	public void handleElementEnd(String localName, HandlerState state) {
		if (localName.equals(ENCODED)) {
			state.getCurrentItem().setContentEncoded(state.getContentBuf().toString());
		}
	}

}