com.gargoylesoftware.htmlunit
Class SgmlPage

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.DomNode
      extended by com.gargoylesoftware.htmlunit.SgmlPage
All Implemented Interfaces:
Page, Serializable, Cloneable
Direct Known Subclasses:
HtmlPage, XmlPage

public abstract class SgmlPage
extends DomNode
implements Page

A basic class to be implemented by HtmlPage and XmlPage.

Version:
$Revision: 2132 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode
DomNode.ChildIterator, DomNode.DescendantElementsIterator
 
Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE
 
Constructor Summary
SgmlPage(WebResponse webResponse, WebWindow webWindow)
          Create an instance of SgmlPage
 
Method Summary
 void cleanUp()
          Clean up this page.
 DomDocumentFragment createDomDocumentFragment()
          Creates an empty DomDocumentFragment object.
 WebWindow getEnclosingWindow()
          Return the window that this page is sitting inside.
 Page getNativePage()
          INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Returns the Page interface, should be removed, and use DomNode.getPage() instead.
 String getNodeName()
          Get the name for the current node.
 short getNodeType()
          Get the type of the current node.
 WebClient getWebClient()
          Return the WebClient that originally loaded this page
 WebResponse getWebResponse()
          Return the web response that was originally used to create this page.
 void initialize()
          Initialize this page.
 void setEnclosingWindow(WebWindow window)
          Set the window that contains this page.
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asText, asXml, cloneDomNode, cloneNode, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getEventHandler, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLocalName, getLog, getNamespaceURI, getNextDomSibling, getNextSibling, getNodeValue, getPage, getParentDomNode, getParentNode, getPrefix, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, hasAttributes, insertBefore, isAncestorOf, isRenderedVisible, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, printXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removeEventHandler, removePropertyChangeListener, replace, setEventHandler, setEventHandler, setNextSibling, setNodeValue, setParentNode, setPrefix, setPreviousSibling, setReadyState, setScriptObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SgmlPage

public SgmlPage(WebResponse webResponse,
                WebWindow webWindow)
Create an instance of SgmlPage

Parameters:
webResponse - The web response that was used to create this page
webWindow - The window that this page is being loaded into.
Method Detail

cleanUp

public void cleanUp()
             throws IOException
Clean up this page. Gets called by the web client when an other page is loaded in the window.

Specified by:
cleanUp in interface Page
Throws:
IOException - If an IO problem occurs.

getWebResponse

public WebResponse getWebResponse()
Return the web response that was originally used to create this page.

Specified by:
getWebResponse in interface Page
Returns:
The web response

initialize

public void initialize()
                throws IOException
Initialize this page.

Specified by:
initialize in interface Page
Throws:
IOException - If an IO problem occurs.

getNodeName

public String getNodeName()
Get the name for the current node.

Specified by:
getNodeName in class DomNode
Returns:
The node name

getNodeType

public short getNodeType()
Get the type of the current node.

Specified by:
getNodeType in class DomNode
Returns:
The node type

getEnclosingWindow

public WebWindow getEnclosingWindow()
Return the window that this page is sitting inside.

Specified by:
getEnclosingWindow in interface Page
Returns:
The enclosing frame or null if this page isn't inside a frame.

setEnclosingWindow

public void setEnclosingWindow(WebWindow window)
Set the window that contains this page.

Parameters:
window - The new frame or null if this page is being removed from a frame.

getWebClient

public WebClient getWebClient()
Return the WebClient that originally loaded this page

Returns:
See above

createDomDocumentFragment

public DomDocumentFragment createDomDocumentFragment()
Creates an empty DomDocumentFragment object.

Returns:
a newly created DomDocumentFragment.

getNativePage

public Page getNativePage()
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Returns the Page interface, should be removed, and use DomNode.getPage() instead.

Overrides:
getNativePage in class DomNode
Returns:
the Page interface.


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.