net.sf.jacobie.ie
Class Document

java.lang.Object
  |
  +--com.jacob.com.JacobObject
        |
        +--com.jacob.com.Dispatch
              |
              +--net.sf.jacobie.ie.JacobieDispatch
                    |
                    +--net.sf.jacobie.ie.JacobieShared
                          |
                          +--net.sf.jacobie.ie.Document

public class Document
extends JacobieShared

Retrieves the Document Object of the active document. - Document doesn't really adhere to any HTML W3C Specification

Author:
Nick Neuberger

Field Summary
static java.lang.String COMPONENT_NAME
           
 
Fields inherited from class net.sf.jacobie.ie.JacobieShared
ID_GET_ELEMENTS_BY_TAG_NAME
 
Fields inherited from class net.sf.jacobie.ie.JacobieDispatch
componentName, CRLF, READY_STATE_COMPLETE
 
Fields inherited from class com.jacob.com.Dispatch
DISPID_ABOUTBOX, DISPID_AMBIENT_APPEARANCE, DISPID_AMBIENT_AUTOCLIP, DISPID_AMBIENT_BACKCOLOR, DISPID_AMBIENT_CHARSET, DISPID_AMBIENT_CODEPAGE, DISPID_AMBIENT_DISPLAYASDEFAULT, DISPID_AMBIENT_DISPLAYNAME, DISPID_AMBIENT_FONT, DISPID_AMBIENT_FORECOLOR, DISPID_AMBIENT_LOCALEID, DISPID_AMBIENT_MESSAGEREFLECT, DISPID_AMBIENT_PALETTE, DISPID_AMBIENT_SCALEUNITS, DISPID_AMBIENT_SHOWGRABHANDLES, DISPID_AMBIENT_SHOWHATCHING, DISPID_AMBIENT_SUPPORTSMNEMONICS, DISPID_AMBIENT_TEXTALIGN, DISPID_AMBIENT_TRANSFERPRIORITY, DISPID_AMBIENT_UIDEAD, DISPID_AMBIENT_USERMODE, DISPID_APPEARANCE, DISPID_AUTOSIZE, DISPID_BACKCOLOR, DISPID_BACKSTYLE, DISPID_BORDERCOLOR, DISPID_BORDERSTYLE, DISPID_BORDERVISIBLE, DISPID_BORDERWIDTH, DISPID_CAPTION, DISPID_CLICK, DISPID_COLLECT, DISPID_CONSTRUCTOR, DISPID_DBLCLICK, DISPID_DESTRUCTOR, DISPID_DOCLICK, DISPID_DRAWMODE, DISPID_DRAWSTYLE, DISPID_DRAWWIDTH, DISPID_ENABLED, DISPID_ERROREVENT, DISPID_EVALUATE, DISPID_FILLCOLOR, DISPID_FILLSTYLE, DISPID_FONT, DISPID_FORECOLOR, DISPID_HWND, DISPID_KEYDOWN, DISPID_KEYPRESS, DISPID_KEYUP, DISPID_MOUSEDOWN, DISPID_MOUSEICON, DISPID_MOUSEMOVE, DISPID_MOUSEPOINTER, DISPID_MOUSEUP, DISPID_NEWENUM, DISPID_PICTURE, DISPID_PROPERTYPUT, DISPID_READYSTATE, DISPID_READYSTATECHANGE, DISPID_REFRESH, DISPID_TABSTOP, DISPID_TEXT, DISPID_UNKNOWN, DISPID_VALID, DISPID_VALUE, fdexNameCaseSensitive, Get, LOCALE_SYSTEM_DEFAULT, m_pDispatch, Method, Put, PutRef
 
Constructor Summary
Document(com.jacob.com.Dispatch aDispatch)
           
