1 /* 2 * Copyright (c) 2002-2025 Gargoyle Software Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * https://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 package org.htmlunit; 16 17 import java.io.IOException; 18 import java.io.Serializable; 19 import java.net.URL; 20 21 /** 22 * An abstract page that represents some content returned from a server. 23 * 24 * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a> 25 * @author David K. Taylor 26 * @author Marc Guillemot 27 * @author Ronald Brill 28 */ 29 public interface Page extends Serializable { 30 31 /** 32 * Initialize this page. 33 * This method gets called when a new page is loaded and you should probably never 34 * need to call it directly. 35 * @throws IOException if an IO problem occurs 36 */ 37 void initialize() throws IOException; 38 39 /** 40 * Clean up this page. 41 * This method gets called by the web client when an other page is loaded in the window 42 * and you should probably never need to call it directly 43 */ 44 void cleanUp(); 45 46 /** 47 * Returns the web response that was originally used to create this page. 48 * @return the web response 49 */ 50 WebResponse getWebResponse(); 51 52 /** 53 * Returns the window that this page is sitting inside. 54 * @return the enclosing window 55 */ 56 WebWindow getEnclosingWindow(); 57 58 /** 59 * Returns the URL of this page. 60 * @return the URL of this page 61 */ 62 URL getUrl(); 63 64 /** 65 * Returns true if this page is an HtmlPage. 66 * @return true or false 67 */ 68 boolean isHtmlPage(); 69 }