Options
All
  • Public
  • Public/Protected
  • All
Menu

Used for implementing parsers to support different Selector formats. An implementation of ISelectorDataParser takes a JSON object and parses it into a specific Selector instance if the format is recognized.

A SelectorDataParser implementations are typically focused on a single selector type. Add SelectorDataParser implementations to SelectorFactory to add support for a specific selector format.

See SelectorFactory for how configure its SelectorDataParsers, and how to parse JSON data and fragment selectors into Selector instances.

Hierarchy

  • ISelectorDataParser

Implemented by

Index

Methods

canParseSelectorData

  • Should return true if this instance is able to parse the selector data into a Selector implementation. If this method returns true, parseSelectorData() will be called with the selectorData by the SelectorFactory.

    Parameters

    Returns boolean

parseSelectorData

  • Should parse the given selector data into a Selector implementation. This method must only be called if canParseSelectorData() returns true for the specified selectorData.

    Parameters

    • selectorData: ISelectorData

      The JSON data to parse into a Selector.

    • selectorFactory: ISelectorFactory

      The SelectorFactory instance that is calling this method. This factory should be used to parse refinement selectors.

    Returns ISelector

    The Selector instance if the parsing was successful, null otherwise.

Generated using TypeDoc