Package org.apache.wiki.parser
Class WikiDocument
java.lang.Object
org.jdom2.Document
org.apache.wiki.parser.WikiDocument
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,org.jdom2.NamespaceAware
,org.jdom2.Parent
- Direct Known Subclasses:
MarkdownDocument
public class WikiDocument extends org.jdom2.Document
Stores the DOM tree of a rendered WikiPage. This class extends the org.jdom.Document to provide some extra metadata
specific to JSPWiki.
The document is not stored as metadata in the WikiPage because otherwise it could not be cached separately.
- Since:
- 2.4
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.jdom2.Document
baseURI
-
Constructor Summary
Constructors Constructor Description WikiDocument(Page page)
Creates a new WikiDocument for a specific page. -
Method Summary
Modifier and Type Method Description Context
getContext()
Returns the wiki context for this document.Page
getPage()
Return the WikiPage for whom this WikiDocument exists.java.lang.String
getPageData()
Returns the wikimarkup used to render this document.void
setContext(Context ctx)
Set the WikiContext in which the WikiDocument is rendered.void
setPageData(java.lang.String data)
Set the WikiMarkup for this document.Methods inherited from class org.jdom2.Document
addContent, addContent, addContent, addContent, canContainContent, clone, cloneContent, detachRootElement, equals, getBaseURI, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getDocType, getDocument, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getParent, getProperty, getRootElement, hashCode, hasRootElement, indexOf, removeContent, removeContent, removeContent, removeContent, setBaseURI, setContent, setContent, setContent, setContent, setDocType, setProperty, setRootElement, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
WikiDocument
Creates a new WikiDocument for a specific page.- Parameters:
page
- The page to which this document refers to.
-
-
Method Details
-
setPageData
Set the WikiMarkup for this document.- Parameters:
data
- The WikiMarkup
-
getPageData
Returns the wikimarkup used to render this document.- Returns:
- The WikiMarkup
-
getPage
Return the WikiPage for whom this WikiDocument exists.- Returns:
- The WikiPage
-
setContext
Set the WikiContext in which the WikiDocument is rendered. The WikiContext is stored in a WeakReference, which means that it can be garbagecollected away. This is to allow for caching of the WikiDocument without having to carry the WikiContext around for a long time.- Parameters:
ctx
- A WikiContext.
-
getContext
Returns the wiki context for this document. This method may returnnull
if the associated wiki session had previously been garbage-collected.- Returns:
- the wiki context
-