ComponentDetector
in package
Uses the TokenTrieWalker to try and find a set of Components for given input identifier(s).
The properties from the found components are merged and added to the main Properties collection for return to the user.
Tags
Table of Contents
- $componentTypes : mixed
- $deviceData : mixed
- $dynamicPropertiesExtractor : mixed
- $identifiersByComponentType : mixed
- $maxComponentTypeSize : mixed
- $propertyMappingsRunner : mixed
- $trieWalker : mixed
- __construct() : mixed
- getComponents() : mixed
- Get the properties detected from the passed identifier.
- hasValidLookaroundConstraints() : mixed
- Check the lookaround constraint for the match candidate to ensure that _other_ components are present within the allowed offset ranges.
- getComponentsByHeaders() : mixed
- Get properties from the passed collection of identifiers
- getComponentsByLevel() : mixed
- Given a collection of found components within an IdentifierMatchResult select the components that should be returned and used for properties.
- refineComponentsByLevel() : mixed
- Refines the match candidates by running the property constraints and additional actions.
Properties
$componentTypes
private
mixed
$componentTypes
= []
$deviceData
private
mixed
$deviceData
$dynamicPropertiesExtractor
private
mixed
$dynamicPropertiesExtractor
$identifiersByComponentType
private
mixed
$identifiersByComponentType
= []
$maxComponentTypeSize
private
mixed
$maxComponentTypeSize
$propertyMappingsRunner
private
mixed
$propertyMappingsRunner
$trieWalker
private
mixed
$trieWalker
Methods
__construct()
public
__construct(mixed $deviceData, mixed $tokenTrieWalker, mixed $dynamicPropertiesExtractor, mixed $propertyMappingsRunner) : mixed
Parameters
- $deviceData : mixed
- $tokenTrieWalker : mixed
- $dynamicPropertiesExtractor : mixed
- $propertyMappingsRunner : mixed
Return values
mixed —getComponents()
Get the properties detected from the passed identifier.
public
getComponents(mixed $identifierOrHeaders, mixed &$dynamicProperties) : mixed
Parameters
- $identifierOrHeaders : mixed
- $dynamicProperties : mixed
Return values
mixed —hasValidLookaroundConstraints()
Check the lookaround constraint for the match candidate to ensure that _other_ components are present within the allowed offset ranges.
public
static hasValidLookaroundConstraints( $referenceTokenPosition, $lookaroundConstraints, $allCandidates) : mixed
Parameters
Return values
mixed —getComponentsByHeaders()
Get properties from the passed collection of identifiers
private
getComponentsByHeaders(mixed $headers, mixed &$dynamicProperties) : mixed
Parameters
- $headers : mixed
- $dynamicProperties : mixed
Return values
mixed —getComponentsByLevel()
Given a collection of found components within an IdentifierMatchResult select the components that should be returned and used for properties.
private
getComponentsByLevel(mixed $matchResult) : mixed
One component per component level is returned. The component at each level must • Pass the the lookaround constraint if it exists • Be of greater weight than any other component of the same level or be of the same weight but found deeper in the identifier.
Parameters
- $matchResult : mixed
Return values
mixed —refineComponentsByLevel()
Refines the match candidates by running the property constraints and additional actions.
private
refineComponentsByLevel(mixed $result, mixed &$dynamicProperties) : mixed
Java impl.: getComponentsByLevel(final ComponentDetectorResult result, final Map<String, Property> dynamicProperties)
Parameters
- $result : mixed
- $dynamicProperties : mixed