Document(java.lang.String aCompName)
           
 
Method Summary
 java.util.Vector findElementsByName(java.lang.String aNameValue)
          Finds all elements with the specified name in the All collection.
 DefaultHTMLElement findElementsByName(java.lang.String aName, java.lang.String aValue)
          Finds the first element with the specified name and specified value from the All collection.
 DefaultHTMLElement findFirstElementByName(java.lang.String aName)
          Finds the first with the name.
 Form findFormByNameOrID(java.lang.String aNameOrID)
          Find the Form by either the name or id attribute.
 A findLink(java.lang.String aName)
          Finds a specific Link based on the Name (inner text) of the url.
 A findLink(java.lang.String aName, int iIndex)
          Finds a specific Link based on the Name (inner text) of the url and the specified index.
 A findLinkByID(java.lang.String aID)
          Finds a specific Link based on the ID attribute of the url.
 A findLinkByInnerHTML(java.lang.String aSearchText)
          Finds a specific Link based on the (inner html) of the url that is a contains search.
 A findLinkByInnerText(java.lang.String aSearchText)
          Finds a specific Link based on the (inner text) of the url that is a contains search.
 java.util.Vector getAll()
          Gets the All collection of elements contains by the document object.
 java.util.Vector getAll(java.lang.String aNameValue)
          Gets the All collection of elements contains by the document object.
 HTMLObject getDocumentElement()
          Gets the root node of the document.
 DefaultHTMLElement getElementById(java.lang.String aID)
          Gets a reference to the first object with the specified value of the ID attribute.
 java.util.Vector getForms()
          Gets the Forms collection.
 java.util.Vector getLinks()
          Gets the Links collection.
 A getLinks(int iIndex)
          Gets the Links collection object.
 Links getLinksObject()
          Deprecated. use getLinks() instead.
 java.lang.String getTitle()
          Gets the Title of the document.
 boolean hasForms()
          Checks to see if the document has forms.
 boolean hasLink(java.lang.String aName)
          Determines if the link exists by checking to see if "findLink" returns a null object.
 boolean hasLink(java.lang.String aName, int iIndex)
          Determines if the link exists by checking to see if "findLink" returns a null object.
 boolean hasLinkByID(java.lang.String aID)
          Determines if the link exists by checking to see if "findLinkByID" returns a null object.
 boolean hasLinkByInnerHTML(java.lang.String aName)
          Finds a specific Link based on the (inner html) of the url that is a contains search.
 boolean hasLinkByInnerText(java.lang.String aName)
          Finds a specific Link based on the (inner text) of the url that is a contains search.
 boolean hasLinks()
          Easily determines if there are any links in the collection.
 boolean isTextInDocument(java.lang.String aText)
          Convience to check if the text is contained in the current document.
 void printLinks(java.io.PrintStream aPrintStream)
          Prints the links on the page.
 
Methods inherited from class net.sf.jacobie.ie.JacobieShared
focus, getElementsByTagName
 
Methods inherited from class net.sf.jacobie.ie.JacobieDispatch
getMaxWaitDispatchCount, getReadyState, getWaitDispatchSleepTime, resetWaitTimes, setMaxWaitDispatchCount, setWaitDispatchSleepTime, waitWhileDispatchBusy
 
Methods inherited from class com.jacob.com.Dispatch
call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, call, callN_CaseSensitive, callN, callN, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSub, callSubN, callSubN, createInstance, finalize, get_CaseSensitive, get, get, getIDOfName, getIDsOfNames, getIDsOfNames, invoke, invoke, invoke, invokeSub, invokeSub, invokeSub, invokeSubv, invokeSubv, invokeSubv, invokev, invokev, invokev, invokev, obj2variant, obj2variant, put_Casesensitive, put, put, putRef, putRef, QueryInterface, release
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_NAME

public static final java.lang.String COMPONENT_NAME
See Also:
Constant Field Values
Constructor Detail

Document

public Document(java.lang.String aCompName)
Parameters:
aCompName -

Document

public Document(com.jacob.com.Dispatch aDispatch)
Parameters:
aDispatch -
Method Detail

isTextInDocument

public boolean isTextInDocument(java.lang.String aText)
Convience to check if the text is contained in the current document. Used the Document object and the innerhtml.

Parameters:
aText -
Returns:

hasForms

