first
lorem
public interface PaginationPath extends ElementFilter<PaginationPath>, PaginationPathStart, FieldDefinition, PaginationParams
A PaginationPath can be created from an entity using HtmlPaginator.newPath() or from a PaginationGroup using PathCopy.copyPath(). It allows the specification of a reusable path, with common matching rules.
Fields can be added to the PartialPath, and the user needs to provide only the additional rules required to match elements from the starting point defined by the PartialPath, and how to collect the data from the matched elements, using the methods available from a ContentReader.
HtmlEntitySettings,
PartialPathStart,
FieldDefinition,
PathCopy| Modifier and Type | Method and Description |
|---|---|
RecordTriggerStart |
addRecordTrigger()
Starts the definition of a
RecordTrigger, which is essentially a path to an element that when found
makes the parser generate a record will all values accumulated so far. |
T |
copyPath()
Copies the current path allowing new matching to be added to a common path without changing the original
one.
|
attribute, attribute, childOf, classes, containedBy, containedBy, containing, containing, containing, filter, followedBy, followedBy, followedByText, followedImmediatelyBy, id, matchNext, not, parentOf, precededBy, precededBy, precededByText, precededImmediatelyBy, under, underHeader, withExactText, withExactTextMatchCase, withText, withTextMatchCasedownTo, downToFooter, upTo, upToHeadermatch, match, match, matchCurrent, matchFirst, matchLast, selectaddField, addField, addPersistentField, addSilentFieldaddRequestParameter, setCurrentPage, setCurrentPageNumber, setNextPage, setNextPageNumberT copyPath()
lorem
ispum
article
PartialPath that allows the specification of a path and does not affect the path that it
is built upon.RecordTriggerStart addRecordTrigger()
RecordTrigger, which is essentially a path to an element that when found
makes the parser generate a record will all values accumulated so far.
For example, assume you have to capture email address and home address fields from a HTML document of customer
details. In the document, any of the customers fields may or may not exist (i.e. be `null` when parsed).
An example of this HTML is shown below:
```html
| Email Address | bla@email.com |
| Home Address |
| Email Address | |
| Home Address | 123 real street |
RecordTrigger:
```java
HtmlEntityList entityList = new HtmlEntityList();
HtmlEntitySettings contact = entityList.configureEntity("contact");
contact.addField("emailAddress")
.match("td").precededBy("td").withText("Email Address").getText();
contact.addField("homeAddress")
.match("td").precededBy("td").withText("Home Address").getText();
```
This would produce one row with mixed results:
```
[bla.@email.com, 123 real street]
```
Instead of the expected output:
```
[bla.@email.com, null]
[null, 123 real street]
```
The incorrect output is produced because there is no `RecordTriggerStart that defines the path for the triggerCopyright © 2018 uniVocity Software Pty Ltd. All rights reserved.