Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Used for implementing FragmentSelector parsers.

    An FragmentSelectorParsers takes a URL hash fragment and parses it into a Selector instance. Each FragmentSelectorParser should typically be specialized for a selector type. Add FragmentSelectorParser implementations to a SelectorFactory to add support for a specific fragment selector format.

    See SelectorFactory for how configure its FragmentSelectorParsers, and how to parse fragment selector strings into Selector instances.

    interface IFragmentSelectorParser {
        canParseFragment(fragment: string): boolean;
        getFragmentSpecificationIri(): string;
        parseFragment(
            fragment: string,
            selectorFactory: ISelectorFactory,
            refinementSelectors: ISelector[],
        ): ISelector;
    }

    Implemented by

    Methods

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

      Parameters

      • fragment: string

      Returns boolean

    • Parses the fragment into a Selector implementation. This method must only be called if canParseFragment() returns true for the specified fragment value. Note that the parsing can fail and return null even if canParseFragment() returns true.

      Parameters

      Returns ISelector