public class Namespace extends Object implements INamespace
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Namespace.ExtractType |
class |
Namespace.NamespaceValue
Base class for all namespace constants.
|
INamespace.INamespaceValue, INamespace.NamespaceCode| Modifier and Type | Field and Description |
|---|---|
Namespace.NamespaceValue |
BOOK |
Namespace.NamespaceValue |
BOOK_TALK |
Namespace.NamespaceValue |
CATEGORY
The "Category" namespace for the current language.
|
Namespace.NamespaceValue |
CATEGORY_TALK
The "Category talk" namespace for the current language.
|
Namespace.NamespaceValue |
DRAFT |
Namespace.NamespaceValue |
DRAFT_TALK |
Namespace.NamespaceValue |
EP |
Namespace.NamespaceValue |
EP_TALK |
protected ResourceBundle |
fResourceBundle |
protected ResourceBundle |
fResourceBundleEn |
Namespace.NamespaceValue |
HELP
The "Help" namespace for the current language.
|
Namespace.NamespaceValue |
HELP_TALK
The "Help talk" namespace for the current language.
|
Namespace.NamespaceValue |
IMAGE |
Namespace.NamespaceValue |
IMAGE_TALK
NS_IMAGE and NS_IMAGE_TALK are the pre-v1.14 names for NS_FILE and
NS_FILE_TALK respectively, and are kept for compatibility.
|
Namespace.NamespaceValue |
MAIN
The main namespace for the current language.
|
Namespace.NamespaceValue |
MEDIA
The "Media" namespace for the current language.
|
Namespace.NamespaceValue |
MEDIAWIKI
The "MediaWiki" namespace for the current language.
|
Namespace.NamespaceValue |
MEDIAWIKI_TALK
The "MediaWiki talk" namespace for the current language.
|
Namespace.NamespaceValue |
MODULE
The "Module" namespace for the current language.
|
Namespace.NamespaceValue |
MODULE_TALK
The "Module talk" namespace for the current language.
|
Namespace.NamespaceValue |
PORTAL
The "Portal" namespace for the current language.
|
Namespace.NamespaceValue |
PORTAL_TALK
The "Portal talk" namespace for the current language.
|
Namespace.NamespaceValue |
PROJECT
The "Meta" namespace for the current language.
|
Namespace.NamespaceValue |
PROJECT_TALK
The "Meta talk" namespace for the current language.
|
Namespace.NamespaceValue |
SPECIAL
The "Special" namespace for the current language.
|
Namespace.NamespaceValue |
TALK
The "Talk" namespace for the current language.
|
Namespace.NamespaceValue |
TEMPLATE
The "Template" namespace for the current language.
|
Namespace.NamespaceValue |
TEMPLATE_TALK
The "Template talk" namespace for the current language.
|
Namespace.NamespaceValue |
TIMEDTEXT |
Namespace.NamespaceValue |
TIMEDTEXT_TALK |
Namespace.NamespaceValue |
TOPIC |
Namespace.NamespaceValue |
USER
The "User" namespace for the current language.
|
Namespace.NamespaceValue |
USER_TALK
The "User talk" namespace for the current language.
|
| Constructor and Description |
|---|
Namespace() |
Namespace(Locale locale) |
Namespace(ResourceBundle resourceBundle) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
extractFromResource(ResourceBundle resource,
Namespace.ExtractType cmd) |
INamespace.INamespaceValue |
getCategory_talk()
The "Category talk" namespace for the current language.
|
INamespace.INamespaceValue |
getCategory()
The "Category" namespace for the current language.
|
Namespace.NamespaceValue |
getContentspace(String talkNamespace)
Gets the content namespace for a given (talk) namespace.
|
INamespace.INamespaceValue |
getHelp_talk()
The "Help talk" namespace for the current language.
|
INamespace.INamespaceValue |
getHelp()
The "Help" namespace for the current language.
|
INamespace.INamespaceValue |
getImage_talk()
The "File talk" namespace for the current language.
|
INamespace.INamespaceValue |
getImage()
The "File" namespace for the current language.
|
INamespace.INamespaceValue |
getMain()
The main namespace for the current language.
|
INamespace.INamespaceValue |
getMedia()
Get the "Media" namespace for the current language.
|
INamespace.INamespaceValue |
getMediaWiki_talk()
The "MediaWiki talk" namespace for the current language.
|
INamespace.INamespaceValue |
getMediaWiki()
The "MediaWiki" namespace for the current language.
|
INamespace.INamespaceValue |
getModule()
The "Module" namespace for the current language.
|
Namespace.NamespaceValue |
getNamespace(String namespace) |
Namespace.NamespaceValue |
getNamespaceByNumber(INamespace.NamespaceCode numberCode) |
Namespace.NamespaceValue |
getNamespaceByNumber(int numberCode) |
INamespace.INamespaceValue |
getPortal_talk()
The "Portal talk" namespace for the current language.
|
INamespace.INamespaceValue |
getPortal()
The "Portal" namespace for the current language.
|
INamespace.INamespaceValue |
getProject_talk()
The "Meta talk" namespace for the current language.
|
INamespace.INamespaceValue |
getProject()
The "Meta" namespace for the current language.
|
ResourceBundle |
getResourceBundle() |
INamespace.INamespaceValue |
getSpecial()
Get the "Special" namespace for the current language.
|
INamespace.INamespaceValue |
getTalk()
The "Talk" namespace for the current language.
|
Namespace.NamespaceValue |
getTalkspace(String namespace)
Get the Talk namespace.
|
INamespace.INamespaceValue |
getTemplate_talk()
The "Template talk" namespace for the current language.
|
INamespace.INamespaceValue |
getTemplate()
The "Template" namespace for the current language.
|
INamespace.INamespaceValue |
getUser_talk()
The "User talk" namespace for the current language.
|
INamespace.INamespaceValue |
getUser()
The "User" namespace for the current language.
|
boolean |
isNamespace(INamespace.INamespaceValue namespace,
INamespace.NamespaceCode code)
Checks whether the given namespace is a namespace of the given type.
|
boolean |
isNamespace(String namespace,
INamespace.NamespaceCode code)
Checks whether the given string is a valid namespace of the given type.
|
String[] |
splitNsTitle(String fullTitle)
Splits the given full title into its namespace and page title components
and normalises both components using
Encoder.normaliseTitle(String, boolean, char, boolean). |
String[] |
splitNsTitle(String fullTitle,
boolean underScoreIsWhitespace,
char whiteSpaceChar,
boolean firstCharacterAsUpperCase)
Splits the given full title into its namespace and page title components
and normalises both components using
Encoder.normaliseTitle(String, boolean, char, boolean). |
public final Namespace.NamespaceValue MEDIA
public final Namespace.NamespaceValue SPECIAL
public final Namespace.NamespaceValue TALK
public final Namespace.NamespaceValue MAIN
public final Namespace.NamespaceValue USER_TALK
public final Namespace.NamespaceValue USER
public final Namespace.NamespaceValue PROJECT_TALK
public final Namespace.NamespaceValue PROJECT
public final Namespace.NamespaceValue IMAGE_TALK
public final Namespace.NamespaceValue IMAGE
public final Namespace.NamespaceValue MEDIAWIKI_TALK
public final Namespace.NamespaceValue MEDIAWIKI
public final Namespace.NamespaceValue MODULE_TALK
public final Namespace.NamespaceValue MODULE
public final Namespace.NamespaceValue TEMPLATE_TALK
public final Namespace.NamespaceValue TEMPLATE
public final Namespace.NamespaceValue HELP_TALK
public final Namespace.NamespaceValue HELP
public final Namespace.NamespaceValue CATEGORY_TALK
public final Namespace.NamespaceValue CATEGORY
public final Namespace.NamespaceValue PORTAL_TALK
public final Namespace.NamespaceValue PORTAL
public final Namespace.NamespaceValue BOOK_TALK
public final Namespace.NamespaceValue BOOK
public final Namespace.NamespaceValue DRAFT_TALK
public final Namespace.NamespaceValue DRAFT
public final Namespace.NamespaceValue EP_TALK
public final Namespace.NamespaceValue EP
public final Namespace.NamespaceValue TIMEDTEXT_TALK
public final Namespace.NamespaceValue TIMEDTEXT
public final Namespace.NamespaceValue TOPIC
protected ResourceBundle fResourceBundle
protected ResourceBundle fResourceBundleEn
public Namespace()
public Namespace(Locale locale)
public Namespace(ResourceBundle resourceBundle)
public boolean isNamespace(String namespace, INamespace.NamespaceCode code)
INamespaceisNamespace in interface INamespacenamespace - the potential namespace stringcode - the codepublic boolean isNamespace(INamespace.INamespaceValue namespace, INamespace.NamespaceCode code)
INamespaceisNamespace in interface INamespacenamespace - the namespacecode - the code@Nullable public Namespace.NamespaceValue getNamespace(String namespace)
getNamespace in interface INamespacepublic Namespace.NamespaceValue getNamespaceByNumber(INamespace.NamespaceCode numberCode)
getNamespaceByNumber in interface INamespace@Nullable public Namespace.NamespaceValue getNamespaceByNumber(int numberCode)
getNamespaceByNumber in interface INamespacepublic ResourceBundle getResourceBundle()
getResourceBundle in interface INamespaceprotected void extractFromResource(ResourceBundle resource, Namespace.ExtractType cmd)
public Namespace.NamespaceValue getTalkspace(String namespace)
INamespacegetTalkspace in interface INamespacenamespace - the namespaceINamespace.getContentspace(String)public Namespace.NamespaceValue getContentspace(String talkNamespace)
INamespacegetContentspace in interface INamespacetalkNamespace - the namespace, potentially a talkspaceINamespace.getTalkspace(String)public INamespace.INamespaceValue getMedia()
INamespacegetMedia in interface INamespacepublic INamespace.INamespaceValue getSpecial()
INamespacegetSpecial in interface INamespacepublic INamespace.INamespaceValue getMain()
INamespacegetMain in interface INamespacepublic INamespace.INamespaceValue getTalk()
INamespacegetTalk in interface INamespacepublic INamespace.INamespaceValue getUser()
INamespacegetUser in interface INamespacepublic INamespace.INamespaceValue getUser_talk()
INamespacegetUser_talk in interface INamespacepublic INamespace.INamespaceValue getProject()
INamespacegetProject in interface INamespacepublic INamespace.INamespaceValue getProject_talk()
INamespacegetProject_talk in interface INamespacepublic INamespace.INamespaceValue getImage()
INamespacegetImage in interface INamespacepublic INamespace.INamespaceValue getImage_talk()
INamespacegetImage_talk in interface INamespacepublic INamespace.INamespaceValue getMediaWiki()
INamespacegetMediaWiki in interface INamespacepublic INamespace.INamespaceValue getMediaWiki_talk()
INamespacegetMediaWiki_talk in interface INamespacepublic INamespace.INamespaceValue getModule()
INamespacegetModule in interface INamespacepublic INamespace.INamespaceValue getTemplate()
INamespacegetTemplate in interface INamespacepublic INamespace.INamespaceValue getTemplate_talk()
INamespacegetTemplate_talk in interface INamespacepublic INamespace.INamespaceValue getHelp()
INamespacegetHelp in interface INamespacepublic INamespace.INamespaceValue getHelp_talk()
INamespacegetHelp_talk in interface INamespacepublic INamespace.INamespaceValue getCategory()
INamespacegetCategory in interface INamespacepublic INamespace.INamespaceValue getCategory_talk()
INamespacegetCategory_talk in interface INamespacepublic INamespace.INamespaceValue getPortal()
INamespacegetPortal in interface INamespacepublic INamespace.INamespaceValue getPortal_talk()
INamespacegetPortal_talk in interface INamespacepublic String[] splitNsTitle(String fullTitle)
INamespaceEncoder.normaliseTitle(String, boolean, char, boolean). Assumes
underScoreIsWhitespace, uses a space as whiteSpaceChar
and capitalises the first character.splitNsTitle in interface INamespacefullTitle - the (full) title including a namespace (if present)INamespace.splitNsTitle(String, boolean, char, boolean)public String[] splitNsTitle(String fullTitle, boolean underScoreIsWhitespace, char whiteSpaceChar, boolean firstCharacterAsUpperCase)
INamespaceEncoder.normaliseTitle(String, boolean, char, boolean).splitNsTitle in interface INamespacefullTitle - the (full) title including a namespace (if present)underScoreIsWhitespace - whether '_' should be seen as whitespace or notwhiteSpaceChar - the character to replace whitespace withfirstCharacterAsUpperCase - if true convert the first of the title to upper caseCopyright © 2017 Java Wikipedia API (Bliki engine). All rights reserved.