public class MwRevisionImpl extends Object implements MwRevision
MwRevision
. The implementation is meant to be used
as a lightweight container that is reusable and thus mutable, but only using
package-private access. Even without the re-use (which might be reconsidered)
the package-private mutability makes sense during the stateful XML parsing
process.MODEL_WIKIBASE_ITEM, MODEL_WIKIBASE_LEXEME, MODEL_WIKIBASE_PROPERTY, MODEL_WIKITEXT, NO_REVISION_ID
Constructor and Description |
---|
MwRevisionImpl()
Constructor.
|
MwRevisionImpl(MwRevision mwRevision)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getComment()
Returns the comment string that was used for making the edit that led to
this revision.
|
String |
getContributor()
Returns the name for the contributor that made the edit that led to this
revision.
|
int |
getContributorId()
Returns the user id of the contributor who made the edit that led to this
revision, or -1 if the edit was not made by a registered user.
|
String |
getFormat()
Returns the format of the revision text.
|
String |
getModel()
Returns the content model of the revision.
|
int |
getNamespace()
Returns the id of the MediaWiki namespace of the revised page.
|
int |
getPageId()
Returns the numeric page id of the revised page.
|
long |
getParentRevisionId()
Returns the numeric id of the parent revision.
|
String |
getPrefixedTitle()
Returns the title string of the revised page, including namespace
prefixes and subpages, if any.
|
long |
getRevisionId()
Returns the numeric id of the current revision.
|
String |
getText()
Returns the text content of the current revision.
|
String |
getTimeStamp()
Returns the time stamp at which the current revision was made.
|
String |
getTitle()
Returns the title string of the revised page without any namespace
prefixes.
|
boolean |
hasRegisteredContributor()
Returns true if the contributor who made the edit that led to this
revision was logged in with a user account.
|
String |
toString() |
public MwRevisionImpl()
public MwRevisionImpl(MwRevision mwRevision)
public String getPrefixedTitle()
MwRevision
On a single MediaWiki site, the prefixed page title is a key for a page at any given moment. However, users may change the title and namespace by moving pages. The page id provides a better clue to identify pages across history.
getPrefixedTitle
in interface MwRevision
public String getTitle()
MwRevision
On a single MediaWiki site, the combination of page title and page namespace is a key for a page at any given moment. However, users may change the title and namespace by moving pages. The page id provides a better clue to identify pages across history.
getTitle
in interface MwRevision
public int getNamespace()
MwRevision
On a single MediaWiki site, the combination of page title and page namespace is a key for a page at any given moment. However, users may change the title and namespace by moving pages. The page id provides a better clue to identify pages across history.
getNamespace
in interface MwRevision
public int getPageId()
MwRevision
getPageId
in interface MwRevision
public long getRevisionId()
MwRevision
getRevisionId
in interface MwRevision
public long getParentRevisionId()
MwRevision
getParentRevisionId
in interface MwRevision
public String getTimeStamp()
MwRevision
getTimeStamp
in interface MwRevision
public String getText()
MwRevision
MwRevision.getFormat()
. To interpret
it properly, one should also know the content model, obtained from
MwRevision.getModel()
.getText
in interface MwRevision
public String getModel()
MwRevision
MwRevision.getFormat()
.getModel
in interface MwRevision
public String getFormat()
MwRevision
MwRevision.getModel()
. Like the content model, the format might change
between revisions of a page, but this is very rare in practice.getFormat
in interface MwRevision
public String getComment()
MwRevision
getComment
in interface MwRevision
public String getContributor()
MwRevision
MwRevision.hasRegisteredContributor()
.getContributor
in interface MwRevision
public int getContributorId()
MwRevision
getContributorId
in interface MwRevision
public boolean hasRegisteredContributor()
MwRevision
hasRegisteredContributor
in interface MwRevision
Copyright © 2014–2024 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage