public final class FormInputValueHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addTrainingInput(Identification identification,
FormInput input)
Add the training data to the form input map.
|
static List<FormInput> |
deserializeFormInputs(File dir)
Serializes form inputs and writes the data to the output directory to be used by future
non-training crawls.
|
Node |
getBelongingNode(FormInput input,
Document dom) |
List<CandidateElement> |
getCandidateElementsForInputs(EmbeddedBrowser browser,
Element sourceElement,
EventableCondition eventableCondition) |
FormInput |
getFormInput(Identification identification)
Get the form input for the DOM element.
|
FormInput |
getFormInputWithIndexValue(EmbeddedBrowser browser,
Node element,
int indexValue) |
static FormInputValueHelper |
getInstance(InputSpecification inputSpecification,
CrawlRules.FormFillMode formFillMode)
Creates or returns the instance of the helper class.
|
static void |
reset()
Removes the instance so another must be built.
|
static void |
serializeFormInputs(File dir)
Serializes form inputs and writes the data to the output directory to be used by future
non-training crawls.
|
public static FormInputValueHelper getInstance(InputSpecification inputSpecification, CrawlRules.FormFillMode formFillMode)
inputSpecification - the input specification.formFillMode - if random data should be used on the input fields.public static void reset()
public List<CandidateElement> getCandidateElementsForInputs(EmbeddedBrowser browser, Element sourceElement, EventableCondition eventableCondition)
browser - the browser instancesourceElement - the form elementseventableCondition - the belonging eventable condition for sourceElementpublic Node getBelongingNode(FormInput input, Document dom) throws XPathExpressionException
input - the form inputdom - the documentXPathExpressionException - if a failure is occurred.public void addTrainingInput(Identification identification, FormInput input)
identification - The identifier.input - The form input.public FormInput getFormInput(Identification identification)
identification - specifies a DOM elementpublic FormInput getFormInputWithIndexValue(EmbeddedBrowser browser, Node element, int indexValue)
browser - the current browser instanceelement - the element in the DOMindexValue - the i-th specified value. if i>#values, first value is usedpublic static void serializeFormInputs(File dir)
dir - The output directory for the form input data.Copyright © 2007–2019. All rights reserved.