|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.test.ParsedHtml
public class ParsedHtml
Retrieves the text content of a MockResponse and parses it as HTML.
| Method Summary | |
|---|---|
Document |
getDocument()
Retrieves the DOM XML document that corresponds to the parsed HTML. |
List<MockForm> |
getForms()
Retrieves the list of all the forms in the HTML document. |
MockForm |
getFormWithId(String id)
Retrieves the first form in the HTML document with a particular id attribute. |
MockForm |
getFormWithName(String name)
Retrieves the first form in the HTML document with a particular name attribute. |
List<MockLink> |
getLinks()
Retrieves the list of all the links in the HTML document. |
MockLink |
getLinkWithId(String id)
Retrieves the first link in the HTML document with a particular id attribute. |
MockLink |
getLinkWithImageAlt(String alt)
Retrieves the first link in the HTML document that surrounds an img tag with a certain alt attribute. |
MockLink |
getLinkWithImageName(String name)
Retrieves the first link in the HTML document that surrounds an img tag with a certain name attribute. |
MockLink |
getLinkWithName(String name)
Retrieves the first link in the HTML document with a particular name attribute. |
MockLink |
getLinkWithText(String text)
Retrieves the first link in the HTML document that surrounds a particular text. |
static String |
getNodeAttribute(Node node,
String attributeName)
Retrieves the value of the attribute of an XML DOM node. |
String |
getTitle()
Retrieves the text of the title tag. |
static ParsedHtml |
parse(MockResponse response)
Parses the text content of a MockResponse object as HTML and
returns the result as an instance of ParsedHtml. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ParsedHtml parse(MockResponse response)
throws IOException,
SAXException
MockResponse object as HTML and
returns the result as an instance of ParsedHtml.
response - the response whose text content will be parsed
ParsedHtml
IOException
SAXExceptionpublic Document getDocument()
public String getTitle()
title tag.
public List<MockForm> getForms()
MockForm instancesgetFormWithName(java.lang.String),
getFormWithId(java.lang.String)public MockForm getFormWithName(String name)
name attribute.
name - the content of the name attribute
MockForm whose name attribute
matches; or
null if no such form could be found
getForms(),
getFormWithId(java.lang.String)public MockForm getFormWithId(String id)
id attribute.
id - the content of the id attribute
MockForm whose id attribute
matches; or
null if no such form could be found
getForms(),
getFormWithName(java.lang.String)public List<MockLink> getLinks()
MockLink instancesgetLinkWithName(java.lang.String),
getLinkWithId(java.lang.String),
getLinkWithText(java.lang.String),
getLinkWithImageAlt(java.lang.String),
getLinkWithImageName(java.lang.String)public MockLink getLinkWithName(String name)
name attribute.
name - the content of the name attribute
MockLink whose name attribute
matches; or
null if no such link could be found
getLinks(),
getLinkWithId(java.lang.String),
getLinkWithText(java.lang.String),
getLinkWithImageAlt(java.lang.String),
getLinkWithImageName(java.lang.String)public MockLink getLinkWithId(String id)
id attribute.
id - the content of the id attribute
MockLink whose id attribute
matches; or
null if no such link could be found
getLinks(),
getLinkWithName(java.lang.String),
getLinkWithText(java.lang.String),
getLinkWithImageAlt(java.lang.String),
getLinkWithImageName(java.lang.String)public MockLink getLinkWithText(String text)
text - the surrounded text
MockLink whose surrounded text matches; or
null if no such link could be found
getLinks(),
getLinkWithName(java.lang.String),
getLinkWithId(java.lang.String),
getLinkWithText(java.lang.String),
getLinkWithImageName(java.lang.String)public MockLink getLinkWithImageAlt(String alt)
img tag with a certain alt attribute.
alt - the content of the alt attribute
MockLink that has an img tag
whose alt attribute matches; or
null if no such link could be found
getLinks(),
getLinkWithName(java.lang.String),
getLinkWithId(java.lang.String),
getLinkWithText(java.lang.String),
getLinkWithImageName(java.lang.String)public MockLink getLinkWithImageName(String name)
img tag with a certain name attribute.
name - the content of the name attribute
MockLink that has an img tag
whose name attribute matches; or
null if no such link could be found
getLinks(),
getLinkWithName(java.lang.String),
getLinkWithId(java.lang.String),
getLinkWithText(java.lang.String),
getLinkWithImageAlt(java.lang.String)
public static String getNodeAttribute(Node node,
String attributeName)
node - the node where the attribute should be obtained fromattributeName - the name of the attribute
null if no attribute could be found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||