Jiffie: Java InterFace For Internet Explorer

net.sf.jiffie
Class ElementContainer

Package class diagram package ElementContainer
java.lang.Object
  extended by net.sf.jiffie.IDispatch
      extended by net.sf.jiffie.BrowserDispatch
          extended by net.sf.jiffie.IHTMLDOMNode
              extended by net.sf.jiffie.ElementContainer
All Implemented Interfaces:
java.lang.Cloneable, Releaseable
Direct Known Subclasses:
IHTMLDocument2, IHTMLElement

public class ElementContainer
extends IHTMLDOMNode

This class implements a set of methods common to objects that contain HTML elements. The common feature of these objects is that they have an "all" collection, which can be retrieved and filtered in order to retrieve the child HTML elements. Note that the getByName methods will retrieve elements from the document where either the id or the name attribute of that element matches the supplied name.


Field Summary
 
Fields inherited from class net.sf.jiffie.IDispatch
IID
 
Constructor Summary
ElementContainer(InternetExplorer parentBrowser, Dispatch object)
          Constructor
 
Method Summary
 IDispatch getElementById(java.lang.String elementId)
          Retrieves a generic HTML element by id.
 IDispatch getElementByName(java.lang.String name)
          This is a convenience method provided to simplify code which expects to retrieve a single element by name.
 IDispatch getElementByNameAndTag(java.lang.String name, java.lang.String tag)
          This is a convenience method provided to simplify code which expects to retrieve a single element by name and tag name.
 IDispatch getElementByTag(java.lang.String name)
          This is a convenience method provided to simplify code which expects to retrieve a single element by tag name.
 ElementList getElementList()
          This method retrieves a collection of all document elements.
 ElementList getElementListByName(java.lang.String name)
          Retrieves an ElementList of zero or more HTML elements by name.
 ElementList getElementListByNameAndTag(java.lang.String name, java.lang.String tag)
          A convenience method to retrieve an element based on both its name and its tag.
 ElementList getElementListByTag(java.lang.String tag)
          Retrieves an ElementList of zero or more HTML elements by tag name.
 
Methods inherited from class net.sf.jiffie.IHTMLDOMNode
appendChild, createNodeFromProperty, getAttributes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling
 
Methods inherited from class net.sf.jiffie.BrowserDispatch
getElementProperty, getParentBrowser
 
Methods inherited from class net.sf.jiffie.IDispatch
call, call, call, call, call, clone, finalize, getBooleanProperty, getDispatch, getDispatchProperty, getIntegerProperty, getStringProperty, getVariantProperty, isReleased, newDispatch, queryInterface, release, setBooleanProperty, setIntegerProperty, setStringProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementContainer

public ElementContainer(InternetExplorer parentBrowser,
                        Dispatch object)
Constructor

Parameters:
parentBrowser - parent browser
object - Jacob dispatch interface
Method Detail

getElementList

public ElementList getElementList()
                           throws JiffieException
This method retrieves a collection of all document elements.

Returns:
all collection
Throws:
JiffieException - if error creating element list

getElementListByName

public ElementList getElementListByName(java.lang.String name)
                                 throws JiffieException
Retrieves an ElementList of zero or more HTML elements by name.

Parameters:
name - element name
Returns:
element list
Throws:
JiffieException - if error creating element list

getElementListByTag

public ElementList getElementListByTag(java.lang.String tag)
                                throws JiffieException
Retrieves an ElementList of zero or more HTML elements by tag name.

Parameters:
tag - element tag name
Returns:
element list
Throws:
JiffieException - if error creating element list

getElementListByNameAndTag

public ElementList getElementListByNameAndTag(java.lang.String name,
                                              java.lang.String tag)
                                       throws JiffieException
A convenience method to retrieve an element based on both its name and its tag.

Parameters:
name - element name
tag - element tag name
Returns:
element list
Throws:
JiffieException - if error creating element list

getElementById

public IDispatch getElementById(java.lang.String elementId)
                         throws JiffieException
Retrieves a generic HTML element by id.

Parameters:
elementId - element id
Returns:
HTML element or null if not found
Throws:
JiffieException - if error creating element list

getElementByName

public IDispatch getElementByName(java.lang.String name)
                           throws JiffieException
This is a convenience method provided to simplify code which expects to retrieve a single element by name.

Parameters:
name - element name
Returns:
element
Throws:
JiffieException - if error creating element list

getElementByTag

public IDispatch getElementByTag(java.lang.String name)
                          throws JiffieException
This is a convenience method provided to simplify code which expects to retrieve a single element by tag name.

Parameters:
name - element tag name
Returns:
element
Throws:
JiffieException - if error creating element list

getElementByNameAndTag

public IDispatch getElementByNameAndTag(java.lang.String name,
                                        java.lang.String tag)
                                 throws JiffieException
This is a convenience method provided to simplify code which expects to retrieve a single element by name and tag name.

Parameters:
name - element name
tag - element tag name
Returns:
element
Throws:
JiffieException - if error creating element list


Copyright © 2004-2009 Packwood Software. All Rights Reserved.