Package com.rometools.rome.io.impl
Class Atom10Parser
- java.lang.Object
-
- com.rometools.rome.io.impl.BaseWireFeedParser
-
- com.rometools.rome.io.impl.Atom10Parser
-
- All Implemented Interfaces:
WireFeedParser
public class Atom10Parser extends BaseWireFeedParser
Parser for Atom 1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description Atom10Parser()protectedAtom10Parser(String type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.jdom2.NamespacegetAtomNamespace()static booleangetResolveURIs()static booleanisAbsoluteURI(String uri)booleanisMyType(org.jdom2.Document document)Inspects an XML Document (JDOM) to check if it can parse it.static booleanisRelativeURI(String uri)Returns true if URI is relative.WireFeedparse(org.jdom2.Document document, boolean validate, Locale locale)Parses an XML document (JDOM Document) into a feed bean.protected List<Entry>parseEntries(Feed feed, String baseURI, List<org.jdom2.Element> eEntries, Locale locale)protected EntryparseEntry(Feed feed, org.jdom2.Element eEntry, String baseURI, Locale locale)static EntryparseEntry(Reader rd, String baseURI, Locale locale)Parse entry from reader.protected WireFeedparseFeed(org.jdom2.Element eFeed, Locale locale)static StringresolveURI(String baseURI, org.jdom2.Parent parent, String url)Resolve URI via base URL and parent element.static voidsetResolveURIs(boolean resolveURIs)protected voidvalidateFeed(org.jdom2.Document document)-
Methods inherited from class com.rometools.rome.io.impl.BaseWireFeedParser
extractForeignMarkup, getAttribute, getAttributeValue, getStyleSheet, getType, parseFeedModules, parseItemModules, parsePersonModules
-
-
-
-
Constructor Detail
-
Atom10Parser
public Atom10Parser()
-
Atom10Parser
protected Atom10Parser(String type)
-
-
Method Detail
-
setResolveURIs
public static void setResolveURIs(boolean resolveURIs)
-
getResolveURIs
public static boolean getResolveURIs()
-
getAtomNamespace
protected org.jdom2.Namespace getAtomNamespace()
-
isMyType
public boolean isMyType(org.jdom2.Document document)
Description copied from interface:WireFeedParserInspects an XML Document (JDOM) to check if it can parse it.It checks if the given document if the type of feeds the parser understands.
- Parameters:
document- XML Document (JDOM) to check if it can be parsed by this parser.- Returns:
- true if the parser know how to parser this feed, false otherwise.
-
parse
public WireFeed parse(org.jdom2.Document document, boolean validate, Locale locale) throws IllegalArgumentException, FeedException
Description copied from interface:WireFeedParserParses an XML document (JDOM Document) into a feed bean.- Parameters:
document- XML document (JDOM) to parse.validate- indicates if the feed should be strictly validated (NOT YET IMPLEMENTED).- Returns:
- the resulting feed bean.
- Throws:
IllegalArgumentException- thrown if the parser cannot handle the given feed type.FeedException- thrown if a feed bean cannot be created out of the XML document (JDOM).
-
validateFeed
protected void validateFeed(org.jdom2.Document document) throws FeedException- Throws:
FeedException
-
parseFeed
protected WireFeed parseFeed(org.jdom2.Element eFeed, Locale locale) throws FeedException
- Throws:
FeedException
-
parseEntries
protected List<Entry> parseEntries(Feed feed, String baseURI, List<org.jdom2.Element> eEntries, Locale locale)
-
parseEntry
protected Entry parseEntry(Feed feed, org.jdom2.Element eEntry, String baseURI, Locale locale)
-
isAbsoluteURI
public static boolean isAbsoluteURI(String uri)
-
isRelativeURI
public static boolean isRelativeURI(String uri)
Returns true if URI is relative.
-
resolveURI
public static String resolveURI(String baseURI, org.jdom2.Parent parent, String url)
Resolve URI via base URL and parent element. Resolve URI based considering xml:base and baseURI.- Parameters:
baseURI- Base URI used to fetch the XML documentparent- Parent element from which to consider xml:baseurl- URL to be resolved
-
parseEntry
public static Entry parseEntry(Reader rd, String baseURI, Locale locale) throws org.jdom2.JDOMException, IOException, IllegalArgumentException, FeedException
Parse entry from reader.- Throws:
org.jdom2.JDOMExceptionIOExceptionIllegalArgumentExceptionFeedException
-
-