MetaFetch class final
Read Document
and find all metadata tags to generate corresponded
MetaInfo.
At the same time, it manages all MetaPropertyParser according to MetaPropertyParser.propertyNamePrefix and will be refer them for finding matched MetaPropertyParser.
Constructors
- MetaFetch.new()
-
Get a instance of MetaFetch.
factory
Properties
- allowRedirect ↔ bool
-
Allow MetaFetch fetch redirected Uri's metadata instead of
provided one.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- primaryPrefix ↔ String?
-
Get which prefix of property will be overriden when parse.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildAllMetaInfo(
Document htmlDocument) → Map< String, MetaInfo> -
Construct all MetaInfo with given
Document
. -
buildMetaInfo(
Document htmlDocument) → MetaInfo -
Construct MetaInfo with given
Document
. -
deregister(
String prefix) → bool -
Remove MetaPropertyParser with corresponded
prefix
. -
fetchAllFromHttp(
Uri url) → Future< Map< String, MetaInfo> > - Fetch all MetaInfo from various protocols into a single Map.
-
fetchFromHttp(
Uri url) → Future< MetaInfo> -
Retrive MetaInfo from HTTP request from
url
. -
hasBeenRegistered(
Object identifier) → bool -
Determine the
identifier
is registered or not. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
MetaPropertyParser parser) → bool -
Register
parser
into MetaFetch. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- disguiseUserAgent ↔ bool
-
Determine using user agent from web browser instead of userAgentString.
getter/setter pair
- timeout → int
-
Retrive current preference of timeout.
no setter
- userAgentString → String
-
Retrive current preference of user agent String.
no setter
Static Methods
-
changeTimeout(
[int seconds = OgHrefClient.DEFAULT_TIMEOUT]) → void - Define timeout of response.
-
changeUserAgent(
[String userAgent = OgHrefClient.DEFAULT_USER_AGENT_STRING]) → void - Define a value of user agent when making request in fetchFromHttp.
-
forTest(
) → MetaFetch -
A dedicated MetaFetch which ignore content type condition that allowing
parse to HTML
Document
.