public boolean hasForms()
Checks to see if the document has forms.

Returns:

getForms

public java.util.Vector getForms()
Gets the Forms collection. Always will return a vector and never a null pointer.

See Also:
to check if there are any.

findFormByNameOrID

public Form findFormByNameOrID(java.lang.String aNameOrID)
Find the Form by either the name or id attribute.

Returns:

findLinkByID

public A findLinkByID(java.lang.String aID)
Finds a specific Link based on the ID attribute of the url. If not found, the method will return a null object.

Parameters:
aID -
Returns:

hasLinkByID

public boolean hasLinkByID(java.lang.String aID)
Determines if the link exists by checking to see if "findLinkByID" returns a null object.

Returns:

hasLinkByInnerHTML

public boolean hasLinkByInnerHTML(java.lang.String aName)
Finds a specific Link based on the (inner html) of the url that is a contains search. Returns true if the inner html contains the search text.

Returns:
true if found.

hasLinkByInnerText

public boolean hasLinkByInnerText(java.lang.String aName)
Finds a specific Link based on the (inner text) of the url that is a contains search. Returns true if the inner text contains the search text.

Returns:
true if found.

hasLink

public boolean hasLink(java.lang.String aName)
Determines if the link exists by checking to see if "findLink" returns a null object.

Parameters:
aName -
Returns:

findLinkByInnerText

public A findLinkByInnerText(java.lang.String aSearchText)
Finds a specific Link based on the (inner text) of the url that is a contains search. If not found, the method will return a null object.

Returns:

findLinkByInnerHTML

public A findLinkByInnerHTML(java.lang.String aSearchText)
Finds a specific Link based on the (inner html) of the url that is a contains search. If not found, the method will return a null object.

Returns:

findLink

public A findLink(java.lang.String aName)
Finds a specific Link based on the Name (inner text) of the url. If not found, the method will return a null object.

Parameters:
aName -
Returns:

hasLink

public boolean hasLink(java.lang.String aName,
                       int iIndex)
Determines if the link exists by checking to see if "findLink" returns a null object.

Parameters:
aName -
Returns:

findLink

public A findLink(java.lang.String aName,
                  int iIndex)
Finds a specific Link based on the Name (inner text) of the url and the specified index. This is a 1-based index. Not zero.

Parameters:
aName - The name of the link.
iIndex - The X index with the name specified.
Returns:

hasLinks

public boolean hasLinks()
Easily determines if there are any links in the collection.

Returns:

getLinks

public java.util.Vector getLinks()
Gets the Links collection.


getLinksObject

public Links getLinksObject()
Deprecated. use getLinks() instead.

Gets the Links collection object. Use getLinks() that returns a vector instead.


getLinks

public A getLinks(int iIndex)
Gets the Links collection object.


getTitle

public java.lang.String getTitle()
Gets the Title of the document.

Returns:

getDocumentElement

public HTMLObject getDocumentElement()
Gets the root node of the document.

Returns:

getAll

public java.util.Vector getAll()
Gets the All collection of elements contains by the document object.


getAll

public java.util.Vector getAll(java.lang.String aNameValue)
Gets the All collection of elements contains by the document object.


findElementsByName

public DefaultHTMLElement findElementsByName(java.lang.String aName,
                                             java.lang.String aValue)
Finds the first element with the specified name and specified value from the All collection.


findElementsByName

public java.util.Vector findElementsByName(java.lang.String aNameValue)
Finds all elements with the specified name in the All collection.

Parameters:
aNameValue -
Returns:

findFirstElementByName

public DefaultHTMLElement findFirstElementByName(java.lang.String aName)
Finds the first with the name. If nothing found, this method returns a null object.

Parameters:
aName -
Returns:

getElementById

public DefaultHTMLElement getElementById(java.lang.String aID)
Gets a reference to the first object with the specified value of the ID attribute.

Parameters:
aID -
Returns:

printLinks

public void printLinks(java.io.PrintStream aPrintStream)
Prints the links on the page.



Copyright © 2004-2005 SourceForge. All Rights Reserved.