com.gargoylesoftware.htmlunit.xml
Class XmlPage

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.xml.XmlPage
All Implemented Interfaces:
Page

public class XmlPage
extends java.lang.Object
implements Page

A page that will be returned for response with content type "text/xml". It doesn't implement itself Document to allow to see the source of badly formed xml responses.

Version:
$Revision: 1.3 $
Author:
Marc Guillemot, David K. Taylor

Constructor Summary
XmlPage(WebResponse webResponse, WebWindow enclosingWindow)
 Create an instance.
 
Method Summary
 void cleanUp()
 Clean up this page.
 java.lang.String getContent()
 Return the content of the page
 WebWindow getEnclosingWindow()
 Return the window that this page is sitting inside.
 WebResponse getWebResponse()
 Return the web response that was originally used to create this page.
 org.w3c.dom.Document getXmlDocument()
 Gets the DOM representation of the xml content
 void initialize()
 Initialize this page.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlPage

public XmlPage(WebResponse webResponse,
               WebWindow enclosingWindow)
        throws java.io.IOException
Create an instance. A warning is logged if an exception is thrown while parsing the xml content (for instance when the content is not a valid xml and can't be parsed).

Parameters:
webResponse - The response from the server
enclosingWindow - The window that holds the page.
Throws:
java.io.IOException - If the page could not be created
Method Detail

cleanUp

public void cleanUp()
Clean up this page.

Specified by:
cleanUp in interface Page

getContent

public java.lang.String getContent()
Return the content of the page

Returns:
See above

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.

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

getXmlDocument

public org.w3c.dom.Document getXmlDocument()
Gets the DOM representation of the xml content

Returns:
null if the content couldn't be parsed.

initialize

public void initialize()
Initialize this page.

Specified by:
initialize in interface Page


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.