Class BlockElement
java.lang.Object
com.meterware.httpunit.ParsedHTML
com.meterware.httpunit.BlockElement
- All Implemented Interfaces:
HTMLElement, HTMLSegment, ScriptingEventHandler
Represents a block-level element such as a paragraph or table cell, which can contain other elements.
- Since:
- 1.6
- Author:
- Russell Gold
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockElement(WebResponse response, FrameSelector frame, URL baseURL, String baseTarget, Node rootNode, String characterSet) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.since 1.7 - use doEventScript insteadbooleandoEventScript(String eventScript) optional do the event if it's definedbooleangetAttribute(String name) get the attribute with the given nameprotected intgetAttributeValue(Node node, String attributeName, int defaultValue) Returns the class attribute associated with this element.getDOM()Returns a copy of the domain object model associated with this HTML segment.getID()Returns the ID associated with this element.getName()Returns the name associated with this element.getNode()Returns the DOM node underlying this element.Returns the scriptable delegate which can provide the scriptable delegate for this element.Returns the delegate which supports scripting this element.Returns the tag for this block.getText()Returns the text value of this block.getTitle()Returns the title associated with this element.booleanhandleEvent(String eventName) handle the event with the given name by getting the attribute and then executing the eventScript for itinthashCode()booleanisSupportedAttribute(String name) Returns true if this element may have an attribute with the specified name.voidremoveAttribute(String name) remove the attribute with the given namevoidsetAttribute(String name, Object value) set the attribute with the given name to the given valueMethods inherited from class ParsedHTML
getApplets, getElementNames, getElementsWithAttribute, getElementsWithName, getElementWithID, getFirstMatchingForm, getFirstMatchingLink, getFirstMatchingTable, getFirstMatchingTextBlock, getForms, getFormWithID, getFormWithName, getFrames, getImages, getImageWithAltText, getImageWithName, getImageWithSource, getLinks, getLinkWith, getLinkWithID, getLinkWithImageText, getLinkWithName, getMatchingForms, getMatchingLinks, getMatchingTables, getNextTextBlock, getTables, getTableStartingWith, getTableStartingWithPrefix, getTableWithID, getTableWithSummary, getTextBlocks, isWebLink, toStringMethods inherited from interface HTMLSegment
getApplets, getElementNames, getElementsWithAttribute, getElementsWithName, getElementWithID, getFirstMatchingForm, getFirstMatchingLink, getFirstMatchingTable, getForms, getFormWithID, getFormWithName, getImages, getImageWithAltText, getImageWithName, getImageWithSource, getLinks, getLinkWith, getLinkWithImageText, getMatchingForms, getMatchingLinks, getMatchingTables, getTables, getTableStartingWith, getTableStartingWithPrefix, getTableWithID, getTableWithSummary, getTextBlocks
-
Constructor Details
-
BlockElement
protected BlockElement(WebResponse response, FrameSelector frame, URL baseURL, String baseTarget, Node rootNode, String characterSet)
-
-
Method Details
-
getText
Returns the text value of this block.- Specified by:
getTextin interfaceHTMLElement
-
getTagName
Returns the tag for this block.- Specified by:
getTagNamein interfaceHTMLElement
-
getDOM
Returns a copy of the domain object model associated with this HTML segment.- Overrides:
getDOMin classParsedHTML
-
getID
Returns the ID associated with this element. IDs are unique throughout the HTML document.- Specified by:
getIDin interfaceHTMLElement
-
getClassName
Returns the class attribute associated with this element.- Specified by:
getClassNamein interfaceHTMLElement
-
getName
Returns the name associated with this element.- Specified by:
getNamein interfaceHTMLElement
-
getTitle
Returns the title associated with this element.- Specified by:
getTitlein interfaceHTMLElement
-
getScriptingHandler
Returns the delegate which supports scripting this element.- Specified by:
getScriptingHandlerin interfaceHTMLElement
-
doEvent
Deprecated.since 1.7 - use doEventScript insteadhandle the event that has the given script attached by compiling the eventScript as a function and executing it- Specified by:
doEventin interfaceScriptingEventHandler- Parameters:
eventScript- - the script to use- Returns:
- true if the script is empty or the result of the script
-
doEventScript
optional do the event if it's defined- Specified by:
doEventScriptin interfaceScriptingEventHandler- Parameters:
eventScript- - the script to work on- Returns:
- true if the event script was handled
-
handleEvent
Description copied from interface:ScriptingEventHandlerhandle the event with the given name by getting the attribute and then executing the eventScript for it- Specified by:
handleEventin interfaceScriptingEventHandler- Parameters:
eventName-- Returns:
- the result of doEventScript
-
getParentDelegate
Description copied from interface:HTMLElementReturns the scriptable delegate which can provide the scriptable delegate for this element.- Specified by:
getParentDelegatein interfaceHTMLElement
-
newScriptable
- Specified by:
newScriptablein interfaceHTMLElement
-
getAttribute
get the attribute with the given name- Specified by:
getAttributein interfaceHTMLElement- Parameters:
name- - the name of the attribute to get
-
setAttribute
set the attribute with the given name to the given value- Specified by:
setAttributein interfaceHTMLElement- Parameters:
name- - the name of the attribute to setvalue- - the value to use
-
removeAttribute
remove the attribute with the given name- Specified by:
removeAttributein interfaceHTMLElement- Parameters:
name- - the name of the attribute
-
isSupportedAttribute
Returns true if this element may have an attribute with the specified name.- Specified by:
isSupportedAttributein interfaceHTMLElement
-
getNode
Description copied from interface:HTMLElementReturns the DOM node underlying this element.- Specified by:
getNodein interfaceHTMLElement
-
equals
-
hashCode
-
getAttributeValue
-