public abstract class WebHarvestPlugin extends BaseProcessor
elementDef| Constructor and Description |
|---|
WebHarvestPlugin() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
evaluateAttribute(String attName,
Scraper scraper) |
protected boolean |
evaluateAttributeAsBoolean(String attName,
boolean defaultValue,
Scraper scraper) |
protected double |
evaluateAttributeAsDouble(String attName,
double defaultValue,
Scraper scraper) |
protected int |
evaluateAttributeAsInteger(String attName,
int defaultValue,
Scraper scraper) |
Variable |
execute(Scraper scraper,
ScraperContext context) |
protected Variable |
executeBody(Scraper scraper,
ScraperContext context)
Executes body of plugin processor
|
abstract Variable |
executePlugin(Scraper scraper,
ScraperContext context)
Mathod that actually executes processor.
|
String |
getAttributeDesc() |
protected Map |
getAttributes() |
String[] |
getAttributeValueSuggestions(String attributeName) |
Class[] |
getDependantProcessors()
Defines dependant subprocessors that are used inside this plugin and that will
automatically be registered with this plugin.
|
abstract String |
getName()
Defines name of the processor.
|
String[] |
getRequiredAttributes()
This method should return all mandatory attribute names for the plugin processor.
|
String[] |
getRequiredSubprocessors()
This method should return all mandatory subprocessor names, or in other words all
mandatory subtags that must be present in the body of this processor plugin.
|
String |
getTagDesc() |
String[] |
getValidAttributes()
This method should return all possible attribute names for the plugin processor.
|
String[] |
getValidSubprocessors()
This method should return all names of all allowed processors inside the body of
this processor plugin.
|
boolean |
hasBody() |
void |
setDef(WebHarvestPluginDef def) |
debug, getBodyTextContent, getBodyTextContent, getBodyTextContent, getElementDef, getSubprocessors, run, setPropertypublic abstract String getName()
public String[] getValidAttributes()
public String[] getRequiredAttributes()
public String[] getValidSubprocessors()
public String[] getRequiredSubprocessors()
public Class[] getDependantProcessors()
public String[] getAttributeValueSuggestions(String attributeName)
attributeName - Name of plugin attributepublic boolean hasBody()
public final Variable execute(Scraper scraper, ScraperContext context)
execute in class BaseProcessorpublic abstract Variable executePlugin(Scraper scraper, ScraperContext context)
scraper - context - public String getTagDesc()
public String getAttributeDesc()
public void setDef(WebHarvestPluginDef def)
protected Map getAttributes()
protected String evaluateAttribute(String attName, Scraper scraper)
attName - Name of attrubtescraper - protected boolean evaluateAttributeAsBoolean(String attName, boolean defaultValue, Scraper scraper)
attName - Name of attrubtedefaultValue - scraper - protected int evaluateAttributeAsInteger(String attName, int defaultValue, Scraper scraper)
attName - Name of attrubtedefaultValue - scraper - protected double evaluateAttributeAsDouble(String attName, double defaultValue, Scraper scraper)
attName - Name of attrubtedefaultValue - scraper - protected Variable executeBody(Scraper scraper, ScraperContext context)
scraper - context - Copyright © 2022 WSO2. All rights reserved.