Package crawlercommons.sitemaps
Class Namespace
- java.lang.Object
-
- crawlercommons.sitemaps.Namespace
-
public class Namespace extends Object
supported sitemap formats: https://www.sitemaps.org/protocol.html#otherformats
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATOM_0_3
static String
ATOM_1_0
static String
EMPTY
In contradiction to the protocol specification ("The Sitemap must ...static String[]
IMAGE
static String
LINKS
static String[]
MOBILE
static String[]
NEWS
static String
RSS_2_0
RSS and Atom sitemap formats do not have strict definition.static String
SITEMAP
static Map<Extension,List<String>>
SITEMAP_EXTENSION_NAMESPACES
static String[]
SITEMAP_LEGACY
Legacy schema URIs from prior sitemap protocol versions and frequent variants.static Set<String>
SITEMAP_SUPPORTED_NAMESPACES
static String[]
VIDEO
-
Constructor Summary
Constructors Constructor Description Namespace()
-
-
-
Field Detail
-
SITEMAP
public static final String SITEMAP
- See Also:
- Constant Field Values
-
SITEMAP_LEGACY
public static final String[] SITEMAP_LEGACY
Legacy schema URIs from prior sitemap protocol versions and frequent variants.
-
IMAGE
public static final String[] IMAGE
-
VIDEO
public static final String[] VIDEO
-
NEWS
public static final String[] NEWS
-
MOBILE
public static final String[] MOBILE
-
LINKS
public static final String LINKS
- See Also:
- Constant Field Values
-
EMPTY
public static final String EMPTY
In contradiction to the protocol specification ("The Sitemap must ... [s]pecify the namespace (protocol standard) within the <urlset> tag."), some sitemaps do not define a (default) namespace. By accepting the "empty" namespace, you'll get URLs even from those sitemaps.- See Also:
- Constant Field Values
-
RSS_2_0
public static final String RSS_2_0
RSS and Atom sitemap formats do not have strict definition. But if we do not parse as namespace aware, then RSS/Atom files that choose to use namespaces will break. The relaxed compromise for RSS/Atom is to always parse as "namespace aware", but we will only match elements by the localName, accepting any element namespace.- See Also:
- Constant Field Values
-
ATOM_0_3
public static final String ATOM_0_3
- See Also:
- Constant Field Values
-
ATOM_1_0
public static final String ATOM_1_0
- See Also:
- Constant Field Values
-
-
Method Detail
-
isSupported
public static boolean isSupported(String uri)
- Parameters:
uri
- URI string identifying the namespace- Returns:
- true if namespace (identified by URI) is supported, false if the namespace is not supported or unknown
-
-