/** * Returns the stylesheet linked in the head of the page. * <code> * <link type="text/css" rel="stylesheet" href="/mystyle.css" /> * </code> * will return "/mystyle.css". * @exception SAXException thrown if there is an error parsing this response **/ public String getExternalStyleSheet() throws SAXException { return getReceivedPage().getExternalStyleSheet(); }
/** * Returns the onLoad event script. */ public String getOnLoadEvent() throws SAXException { Element mainElement = getMainElement( ((Document) getOriginalDOM()) ); return mainElement == null ? "" : mainElement.getAttribute( "onload" ); }
public String getTitle() throws SAXException { return HTMLPage.this.getTitle(); }
/** * get the received Page * @return the received page * @throws SAXException */ HTMLPage getReceivedPage() throws SAXException { if (_page == null) { try { _parsingPage = true; if (!isHTML()) throw new NotHTMLException( getContentType() ); _page = new HTMLPage( this, _frame, _baseURL, _baseTarget, getCharacterSet() ); _page.parse( getText(), _pageURL ); if (_page == null) throw new IllegalStateException( "replaceText called in the middle of getReceivedPage()" ); ((HTMLDocumentImpl) _page.getRootNode()).getWindow().setProxy( this ); } catch (IOException e) { HttpUnitUtils.handleException(e); throw new RuntimeException( e.toString() ); } finally { _parsingPage = false; } } return _page; }
public void load() throws SAXException { if (isHTML()) { getReceivedPage().getForms(); // TODO be more explicit here - don't care about forms, after all doEventScript( getReceivedPage().getOnLoadEvent() ); } }
/** * get the received Page * @return the received page * @throws SAXException */ HTMLPage getReceivedPage() throws SAXException { if (_page == null) { try { _parsingPage = true; if (!isHTML()) throw new NotHTMLException( getContentType() ); _page = new HTMLPage( this, _frame, _baseURL, _baseTarget, getCharacterSet() ); _page.parse( getText(), _pageURL ); if (_page == null) throw new IllegalStateException( "replaceText called in the middle of getReceivedPage()" ); ((HTMLDocumentImpl) _page.getRootNode()).getWindow().setProxy( this ); } catch (IOException e) { HttpUnitUtils.handleException(e); throw new RuntimeException( e.toString() ); } finally { _parsingPage = false; } } return _page; }
public HTMLPage.Scriptable getDocument() { try { if (!isHTML()) replaceText( BLANK_HTML, HTML_CONTENT ); return getReceivedPage().getScriptableObject(); } catch (SAXException e) { throw new RuntimeException( e.toString() ); } }
/** * Retrieves the "content" of the meta tags for a key pair attribute-attributeValue. * <code> * <meta name="robots" content="index" /> * <meta name="robots" content="follow" /> * <meta http-equiv="Expires" content="now" /> * </code> * this can be used like this * <code> * getMetaTagContent("name","robots") will return { "index","follow" } * getMetaTagContent("http-equiv","Expires") will return { "now" } * </code> * @exception SAXException thrown if there is an error parsing this response **/ public String[] getMetaTagContent(String attribute, String attributeValue) throws SAXException { return getReceivedPage().getMetaTagContent(attribute, attributeValue); }
/** * Returns the onLoad event script. */ public String getOnLoadEvent() throws SAXException { Element mainElement = getMainElement( ((Document) getOriginalDOM()) ); return mainElement == null ? "" : mainElement.getAttribute( "onload" ); }
public void load() throws SAXException { if (isHTML()) { getReceivedPage().getForms(); // TODO be more explicit here - don't care about forms, after all doEventScript( getReceivedPage().getOnLoadEvent() ); } }
public WebApplet[] getApplets() throws SAXException { return getReceivedPage().getApplets(); }
/** * Returns a copy of the domain object model tree associated with this response. * If the response is HTML, it will use a special parser which can transform HTML into an XML DOM. * @exception SAXException thrown if there is an error parsing the response. **/ public Document getDOM() throws SAXException { if (isHTML()) { return (Document) getReceivedPage().getDOM(); } else { try { return HttpUnitUtils.parse( new InputSource( new StringReader( getText() ) ) ); } catch (IOException e) { throw new SAXException( e ); } } }
/** * get the received Page * @return the received page * @throws SAXException */ HTMLPage getReceivedPage() throws SAXException { if (_page == null) { try { _parsingPage = true; if (!isHTML()) throw new NotHTMLException( getContentType() ); _page = new HTMLPage( this, _frame, _baseURL, _baseTarget, getCharacterSet() ); _page.parse( getText(), _pageURL ); if (_page == null) throw new IllegalStateException( "replaceText called in the middle of getReceivedPage()" ); ((HTMLDocumentImpl) _page.getRootNode()).getWindow().setProxy( this ); } catch (IOException e) { HttpUnitUtils.handleException(e); throw new RuntimeException( e.toString() ); } finally { _parsingPage = false; } } return _page; }
public void load() throws SAXException { if (isHTML()) { getReceivedPage().getForms(); // TODO be more explicit here - don't care about forms, after all doEventScript( getReceivedPage().getOnLoadEvent() ); } }
public HTMLPage.Scriptable getDocument() { try { if (!isHTML()) replaceText( BLANK_HTML, HTML_CONTENT ); return getReceivedPage().getScriptableObject(); } catch (SAXException e) { throw new RuntimeException( e.toString() ); } }
/** * Retrieves the "content" of the meta tags for a key pair attribute-attributeValue. * <code> * <meta name="robots" content="index" /> * <meta name="robots" content="follow" /> * <meta http-equiv="Expires" content="now" /> * </code> * this can be used like this * <code> * getMetaTagContent("name","robots") will return { "index","follow" } * getMetaTagContent("http-equiv","Expires") will return { "now" } * </code> * @exception SAXException thrown if there is an error parsing this response **/ public String[] getMetaTagContent(String attribute, String attributeValue) throws SAXException { return getReceivedPage().getMetaTagContent(attribute, attributeValue); }
public WebApplet[] getApplets() throws SAXException { return getReceivedPage().getApplets(); }
/** * Returns a copy of the domain object model tree associated with this response. * If the response is HTML, it will use a special parser which can transform HTML into an XML DOM. * @exception SAXException thrown if there is an error parsing the response. **/ public Document getDOM() throws SAXException { if (isHTML()) { return (Document) getReceivedPage().getDOM(); } else { try { return HttpUnitUtils.parse( new InputSource( new StringReader( getText() ) ) ); } catch (IOException e) { throw new SAXException( e ); } } }
public String getTitle() throws SAXException { return HTMLPage.this.getTitle(); }
/** * Returns the onLoad event script. */ public String getOnLoadEvent() throws SAXException { Element mainElement = getMainElement( ((Document) getOriginalDOM()) ); return mainElement == null ? "" : mainElement.getAttribute( "onload" ); }