public class WikiPage extends java.lang.Object implements Page
ALIAS, AUTHOR, CHANGENOTE, DESCRIPTION, REDIRECT, VIEWCOUNT| Constructor and Description |
|---|
WikiPage(Engine engine,
java.lang.String name)
Create a new WikiPage using a given engine and name.
|
WikiPage(WikiEngine engine,
java.lang.String name)
Deprecated.
kept for compatibility with page/attachment providers not using public API. Use
WikiPage(Engine, String) instead. |
| Modifier and Type | Method and Description |
|---|---|
WikiPage |
clone()
Creates a deep clone of a WikiPage.
|
int |
compareTo(Page page)
Compares a page with another by name using the defined PageNameComparator.
|
boolean |
equals(java.lang.Object o)
A page is equal to another page if its name and version are equal.
|
Acl |
getAcl()
Returns the Acl for this page.
|
<T> T |
getAttribute(java.lang.String key)
A WikiPage may have a number of attributes, which might or might not be available.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns the full attributes Map, in case external code needs to iterate through the attributes.
|
java.lang.String |
getAuthor()
Returns author name, or null, if no author has been defined.
|
java.util.Date |
getLastModified()
Returns the date when this page was last modified.
|
java.lang.String |
getName()
Returns the name of the page.
|
long |
getSize()
Returns the size of the page.
|
int |
getVersion()
Returns the version that this WikiPage instance represents.
|
java.lang.String |
getWiki()
Returns the wiki name for this page
|
int |
hashCode() |
boolean |
hasMetadata()
Returns
true if the page has valid metadata; that is, it has been parsed. |
void |
invalidateMetadata()
This method will remove all metadata from the page.
|
<T> T |
removeAttribute(java.lang.String key)
Removes an attribute from the page, if it exists.
|
void |
setAcl(Acl acl)
Deprecated.
|
void |
setAcl(Acl acl)
Sets the Acl for this page.
|
void |
setAttribute(java.lang.String key,
java.lang.Object attribute)
Sets an metadata attribute.
|
void |
setAuthor(java.lang.String author)
Sets the author of the page.
|
void |
setHasMetadata()
Sets the metadata flag to true.
|
void |
setLastModified(java.util.Date date)
Sets the last modification date.
|
void |
setSize(long size)
Sets the size.
|
void |
setVersion(int version)
Sets the page version.
|
java.lang.String |
toString()
Returns a debug-suitable version of the page.
|
public WikiPage(Engine engine, java.lang.String name)
engine - The Engine that owns this page.name - The name of the page.@Deprecated public WikiPage(WikiEngine engine, java.lang.String name)
WikiPage(Engine, String) instead.engine - The Engine that owns this page.name - The name of the page.public java.lang.String getName()
public <T> T getAttribute(java.lang.String key)
getAttribute in interface Pagekey - The key using which the attribute is fetchedpublic void setAttribute(java.lang.String key, java.lang.Object attribute)
setAttribute in interface Pagekey - The key for the attribute used to fetch the attribute later on.attribute - The attribute valuegetAttribute(String)public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
getAttributes in interface Pagepublic <T> T removeAttribute(java.lang.String key)
removeAttribute in interface Pagekey - The key for the attributepublic java.util.Date getLastModified()
getLastModified in interface Pagepublic void setLastModified(java.util.Date date)
setLastModified in interface Pagedate - The datepublic void setVersion(int version)
setVersion in interface Pageversion - The version numberpublic int getVersion()
getVersion in interface Pagepublic long getSize()
public void setSize(long size)
public Acl getAcl()
null, in case there is no Acl defined, or it has not yet been set by
setAcl(Acl).@Deprecated public void setAcl(Acl acl)
setAcl(org.apache.wiki.api.core.Acl)AclManager.setPermissions(Page, org.apache.wiki.api.core.Acl).acl - The Acl to setsetAcl(org.apache.wiki.api.core.Acl)public void setAcl(Acl acl)
AclManager.setPermissions(Page, org.apache.wiki.api.core.Acl).public void setAuthor(java.lang.String author)
public java.lang.String getAuthor()
public java.lang.String getWiki()
public void invalidateMetadata()
invalidateMetadata in interface Pagepublic boolean hasMetadata()
true if the page has valid metadata; that is, it has been parsed. Note that this method is a kludge to
support our pre-3.0 metadata system, and as such will go away with the new API.hasMetadata in interface Pagepublic void setHasMetadata()
setHasMetadata in interface Pagepublic java.lang.String toString()
toString in class java.lang.Objectpublic WikiPage clone()
public int compareTo(Page page)
compareTo in interface java.lang.Comparable<Page>page - The page to compare againstpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.