org.apache.wiki.parser
Class WikiDocument

java.lang.Object
  extended by org.jdom2.Document
      extended by org.apache.wiki.parser.WikiDocument
All Implemented Interfaces:
Serializable, Cloneable, org.jdom2.NamespaceAware, org.jdom2.Parent

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
WikiDocument(WikiPage page)
          Creates a new WikiDocument for a specific page.
 
Method Summary
 WikiContext getContext()
          Returns the wiki context for this document.
 WikiPage getPage()
          Return the WikiPage for whom this WikiDocument exists.
 String getPageData()
          Returns the wikimarkup used to render this document.
 void setContext(WikiContext ctx)
          Set the WikiContext in which the WikiDocument is rendered.
 void setPageData(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 Detail

WikiDocument

public WikiDocument(WikiPage page)
Creates a new WikiDocument for a specific page.

Parameters:
page - The page to which this document refers to.
Method Detail

setPageData

public void setPageData(String data)
Set the WikiMarkup for this document.

Parameters:
data - The WikiMarkup

getPageData

public String getPageData()
Returns the wikimarkup used to render this document.

Returns:
The WikiMarkup

getPage

public WikiPage getPage()
Return the WikiPage for whom this WikiDocument exists.

Returns:
The WikiPage

setContext

public void setContext(WikiContext ctx)
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

public WikiContext getContext()
Returns the wiki context for this document. This method may return null if the associated wiki session had previously been garbage-collected.

Returns:
the wiki context


Copyright © {inceptionYear}-2014 The Apache Software Foundation. All rights reserved.