public class HtmlElementIdentifier
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
attribute
The attribute of the form to examine.
|
static java.lang.String |
ATTRIBUTE_ACTION
Constants used to define various attributes of the HTML element that can be used in defining criteria.
|
static java.lang.String |
ATTRIBUTE_HREF |
static java.lang.String |
ATTRIBUTE_ID |
static java.lang.String |
ATTRIBUTE_NAME |
static java.lang.String |
ATTRIBUTE_SRC |
static java.lang.String |
ATTRIBUTE_TEXT_ANYWHERE |
static java.lang.String |
ATTRIBUTE_VALUE |
(package private) java.util.HashSet |
hsSequences
The valid sequences of the elements.
|
static org.apache.log4j.Logger |
log
Used for logging.
|
(package private) int |
numValidElements
Tracks the number of valid elements found.
|
(package private) java.lang.String |
strValidSequences
A string representation of the valid sequences.
|
(package private) java.lang.String |
value
The value to look for in the attribute.
|
| Constructor and Description |
|---|
HtmlElementIdentifier(java.lang.String criteria)
Initializes the object by parsing the criteria string and populating itself.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAttribute()
Gets the attribute of the anchor to examine.
|
java.lang.String |
getValidSeqencesString()
Gets a string representing the valid sequences.
|
java.lang.String |
getValue()
Gets the value to look for in the attribute.
|
boolean |
htmlElementMeetsCriteria(com.gargoylesoftware.htmlunit.html.HtmlElement htmlElement,
ScrapingSessionState scrapingSessionState)
Indicates whether or not the
HtmlForm meets the criteria. |
void |
resetNumValidElements()
Resets the number of valid found elements.
|
void |
setAttribute(java.lang.String attribute)
Sets the attribute of the anchor to examine.
|
void |
setValidSeqencesString(java.lang.String strValidSequences)
Sets a string representing the valid sequences.
|
void |
setValue(java.lang.String value)
Sets the value to look for in the attribute.
|
java.lang.String |
toString()
Gets the identifier criteria as a single string.
|
public static org.apache.log4j.Logger log
java.lang.String attribute
java.lang.String value
java.util.HashSet hsSequences
java.lang.String strValidSequences
int numValidElements
public static final java.lang.String ATTRIBUTE_ACTION
public static final java.lang.String ATTRIBUTE_HREF
public static final java.lang.String ATTRIBUTE_ID
public static final java.lang.String ATTRIBUTE_NAME
public static final java.lang.String ATTRIBUTE_SRC
public static final java.lang.String ATTRIBUTE_TEXT_ANYWHERE
public static final java.lang.String ATTRIBUTE_VALUE
public HtmlElementIdentifier(java.lang.String criteria)
criteria - A string representing the criteria.public java.lang.String getAttribute()
public void setAttribute(java.lang.String attribute)
attribute - The attribute as a string.public java.lang.String getValue()
public void setValue(java.lang.String value)
value - The value as a string.public java.lang.String toString()
toString in class java.lang.Objectpublic void setValidSeqencesString(java.lang.String strValidSequences)
strValidSequences - The string of sequences.public java.lang.String getValidSeqencesString()
public void resetNumValidElements()
public boolean htmlElementMeetsCriteria(com.gargoylesoftware.htmlunit.html.HtmlElement htmlElement,
ScrapingSessionState scrapingSessionState)
HtmlForm meets the criteria.htmlElement - An HtmlForm.scrapingSessionState - Resolves variables.